post modern C tooling - draft 5

Contemporary C tooling for making higher quality C, faster or more safely.

DRAFT 0 - 10/11/18, 
DRAFT 1 - 9/16/19, 7:19 PM, I'm still working on this, but it's already useful and I'd like some feedback - so I decided to share it early. DRAFT 2 - 10/1/19, mostly additions to static analysis tools.
DRAFT 3 - 10/4/19, updates on build systems, package management, and complexity analysis. 
DRAFT 4 - 10/6/19, run time dynamic verification and instrumentation, sanitizers (asan/ubsan/etc), performance tools, static analyzers.
DRAFT 5 - 10/8/19, C interpreter(s). 

In 2001 or so people started using the phrase "Modern C++". So now that it's 2019, I guess we're in the post modern era? Anyway, this isn't a post about C++ code, but some of this information applies there too.
Welcome to the post modern era. Some of the C++ people have pulled off one of the cleverest and sneakiest tricks ever. They required 'modern' C99 and C11 features in 'recent'…

Using PostgreSQL as a cache?

In the article on his blog Peter asks "How much faster is Redis at storing a blob of JSON compared to PostgreSQL?". Answer: 14x slower.

Seems about right. Usually Redis is about 4x faster for a simple query like that compared to using PostgreSQL as a cache in my experience. It's why so many people use Redis as a cache. But I'd suggest PostgreSQL is good enough to act as a cache for many people.

Django is pretty slow at fetching from PostgreSQL compared to other python options, so this could explain part of the 14x VS 4x difference.

Note that Django should be adding an index because of ForeignKey. However it's possible it isn't being used, or the table may need to analyze stats again. Also note that Django does not support prepared statements built in, and when you don't use prepared statements you do not use the PostgreSQL query cache. Prepared statements can give a 50% speedup often, because they don't have to do the query parsing and do a new quer…

Experiments with new low latency PyPy garbage collector in a thread.

TLDR; less performance spikes, faster average performance, PyPy is a good Python for games and multimedia apps on desktop systems, running GC in a thread is a good idea for GIL releasing apps.
In March 2018 at the PyPy winter sprint I spent some days working on improving pygame support on PyPy. Part of this was investigating pypy frame drop. In there I found PyPy had both lower average performance in this pygame-using-CPython-API benchmark, and had spikes which caused frame drops. Remember that in latency sensitive applications performance spikes are not allowed. Note that not very much of this code is pure python (where PyPy is fastest), so it's almost a worst case benchmark for PyPy performance.

Thanks to Antonio, the PyPy team and their supporters — things have much improved since then. One improvement in particular is that PyPy now allows more control of when the Garbage Collection does its work. Read more about it in the blog post "PyPy for low latency systems".


Year of the Desktop #yearofthedesktop

#yearofthedesktop is a long running joke in FLOSS communities. When will Linux be more popular than Windows on the Desktop?
(please hold back your laughter until the end).
Let me explain why this is the Year of the Desktop, and why community developed software will win (and in fact has already).
TLDR; most PC hardware vendors are shipping Linux machines, Linux had the best cheap laptop of the year, Linux is a good platform for games, Steam now supports 1000s of Windows apps(+ 5000 linux native) and is contributing to Wine, the web is a good high quality desktop software target, government support for Linux desktop is increasing, and even Microsoft is supporting running Linux software on Windows, cheap hardware like Raspberry Pi(and more) is available and usable, community software cares about usability and has a supporting financial model, community development is a kinder place, fragmentation of the Desktop is no more, Gnome receives $1,000,000 donation, governments spend money on co…

🐱‍🏍 — the first pygame 2 community game. Starting now! Are you in?

What is a 🐱‍🏍? *[0].

There was this email thread on the pygame mailing list.
"About Pygame development".
One topic of that conversation was doing a community game in there for reasons(see below).
I would like to do a pygame 2 community game to submit in the: - - (GameOff github jam)
Ludumdare(ldjam) starts in 3 days, 7 hours. Theme not selected yet. GameOff finishes in 4 days 2 hours. Theme is "Hybrid", Jam already started.
So, the Jams finish in 4.1 days. Are you in?  If so join the web based chatroom(discord) in the "#communitygame" channel. Our repo:
I'm trying to form a team now.
... read more?...
click.... loading... loading... buffering... loading... refresh... loading...

So why do this? My reasons for doing this are to push me to get pygame 2 features done that are actually useful in apps (Write Games, Not Engines). It will be a good testbed for prototypi…