text_combined: adam olsen kjbnfagmailcom tue mar 25 2008 211 pm alexander belopolsky wrote tue mar 25 2008 332 pm adam olsen wrote worry might generated code using disgustingly large literals dont see would presents bigger problem stack scheme compared current insert go scheme note disgustingly large 65535 elements literals current code preallocate hash table means hash table may need reallocated dict creation certainly expensive extra stack space batch creation still work dont understand batch creation something related py2exe idea sorry wasnt clear meant may disgustingly large globals exceed maximum size stack allows performance issue done confirmdisprove maximum size batch mean load constants onto stack process single pass rather loading processing go guidos support frozenset later withdrawn httpmailpythonorgpipermailpython30002008january011868html missed however peephole optimizer still use trick proposed dict literals certain contexts 1 2 3 reuse literal regardless whether set frozenset dont know anybody begun implementing though suggest peephole optimizer detect cases set literal bound replace frozenset constant looks like worthwhile optimization also work list literals least optimizer able deal frozenset case even frozenset set works well never modified produced bytecode playing around bit ive found _x 1 2 3 x set_x assuming _x precomputed faster larger literals break even point 10 perhaps could investigate well think mean faster x 1 2 3 exactly speedup hoping exploit set_x constructor need recompute hash values already stored _x ahh yes adam olsen aka rhamphoryncus _______________________________________________ python3000 mailing list smsbmo9552pythonorg httpmailpythonorgmailmanlistinfopython3000 unsubscribe httpmailpythonorgmailmanoptionspython3000python300040tangomucom wed 06 aug 2008 173550 0600 python3000 dict literal bytecode