Author ron_adam
Recipients ron_adam
Date 2011-12-16.00:02:52
SpamBayes Score 1.38496e-05
Marked as misclassified No
Message-id <1323993774.57.0.570625937446.issue13607@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2011-12-16 00:02:55ron_adamsetrecipients: + ron_adam
2011-12-16 00:02:54ron_adamsetmessageid: <1323993774.57.0.570625937446.issue13607@psf.upfronthosting.co.za>
2011-12-16 00:02:53ron_adamlinkissue13607 messages
2011-12-16 00:02:53ron_adamcreate