Message149583
The following changes cleanup the eval loop and result in a pretty solid 2 to 3% improvement in pybench for me.
And it is about 5% faster for long generators.
* Change why enum type to int and #defines. And moved the why defines to opcode.h so that they can be seen by the genrator objects after a yield, return, or exception.
* Added an "int f_why" to frames so the generator can see why it returned from a send.
* Refactored generator obj so it can use the "f->f_why" to determine what to do without having to do several checks first.
* Moved the generator specific execption save/swap/and clear out of the cevel main loop. No need to check for those on every function call.
The only test that fails is the frame size is test_sys. I left that in for now so someone could check that, and tell me if it's ok to fix it, or if I need to do something else.
I also considered putting the why on the tstate object. It might save some memory as there wouldn't be as many of those. |
|
Date |
User |
Action |
Args |
2011-12-16 00:02:55 | ron_adam | set | recipients:
+ ron_adam |
2011-12-16 00:02:54 | ron_adam | set | messageid: <1323993774.57.0.570625937446.issue13607@psf.upfronthosting.co.za> |
2011-12-16 00:02:53 | ron_adam | link | issue13607 messages |
2011-12-16 00:02:53 | ron_adam | create | |
|