[Scons-users] SCons on pypy update

Daniel Holth dholth at gmail.com
Wed Jun 15 11:47:12 EDT 2016


Good news, it is going to be easy to make SCons run perfectly on PyPy. It
looks like almost all of the file opening is concentrated in a handful of
places, usually open(file, "rb").read(); switching to opening the file
using a with: statement closes the file immediately rather than relying on
reference-counted GC to do so, avoiding the 'too many open files' problem.

Unfortunately SCons does a lot of things that are slower on PyPy. cPickle,
for example. But not everything is slower. Using scons' own SConstruct,
'$MYSCONS/script/scons.py -c --quiet -s' is 1.6 times slower in CPython.

I noticed SCons uses pickle protocol 1. Is there a reason it is not using
pickle.HIGHEST_PROTOCOL? It doesn't seem to change the comparison for pypy,
but the higher protocol is supposedly faster on CPython. It could also be
changed to use JSON, but that would be a lot more work.

I also noticed there are a few classes that inherit from
collections.UserList. Maybe they only do that because SCons is older than
inheriting from builtin types in Python, and could be changed to simply
inherit from list.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20160615/3e30d6e1/attachment.html>


More information about the Scons-users mailing list