Message186205
In response to Alexandre's comment on Rietveld. Access to a local variable is faster than to a global one and the current implementation uses this for struct.pack. I just use same trick for struct.unpack. Here is a microbenchmark which demonstrate some effect of this optimization. I got 0.6491418619989417, 0.6947214259998873, and 0.5394902769985492 for optimized, non-optimized and advanced optimized functions.
Of course, we can achieve even better effect if we will cache not only struct.pack, but struct.Struct('<i').pack, struct.Struct('B').pack, etc. I were considered this as a reason for other patch, but we can do it in this issue. |
|
Date |
User |
Action |
Args |
2013-04-07 13:25:41 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, jcea, pitrou, alexandre.vassalotti |
2013-04-07 13:25:41 | serhiy.storchaka | set | messageid: <1365341141.94.0.603956907363.issue16551@psf.upfronthosting.co.za> |
2013-04-07 13:25:41 | serhiy.storchaka | link | issue16551 messages |
2013-04-07 13:25:41 | serhiy.storchaka | create | |
|