Enabled with `pstats-python-profiler 1`, requires recent version of PStats server.
Currently, it is limited to the main thread only. Support for other threads may be added at a later date.
Currently, the client doesn't send nested start/stop pairs, but there is no good reason not to handle this case in the server, and in some cases it is useful to send them (I will soon make changes on master to take advantage of this).
Client version 3.1 indicates that the client may send nested start/stop pairs.
It can be very useful to know how often a collector was invoked in a frame, not just how long it took. This adds a number to the upper-right corner showing exactly that (but not aggregated, just for leaf collectors).
Remove the use of set and list, which are allocator-heavy and insertion was a bottleneck. Since each sample occurs only once on the linked list, we can more efficiently roll our own linked list with next and prev pointers, so no allocation needed. Instead of the set, we can just store a per-collector flag.
Previously, forward stages would be uninitialized, resulting in cryptic errors with ahead-of-time preparation (although arguably ahead-of-time preparation is a bug in and of itself)
When copying a dirty cycler, don't use two separate lock-grabbing calls to add to the clean set, then remove from clean set and move to dirty set
Short-cut the cdata copy loop for the common case of only 1 stage
See #1394 - creates a new finalize_distribution_options entry point that makes sure that either `py_modules` or `packages` is present, otherwise setuptools will activate its new auto-discovery system, even for custom commands that don't need setuptools' discovery system.
However, this is not a great solution, because it applies when running all setuptools commands, not just build_apps.
Reduces code duplication, makes it possible to inherit bug fixes from the base class, and also handles resizes more efficiently now (only when this would actually require a framebuffer reallocation).
Updates the context on the main thread instead of the draw thread now. If render_frame happens to run while the context needs updating, it will skip the frame.
Fixes#1286