Opened 11 years ago
Last modified 11 years ago
#2340 enhancement new
Special case inlineCallbacks for case where Deferred already has value
Reported by: | itamarst | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | core | Keywords: | |
Cc: | Branch: | ||
Author: |
Description
The value of a Deferred can be extracted without addCallbacks. Having inlineCallbacks do this should speed it up. Obviously this breaks abstraction, but (only!) within context of t.i.defer that's probably fine.
Benchmarks I sent to jknight separately demonstrate this change speeds up this case dramatically, and slightly speeds up the other case (with a buggy implementation, but still).
Attachments (1)
Change History (4)
comment:1 Changed 11 years ago by
Changed 11 years ago by
Attachment: | inlineCallbacks_benchmark.py added |
---|
Benchmarks for inlineCallbacks and friends
comment:2 Changed 11 years ago by
Cleaned up benchmarks are attached. They include the (buggy) optimization to inlineCallbacks.
comment:3 Changed 7 years ago by
Owner: | jknight deleted |
---|
Note: See
TracTickets for help on using
tickets.
The benchmarks should be added to Twisted as well, of course. I think it would be good if they were actually the main focus of this ticket. This sounds like a good optimization, but specific optimization should be driven by the benchmarks, not just justified by them.