Skip to content

Decouple AbstractContinuation and CancellableContinuation from Job interface #334

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Apr 29, 2018

Conversation

qwwdfsad
Copy link
Member

@qwwdfsad qwwdfsad commented Apr 17, 2018

Decouples CancellableContinuation from Job.

Pros:

  1. Some workarounds from Job may be removed
  2. State machine of AbstractContinuation becomes much simpler
  3. AbstractContinuation state is now more compact and start/cancel produce less garbage (and state transitions are more lightweight)

2, 3 => all integration modules become faster (~25% win in cancellation benchmark).

Cons:

  1. Binary compatibility may be broken in some places
  2. Compatibility is broken due to changes in invokeOnCompletion contract
  3. Small maintenance mess ("similar, but not the same" code)

In general, it boosts the performance of cancellable continuations, allows to do specific optimizations (e.g., it makes sense to get rid of resumeMode after merging this change and replace it with inheritance to reduce memory footprint even more) and allows us to move CancellableContinuation to stdlib

@qwwdfsad qwwdfsad changed the title Decouple AbstractContinuation and CancellableContinuation rom Job interaface Decouple AbstractContinuation and CancellableContinuation from Job interface Apr 17, 2018
@fvasco
Copy link
Contributor

fvasco commented Apr 17, 2018

Release with #311

Implementation-independent extensions
Remove and encapsulate parts of JobSupport
Assert invariants in AbstractContinuation
Use separate code path for Cancelling state
@qwwdfsad
Copy link
Member Author

Fixes #219

@elizarov elizarov merged commit e0b6db0 into develop Apr 29, 2018
@elizarov elizarov deleted the decouple-job branch April 29, 2018 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants