[Python-Dev] Python startup time: String objects (original) (raw)

Martin v. Löwis martin at v.loewis.de
Thu Mar 25 08:29:29 EST 2004


But is this really where the time goes? On my home box (~11K pystones/second) I can allocate 12K strings in 17 msec.

I have now implemented this change, and it gives 2% speed-up for an empty source file. The change is at http://python.org/sf/923098.

It seems that marshalling would have to become a two-pass thing, unless you want to limit that dict/list to function scope, in which case I'm not sure it'll make much of a difference.

It's actually simpler than that. Marshalling recursively marshals code objects that have already been created, and traverses them all. So a single dict/list is sufficient. The change is 60 lines in marshal.c

Regards, Martin



More information about the Python-Dev mailing list