Skip to content

Conversation

@andersio
Copy link
Member

@andersio andersio commented Jul 16, 2017

These speedups are applicable to only closure-based observation APIs (i.e. startWithSignal is ineligible).

Item testSequence (32 items) testValue
master avg 30296 ns; min 26426 ns avg 8910 ns; min 8171 ns
unsafeAction avg 16092 ns; min 14627 ns avg 2928 ns; min 2568 ns
+unsafeUninterruptibleAction avg 16140 ns; min 14502 ns avg 664 ns; min 587 ns
Speedup ~1.85x ~13.5x

Benchmark source.

This PR also relaxed UnsafeAtomicState.is.

Checklist

  • Updated CHANGELOG.md.

@andersio andersio closed this Jul 16, 2017
@andersio
Copy link
Member Author

andersio commented Jul 16, 2017

This is not ready though. It needs way more changes so that not only direct observation to constant SignalProducers is benefited. 😕

@andersio andersio force-pushed the constant-observer branch from 1908e13 to 2c1fda2 Compare July 16, 2017 09:18
@andersio andersio closed this Jul 16, 2017
@andersio
Copy link
Member Author

andersio commented Jul 16, 2017

Some interesting numbers:

@testSequence(): avg 15598 ns; min 14388 ns
@testFlatMapSequence(): avg 152921 ns; min 137964 ns

@testValue(): avg 660 ns; min 591 ns
@testFlatMapValue(): avg 54609 ns; min 49320 ns

testFlatMapSequence is basically testSequence but in the form of [2, 4, 8, 16].flatMap { repeat 1 for $0 times }.

:/

@andersio andersio deleted the constant-observer branch July 16, 2017 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants