Ticket #2340 enhancement new

Opened 7 years ago

Last modified 7 years ago

Special case inlineCallbacks for case where Deferred already has value

Reported by: itamarst Owned by:
Priority: normal Milestone:
Component: core Keywords:
Cc: Branch:
Author: Launchpad Bug:

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

inlineCallbacks_benchmark.py Download (5.1 KB) - added by itamarst 7 years ago.
Benchmarks for inlineCallbacks and friends

Change History

1

Changed 7 years ago by exarkun

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.

Changed 7 years ago by itamarst

Benchmarks for inlineCallbacks and friends

2

Changed 7 years ago by itamarst

Cleaned up benchmarks are attached. They include the (buggy) optimization to inlineCallbacks.

3

Changed 3 years ago by <automation>

  • owner jknight deleted
Note: See TracTickets for help on using tickets.