Re: Python and STL efficiency
TimBut beware! For Python2.5 I had to change the code slightly,
Timbecause it already realized that the expression
Tim'%s' % 'something'
Timwill be a constant expression, and evaluates it once only... so I
Timhad to replace '%s' with a variable, and I got the timings above
Timwhich show Python2.5 to be slightly faster than Python2.4.
Shouldn't you then get rid of any compiler optimizations your C++ compiler
does? Why penalize 2.5 because it recognizes a useful optimization?
Tim(Next step would be to create a VB version and a Java version of
Timthe same program, oh and perhaps to try a version that would work
Timwith Jython... perhaps somehow w/o the 'set')
I don't recall the example exactly, but couldn't you just create a set class
that uses a dict under the covers and only implement the methods you need
for the test?
Skip
TimBut beware! For Python2.5 I had to change the code slightly,
Timbecause it already realized that the expression
Tim'%s' % 'something'
Timwill be a constant expression, and evaluates it once only... so I
Timhad to replace '%s' with a variable, and I got the timings above
Timwhich show Python2.5 to be slightly faster than Python2.4.
Shouldn't you then get rid of any compiler optimizations your C++ compiler
does? Why penalize 2.5 because it recognizes a useful optimization?
Tim(Next step would be to create a VB version and a Java version of
Timthe same program, oh and perhaps to try a version that would work
Timwith Jython... perhaps somehow w/o the 'set')
I don't recall the example exactly, but couldn't you just create a set class
that uses a dict under the covers and only implement the methods you need
for the test?
Skip
Comment