Hi, 2010/7/3 Bengt Richter <[email protected]>: > A thought/question: > > Could/does JIT make use of information in an assert statement? E.g., could we > write > assert set(type(x) for x in img) == set([float]) and len(img)==640*480 > in front of a loop operating on img and have JIT use the info as assumed true > even when "if __debug__:" suites are optimized away? > > Could such assertions allow e.g. a list to be implemented as a homogeneous > vector > of unboxed representations? > > What kind of guidelines for writing assertions would have to exist to make > them > useful to JIT most easily?
If efficient python code needs this, I'd better write the loop in C and explicitly choose the types. The C code could be inlined in the python script, and compiled on demand. At least you'll know what you get. -- Amaury Forgeot d'Arc _______________________________________________ [email protected] http://codespeak.net/mailman/listinfo/pypy-dev
