Skip to content
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

Experimental useSelector to avoid stale props #1505

Closed
wants to merge 4 commits into from

Conversation

dai-shi
Copy link
Contributor

@dai-shi dai-shi commented Jan 20, 2020

https://twitter.com/dai_shi/status/1219245681249939456
I just noticed we haven't tried this, have we?

stale props spec is from #1179 (comment) by @MrWolfZ.

Unfortunately, useSelector.spec is failing. Although I spent some time, I'm not sure how this is happening. react-redux's Subscription mechanism is still new to me.

@netlify
Copy link

netlify bot commented Jan 20, 2020

Deploy preview for react-redux-docs ready!

Built with commit 719d97e

https://deploy-preview-1505--react-redux-docs.netlify.com

@markerikson
Copy link
Contributor

Looking at this implementation, it's not going to work as-is, and I think it's going down the wrong path.

In particular:

subscription.onStateChange = dispatch

We have to do the selection and diff checking work before React gets involved. This forces a dispatch as soon as the store is updated, regardless of whether this component's selected values have changed or not.

@dai-shi
Copy link
Contributor Author

dai-shi commented Jan 20, 2020

That's true, but react bails out rendering if the selected state is not changed. Your concern (and mine too) is the performance. I'll try doing benchmarks in reactive-react-redux (just because I'm used to it).

The whole point of this experimental change is we no longer require try-catch hack for stale props. We read the future selector and let useReducer bail out. It may slows down a bit for sure, but hopefully not noticeably.

@markerikson
Copy link
Contributor

My intuition says this would kill perf. Every Redux-using component is going to be flagged for re-render, on every dispatch.

@dai-shi
Copy link
Contributor Author

dai-shi commented Jan 21, 2020

Unfortunately, it's not like what I expected.

Running benchmark deeptree
  react-redux type-version: useSelector-7.1.0-cff554d
    Checking max FPS... (30 seconds)
    Running trace...    (30 seconds)
  react-redux type-version: useSelector-7.1.0-58f69ad
    Checking max FPS... (30 seconds)
    Running trace...    (30 seconds)

Results for benchmark deeptree:
┌───────────────────────────┬─────────┬──────────────┬───────────┬───────────┬──────────┬────────────────────────────────────────────────────────────────────────────────────────┐
│ Type-Version              │ Avg FPS │ Render       │ Scripting │ Rendering │ Painting │ FPS Values                                                                             │
│                           │         │ (Mount, Avg) │           │           │          │                                                                                        │
├───────────────────────────┼─────────┼──────────────┼───────────┼───────────┼──────────┼────────────────────────────────────────────────────────────────────────────────────────┤
│ useSelector-7.1.0-58f69ad │ 28.95   │ 90.6, 1.1    │ 15579.31  │ 8034.23   │ 3542.62  │ 34,35,30,27,33,32,33,35,34,31,29,32,35,34,35,30,32,22,19,20,21,18,17,20,20             │
├───────────────────────────┼─────────┼──────────────┼───────────┼───────────┼──────────┼────────────────────────────────────────────────────────────────────────────────────────┤
│ useSelector-7.1.0-cff554d │ 31.27   │ 122.1, 0.8   │ 10699.49  │ 10507.32  │ 5090.10  │ 25,33,37,36,41,27,24,32,42,41,37,12,16,27,36,41,40,34,40,38,40,26,27,25,27,25,20,23,23 │
└───────────────────────────┴─────────┴──────────────┴───────────┴───────────┴──────────┴────────────────────────────────────────────────────────────────────────────────────────┘
Running benchmark deeptree-nested
  react-redux type-version: useSelector-7.1.0-cff554d
    Checking max FPS... (30 seconds)
    Running trace...    (30 seconds)
  react-redux type-version: useSelector-7.1.0-58f69ad
    Checking max FPS... (30 seconds)
    Running trace...    (30 seconds)

Results for benchmark deeptree-nested:
┌───────────────────────────┬─────────┬──────────────┬───────────┬───────────┬──────────┬────────────────────────────────────────────────────────────────────────────────────────┐
│ Type-Version              │ Avg FPS │ Render       │ Scripting │ Rendering │ Painting │ FPS Values                                                                             │
│                           │         │ (Mount, Avg) │           │           │          │                                                                                        │
├───────────────────────────┼─────────┼──────────────┼───────────┼───────────┼──────────┼────────────────────────────────────────────────────────────────────────────────────────┤
│ useSelector-7.1.0-58f69ad │ 46.09   │ 137.8, 1.1   │ 9119.42   │ 4665.84   │ 1816.03  │ 50,58,55,57,55,53,57,53,52,53,52,31,53,54,52,53,51,49,39,29,38,42,34,38,37,31,28,32,32 │
├───────────────────────────┼─────────┼──────────────┼───────────┼───────────┼──────────┼────────────────────────────────────────────────────────────────────────────────────────┤
│ useSelector-7.1.0-cff554d │ 46.25   │ 146.1, 0.5   │ 7057.11   │ 5180.26   │ 2049.15  │ 51,58,56,58,59,58,59,56,57,55,54,41,51,31,27,23,29,47,44,46,45,32,25,38,42,37,37       │
└───────────────────────────┴─────────┴──────────────┴───────────┴───────────┴──────────┴────────────────────────────────────────────────────────────────────────────────────────┘
Running benchmark forms
  react-redux type-version: useSelector-7.1.0-cff554d
    Checking max FPS... (30 seconds)
    Running trace...    (30 seconds)
  react-redux type-version: useSelector-7.1.0-58f69ad
    Checking max FPS... (30 seconds)
    Running trace...    (30 seconds)

Results for benchmark forms:
┌───────────────────────────┬─────────┬──────────────┬───────────┬───────────┬──────────┬────────────────────────────────────────────────────────────────────────────┐
│ Type-Version              │ Avg FPS │ Render       │ Scripting │ Rendering │ Painting │ FPS Values                                                                 │
│                           │         │ (Mount, Avg) │           │           │          │                                                                            │
├───────────────────────────┼─────────┼──────────────┼───────────┼───────────┼──────────┼────────────────────────────────────────────────────────────────────────────┤
│ useSelector-7.1.0-58f69ad │ 53.76   │ 1224.0, 0.3  │ 7110.29   │ 1124.71   │ 2888.52  │ 55,57,49,56,57,56,57,56,57,58,54,43,49,54,58,56,57,56,26,53,55,56,55,45,45 │
├───────────────────────────┼─────────┼──────────────┼───────────┼───────────┼──────────┼────────────────────────────────────────────────────────────────────────────┤
│ useSelector-7.1.0-cff554d │ 54.36   │ 1307.0, 0.3  │ 6112.22   │ 1051.70   │ 2851.71  │ 55,57,55,51,56,54,56,54,53,57,48,57,56,53,54,55,54,57,55,57,55,54,49,45,45 │
└───────────────────────────┴─────────┴──────────────┴───────────┴───────────┴──────────┴────────────────────────────────────────────────────────────────────────────┘
Running benchmark stockticker
  react-redux type-version: useSelector-7.1.0-cff554d
    Checking max FPS... (30 seconds)
    Running trace...    (30 seconds)
  react-redux type-version: useSelector-7.1.0-58f69ad
    Checking max FPS... (30 seconds)
    Running trace...    (30 seconds)

Results for benchmark stockticker:
┌───────────────────────────┬─────────┬──────────────┬───────────┬───────────┬──────────┬────────────────────────────────────────────────────────────────────────────────────────┐
│ Type-Version              │ Avg FPS │ Render       │ Scripting │ Rendering │ Painting │ FPS Values                                                                             │
│                           │         │ (Mount, Avg) │           │           │          │                                                                                        │
├───────────────────────────┼─────────┼──────────────┼───────────┼───────────┼──────────┼────────────────────────────────────────────────────────────────────────────────────────┤
│ useSelector-7.1.0-58f69ad │ 34.87   │ 231.0, 0.9   │ 15697.76  │ 9248.19   │ 2848.39  │ 40,31,34,42,38,37,41,34,37,45,34,31,32,40,33,32,28,39,36,37,31,37,31,32,35,34,28,30,30 │
├───────────────────────────┼─────────┼──────────────┼───────────┼───────────┼──────────┼────────────────────────────────────────────────────────────────────────────────────────┤
│ useSelector-7.1.0-cff554d │ 49.48   │ 234.7, 0.6   │ 10981.23  │ 12601.48  │ 4219.99  │ 52,58,49,57,58,57,60,57,60,58,59,60,57,53,38,24,45,33,24,18,30,45,49,52,55,54,54       │
└───────────────────────────┴─────────┴──────────────┴───────────┴───────────┴──────────┴────────────────────────────────────────────────────────────────────────────────────────┘
Running benchmark tree-view
  react-redux type-version: useSelector-7.1.0-cff554d
    Checking max FPS... (30 seconds)
    Running trace...    (30 seconds)
  react-redux type-version: useSelector-7.1.0-58f69ad
    Checking max FPS... (30 seconds)
    Running trace...    (30 seconds)

Results for benchmark tree-view:
┌───────────────────────────┬─────────┬──────────────┬───────────┬───────────┬──────────┬──────────────────────────────────────────────────────────────────────────────────┐
│ Type-Version              │ Avg FPS │ Render       │ Scripting │ Rendering │ Painting │ FPS Values                                                                       │
│                           │         │ (Mount, Avg) │           │           │          │                                                                                  │
├───────────────────────────┼─────────┼──────────────┼───────────┼───────────┼──────────┼──────────────────────────────────────────────────────────────────────────────────┤
│ useSelector-7.1.0-58f69ad │ 47.44   │ 583.7, 1.5   │ 9689.38   │ 9250.94   │ 681.57   │ 41,51,56,44,46,31,52,49,53,40,51,43,47,49,52,51,52,46,53,43,45,48,33,49,52,52    │
├───────────────────────────┼─────────┼──────────────┼───────────┼───────────┼──────────┼──────────────────────────────────────────────────────────────────────────────────┤
│ useSelector-7.1.0-cff554d │ 48.52   │ 542.6, 1.1   │ 6911.69   │ 9850.37   │ 699.45   │ 40,49,57,42,43,27,53,50,54,53,45,50,48,51,50,56,35,57,52,55,52,47,45,52,47,51,51 │
└───────────────────────────┴─────────┴──────────────┴───────────┴───────────┴──────────┴──────────────────────────────────────────────────────────────────────────────────┘
Running benchmark twitter-lite
  react-redux type-version: useSelector-7.1.0-cff554d
    Checking max FPS... (30 seconds)
    Running trace...    (30 seconds)
  react-redux type-version: useSelector-7.1.0-58f69ad
    Checking max FPS... (30 seconds)
    Running trace...    (30 seconds)

Results for benchmark twitter-lite:
┌───────────────────────────┬─────────┬──────────────┬───────────┬───────────┬──────────┬────────────────────────────────────────────────────────────────────────────┐
│ Type-Version              │ Avg FPS │ Render       │ Scripting │ Rendering │ Painting │ FPS Values                                                                 │
│                           │         │ (Mount, Avg) │           │           │          │                                                                            │
├───────────────────────────┼─────────┼──────────────┼───────────┼───────────┼──────────┼────────────────────────────────────────────────────────────────────────────┤
│ useSelector-7.1.0-58f69ad │ 46.60   │ 5.2, 0.6     │ 19073.38  │ 4251.76   │ 931.72   │ 60,59,60,59,60,56,47,57,58,59,55,54,47,40,33,38,36,40,35,32,34,21,6,14,14  │
├───────────────────────────┼─────────┼──────────────┼───────────┼───────────┼──────────┼────────────────────────────────────────────────────────────────────────────┤
│ useSelector-7.1.0-cff554d │ 52.39   │ 3.3, 0.6     │ 16308.14  │ 5895.26   │ 1240.23  │ 59,47,57,54,57,59,60,59,57,58,59,58,55,46,55,53,49,45,40,45,42,37,42,36,36 │
└───────────────────────────┴─────────┴──────────────┴───────────┴───────────┴──────────┴────────────────────────────────────────────────────────────────────────────┘

The result doesn't seem bad, but as it's not likely to solve the stale props issue and there would be many edge cases to be broken, let me close this.

Would be glad to continue discussion and hope someone come up with better ideas...

@dai-shi dai-shi closed this Jan 21, 2020
dai-shi added a commit to dai-shi/react-redux that referenced this pull request Jan 27, 2020
@dai-shi
Copy link
Contributor Author

dai-shi commented Feb 8, 2020

Just wanted to leave a comment here because I saw the discussion in facebook/react#17953 (comment), which is somewhat related to or at least inspiring my experience in this experiment.

Experimenting further, the current behavior is that reducer is called twice, one with stale selector and the other with new selector. So, if we used a ref value we could control it.

Long story short, it worked and revealed this approach has limitation in performance.

Note: this is about blocking mode, not concurrent mode.

@dai-shi dai-shi reopened this Feb 8, 2020
@dai-shi
Copy link
Contributor Author

dai-shi commented Feb 8, 2020

719d97e this commit passes the test/integration/stale-props.spec.js test.

It behaves like this:

  1. store state changes
  2. invoke dispatch of useReducer
  3. reducer runs and schedule update
  4. render from the top again (because of batchedUpdates?)
  5. reducer runs again with fresh selector
  6. bails out if the selected state doesn't change

We don't see the intermediate state in step 4, but it seems the render function with the hook actually runs (but doesn't commit).
So, the performance of this approach will be bad. I presume it would be like v6.

Please check out the code if someone is interested.

Note that this experiment is mainly a trial to pass the stale-props spec. It means that the spec itself can be valuable (I'm not the original author).

Lastly, although this approach has the performance limitation to solve stale props, it could be still useful. #1509 uses this approach to implement use-subscription technique. (It doesn't solve stale props, but CM tearing.)

@dai-shi dai-shi closed this Feb 8, 2020
@dai-shi dai-shi mentioned this pull request Mar 12, 2020
@dai-shi
Copy link
Contributor Author

dai-shi commented Mar 16, 2020

@markerikson said https://gist.github.com/KidkArolis/26cb3f998899b525dbdfd85f7f3c7978#gistcomment-3214066

Right, that's basically what v6 did.

Well, yeah... but v6 didn't have useSelector. Anyway, we are on the same page. Just out of curiosity, let me run the benchmarks.


Hm, this is far slower than I expected. I wonder how the benchmarks are going to go with useMutableSource.

$ REDUX=6.0.0:7.1.3:7.1.3-719d97e yarn start
yarn run v1.22.4
$ node ./runBenchmarks.js
Running benchmark deeptree
  react-redux type-version: connect-6.0.0
    Checking max FPS... (30 seconds)
    Running trace...    (30 seconds)
  react-redux type-version: connect-7.1.3
    Checking max FPS... (30 seconds)
    Running trace...    (30 seconds)
  react-redux type-version: useSelector-7.1.3
    Checking max FPS... (30 seconds)
    Running trace...    (30 seconds)
  react-redux type-version: connect-7.1.3-719d97e
    Checking max FPS... (30 seconds)
    Running trace...    (30 seconds)
  react-redux type-version: useSelector-7.1.3-719d97e
    Checking max FPS... (30 seconds)
    Running trace...    (30 seconds)

Results for benchmark deeptree:
┌───────────────────────────┬─────────┬──────────────┬───────────┬───────────┬──────────┬─────────────────────────────────────────────────────────────────────────┐
│ Type-Version              │ Avg FPS │ Render       │ Scripting │ Rendering │ Painting │ FPS Values                                                              │
│                           │         │ (Mount, Avg) │           │           │          │                                                                         │
├───────────────────────────┼─────────┼──────────────┼───────────┼───────────┼──────────┼─────────────────────────────────────────────────────────────────────────┤
│ connect-6.0.0             │ 12.67   │ 158.8, 5.0   │ 23901.80  │ 3471.29   │ 1394.31  │ 12,13,12,13,12,13,12,13,12,13,12,13,12,13,12,13,13                      │
├───────────────────────────┼─────────┼──────────────┼───────────┼───────────┼──────────┼─────────────────────────────────────────────────────────────────────────┤
│ connect-7.1.3             │ 39.32   │ 107.7, 0.7   │ 10840.37  │ 10050.09  │ 5415.38  │ 46,49,48,49,48,49,50,49,50,48,46,38,29,32,30,31,29,30,29,30,28,23,22,22 │
├───────────────────────────┼─────────┼──────────────┼───────────┼───────────┼──────────┼─────────────────────────────────────────────────────────────────────────┤
│ connect-7.1.3-719d97e     │ 38.70   │ 112.1, 0.7   │ 10872.80  │ 10028.49  │ 5411.40  │ 48,46,47,50,48,47,49,47,46,48,49,35,30,31,30,31,29,30,28,21,19,19       │
├───────────────────────────┼─────────┼──────────────┼───────────┼───────────┼──────────┼─────────────────────────────────────────────────────────────────────────┤
│ useSelector-7.1.3         │ 38.94   │ 77.3, 0.6    │ 10133.35  │ 10419.04  │ 5672.98  │ 50,47,50,49,48,50,51,48,46,49,31,30,32,31,29,30,29,23,21,20,21,21       │
├───────────────────────────┼─────────┼──────────────┼───────────┼───────────┼──────────┼─────────────────────────────────────────────────────────────────────────┤
│ useSelector-7.1.3-719d97e │ 11.96   │ 117.9, 3.5   │ 24080.56  │ 3313.41   │ 1355.40  │ 11,12,11,12,13,12,13,12,13,12,11,12,11,12,13,11,13,12,12                │
└───────────────────────────┴─────────┴──────────────┴───────────┴───────────┴──────────┴─────────────────────────────────────────────────────────────────────────┘
Running benchmark deeptree-nested
  react-redux type-version: connect-6.0.0
    Checking max FPS... (30 seconds)
    Running trace...    (30 seconds)
  react-redux type-version: connect-7.1.3
    Checking max FPS... (30 seconds)
    Running trace...    (30 seconds)
  react-redux type-version: useSelector-7.1.3
    Checking max FPS... (30 seconds)
    Running trace...    (30 seconds)
  react-redux type-version: connect-7.1.3-719d97e
    Checking max FPS... (30 seconds)
    Running trace...    (30 seconds)
  react-redux type-version: useSelector-7.1.3-719d97e
    Checking max FPS... (30 seconds)
    Running trace...    (30 seconds)

Results for benchmark deeptree-nested:
┌───────────────────────────┬─────────┬──────────────┬───────────┬───────────┬──────────┬───────────────────────────────────────────────────────────────────────────────┐
│ Type-Version              │ Avg FPS │ Render       │ Scripting │ Rendering │ Painting │ FPS Values                                                                    │
│                           │         │ (Mount, Avg) │           │           │          │                                                                               │
├───────────────────────────┼─────────┼──────────────┼───────────┼───────────┼──────────┼───────────────────────────────────────────────────────────────────────────────┤
│ connect-6.0.0             │ 15.61   │ 149.3, 6.6   │ 20615.64  │ 3416.99   │ 822.65   │ 17,18,17,16,19,17,18,19,16,17,18,16,15,18,17,15,14,13,12,14,15,14,12,13,12,12 │
├───────────────────────────┼─────────┼──────────────┼───────────┼───────────┼──────────┼───────────────────────────────────────────────────────────────────────────────┤
│ connect-7.1.3             │ 51.66   │ 170.0, 0.4   │ 6392.34   │ 4054.99   │ 1812.35  │ 58,57,56,57,59,58,57,55,57,56,55,54,56,54,48,45,47,43,41,46,42,43,45,45       │
├───────────────────────────┼─────────┼──────────────┼───────────┼───────────┼──────────┼───────────────────────────────────────────────────────────────────────────────┤
│ connect-7.1.3-719d97e     │ 51.74   │ 212.0, 0.4   │ 6344.40   │ 4065.04   │ 1817.36  │ 56,60,54,59,56,58,59,56,55,57,55,56,57,53,54,48,44,47,44,48,44,43,44,45,40,40 │
├───────────────────────────┼─────────┼──────────────┼───────────┼───────────┼──────────┼───────────────────────────────────────────────────────────────────────────────┤
│ useSelector-7.1.3         │ 51.96   │ 146.9, 0.4   │ 5409.80   │ 4040.38   │ 1886.56  │ 53,58,57,55,56,58,57,58,55,56,54,56,55,52,47,46,43,48,42,43,47,44,45,45       │
├───────────────────────────┼─────────┼──────────────┼───────────┼───────────┼──────────┼───────────────────────────────────────────────────────────────────────────────┤
│ useSelector-7.1.3-719d97e │ 14.18   │ 117.1, 3.8   │ 21168.93  │ 3290.71   │ 755.31   │ 11,15,14,15,13,15,18,16,14,17,14,16,17,16,15,13,12,13,14,13,15,13,12,13,13    │
└───────────────────────────┴─────────┴──────────────┴───────────┴───────────┴──────────┴───────────────────────────────────────────────────────────────────────────────┘
Running benchmark forms
  react-redux type-version: connect-6.0.0
    Checking max FPS... (30 seconds)
    Running trace...    (30 seconds)
  react-redux type-version: connect-7.1.3
    Checking max FPS... (30 seconds)
    Running trace...    (30 seconds)
  react-redux type-version: useSelector-7.1.3
    Checking max FPS... (30 seconds)
    Running trace...    (30 seconds)
  react-redux type-version: connect-7.1.3-719d97e
    Checking max FPS... (30 seconds)
    Running trace...    (30 seconds)
  react-redux type-version: useSelector-7.1.3-719d97e
    Checking max FPS... (30 seconds)
    Running trace...    (30 seconds)

Results for benchmark forms:
┌───────────────────────────┬─────────┬──────────────┬───────────┬───────────┬──────────┬────────────────────────────────────────────────────────────────────────────┐
│ Type-Version              │ Avg FPS │ Render       │ Scripting │ Rendering │ Painting │ FPS Values                                                                 │
│                           │         │ (Mount, Avg) │           │           │          │                                                                            │
├───────────────────────────┼─────────┼──────────────┼───────────┼───────────┼──────────┼────────────────────────────────────────────────────────────────────────────┤
│ connect-6.0.0             │ 53.72   │ 1142.8, 2.0  │ 10289.04  │ 862.16    │ 2533.71  │ 52,49,52,54,57,53,55,54,49,51,52,56,54,55,54,56,51,47,54,57,56,55,56,53,53 │
├───────────────────────────┼─────────┼──────────────┼───────────┼───────────┼──────────┼────────────────────────────────────────────────────────────────────────────┤
│ connect-7.1.3             │ 56.00   │ 1092.5, 0.3  │ 6658.20   │ 981.99    │ 2663.42  │ 56,57,58,56,57,58,57,58,57,59,55,56,55,57,53,51,55,53,55,56,54,56,56       │
├───────────────────────────┼─────────┼──────────────┼───────────┼───────────┼──────────┼────────────────────────────────────────────────────────────────────────────┤
│ connect-7.1.3-719d97e     │ 56.31   │ 1133.4, 0.3  │ 6984.26   │ 1018.92   │ 2701.53  │ 57,56,57,59,55,57,55,56,55,57,52,57,56,57,57                               │
├───────────────────────────┼─────────┼──────────────┼───────────┼───────────┼──────────┼────────────────────────────────────────────────────────────────────────────┤
│ useSelector-7.1.3         │ 56.54   │ 1089.1, 0.3  │ 5530.84   │ 1006.69   │ 2786.70  │ 57,54,56,58,56,57,60,58,55,54,58,56,54,56,58,56,58,56,58,56,56             │
├───────────────────────────┼─────────┼──────────────┼───────────┼───────────┼──────────┼────────────────────────────────────────────────────────────────────────────┤
│ useSelector-7.1.3-719d97e │ 22.31   │ 1100.2, 0.4  │ 20055.71  │ 527.93    │ 1163.88  │ 21,18,22,23,20,22,25,22,25,22,23,24,21,24,21,24,21,21                      │
└───────────────────────────┴─────────┴──────────────┴───────────┴───────────┴──────────┴────────────────────────────────────────────────────────────────────────────┘
Running benchmark stockticker
  react-redux type-version: connect-6.0.0
    Checking max FPS... (30 seconds)
    Running trace...    (30 seconds)
  react-redux type-version: connect-7.1.3
    Checking max FPS... (30 seconds)
    Running trace...    (30 seconds)
  react-redux type-version: useSelector-7.1.3
    Checking max FPS... (30 seconds)
    Running trace...    (30 seconds)
  react-redux type-version: connect-7.1.3-719d97e
    Checking max FPS... (30 seconds)
    Running trace...    (30 seconds)
  react-redux type-version: useSelector-7.1.3-719d97e
    Checking max FPS... (30 seconds)
    Running trace...    (30 seconds)

Results for benchmark stockticker:
┌───────────────────────────┬─────────┬──────────────┬───────────┬───────────┬──────────┬─────────────────────────────────────────────────────────────────────────┐
│ Type-Version              │ Avg FPS │ Render       │ Scripting │ Rendering │ Painting │ FPS Values                                                              │
│                           │         │ (Mount, Avg) │           │           │          │                                                                         │
├───────────────────────────┼─────────┼──────────────┼───────────┼───────────┼──────────┼─────────────────────────────────────────────────────────────────────────┤
│ connect-6.0.0             │ 19.99   │ 188.5, 5.3   │ 23039.27  │ 4469.65   │ 1313.68  │ 19,20,21,20,21,20,21,20,21,19,20,21,19,19                               │
├───────────────────────────┼─────────┼──────────────┼───────────┼───────────┼──────────┼─────────────────────────────────────────────────────────────────────────┤
│ connect-7.1.3             │ 50.77   │ 279.0, 0.3   │ 14224.95  │ 10193.50  │ 3389.90  │ 46,51,49,51,50,55,52,51,50,53,51,53,51,48,51,50,51,52,51,46,50,51,50,50 │
├───────────────────────────┼─────────┼──────────────┼───────────┼───────────┼──────────┼─────────────────────────────────────────────────────────────────────────┤
│ connect-7.1.3-719d97e     │ 49.89   │ 280.9, 0.3   │ 14333.07  │ 10310.31  │ 3432.34  │ 46,50,48,49,51,46,55,51,53,49,51,53,52,50,51,49,53,44,39,46,50,51,48,48 │
├───────────────────────────┼─────────┼──────────────┼───────────┼───────────┼──────────┼─────────────────────────────────────────────────────────────────────────┤
│ useSelector-7.1.3         │ 59.42   │ 154.9, 0.4   │ 10566.03  │ 12534.44  │ 4233.82  │ 57,60,59,60,59,60,59,60,59,60,59,60,59,60,59,60,59,60,59,59             │
├───────────────────────────┼─────────┼──────────────┼───────────┼───────────┼──────────┼─────────────────────────────────────────────────────────────────────────┤
│ useSelector-7.1.3-719d97e │ 14.54   │ 158.7, 0.8   │ 24262.04  │ 3649.39   │ 1028.71  │ 13,15,16,15,14,15,14,15,14,16,15,14,15,14,15,14,15,14,14                │
└───────────────────────────┴─────────┴──────────────┴───────────┴───────────┴──────────┴─────────────────────────────────────────────────────────────────────────┘
Running benchmark tree-view
  react-redux type-version: connect-6.0.0
    Checking max FPS... (30 seconds)
    Running trace...    (30 seconds)
  react-redux type-version: connect-7.1.3
    Checking max FPS... (30 seconds)
    Running trace...    (30 seconds)
  react-redux type-version: useSelector-7.1.3
    Checking max FPS... (30 seconds)
    Running trace...    (30 seconds)
  react-redux type-version: connect-7.1.3-719d97e
    Checking max FPS... (30 seconds)
    Running trace...    (30 seconds)
  react-redux type-version: useSelector-7.1.3-719d97e
    Checking max FPS... (30 seconds)
    Running trace...    (30 seconds)

Results for benchmark tree-view:
┌───────────────────────────┬─────────┬──────────────┬───────────┬───────────┬──────────┬────────────────────────────────────────────────────────────────────────────────────────┐
│ Type-Version              │ Avg FPS │ Render       │ Scripting │ Rendering │ Painting │ FPS Values                                                                             │
│                           │         │ (Mount, Avg) │           │           │          │                                                                                        │
├───────────────────────────┼─────────┼──────────────┼───────────┼───────────┼──────────┼────────────────────────────────────────────────────────────────────────────────────────┤
│ connect-6.0.0             │ 39.65   │ 626.8, 18.7  │ 19002.92  │ 4460.98   │ 304.33   │ 46,40,38,37,43,38,32,36,31,41,39,43,44,41,42,36,45,42,33,44,45,36,44,41,34,41,41       │
├───────────────────────────┼─────────┼──────────────┼───────────┼───────────┼──────────┼────────────────────────────────────────────────────────────────────────────────────────┤
│ connect-7.1.3             │ 50.79   │ 839.3, 0.3   │ 8477.04   │ 8367.16   │ 632.66   │ 51,53,48,43,49,44,48,54,50,54,51,46,50,52,51,55,49,52,56,50,52,51,56,52,53,53          │
├───────────────────────────┼─────────┼──────────────┼───────────┼───────────┼──────────┼────────────────────────────────────────────────────────────────────────────────────────┤
│ connect-7.1.3-719d97e     │ 51.35   │ 706.1, 0.2   │ 8539.74   │ 8602.52   │ 629.33   │ 52,53,54,45,48,52,49,53,56,44,55,52,47,50,51,49,53,57,52,55,50,48,53,52,47,47          │
├───────────────────────────┼─────────┼──────────────┼───────────┼───────────┼──────────┼────────────────────────────────────────────────────────────────────────────────────────┤
│ useSelector-7.1.3         │ 48.03   │ 513.9, 1.2   │ 6879.05   │ 8861.41   │ 688.28   │ 44,52,55,44,36,47,49,46,53,46,51,46,43,35,51,47,48,55,54,55,49,50,33,49,55,53,44,44    │
├───────────────────────────┼─────────┼──────────────┼───────────┼───────────┼──────────┼────────────────────────────────────────────────────────────────────────────────────────┤
│ useSelector-7.1.3-719d97e │ 33.53   │ 537.8, 5.8   │ 22394.00  │ 3803.03   │ 305.96   │ 36,37,27,34,31,41,29,37,25,34,29,31,33,35,34,36,38,34,40,28,33,40,34,21,39,35,36,29,29 │
└───────────────────────────┴─────────┴──────────────┴───────────┴───────────┴──────────┴────────────────────────────────────────────────────────────────────────────────────────┘
Running benchmark twitter-lite
  react-redux type-version: connect-6.0.0
    Checking max FPS... (30 seconds)
    Running trace...    (30 seconds)
  react-redux type-version: connect-7.1.3
    Checking max FPS... (30 seconds)
    Running trace...    (30 seconds)
  react-redux type-version: useSelector-7.1.3
    Checking max FPS... (30 seconds)
    Running trace...    (30 seconds)
  react-redux type-version: connect-7.1.3-719d97e
    Checking max FPS... (30 seconds)
    Running trace...    (30 seconds)
  react-redux type-version: useSelector-7.1.3-719d97e
    Checking max FPS... (30 seconds)
    Running trace...    (30 seconds)

Results for benchmark twitter-lite:
┌───────────────────────────┬─────────┬──────────────┬───────────┬───────────┬──────────┬──────────────────────────────────────────────────────────────────────────────────┐
│ Type-Version              │ Avg FPS │ Render       │ Scripting │ Rendering │ Painting │ FPS Values                                                                       │
│                           │         │ (Mount, Avg) │           │           │          │                                                                                  │
├───────────────────────────┼─────────┼──────────────┼───────────┼───────────┼──────────┼──────────────────────────────────────────────────────────────────────────────────┤
│ connect-6.0.0             │ 29.17   │ 4.6, 5.4     │ 26815.04  │ 1450.09   │ 364.58   │ 59,60,36,48,56,43,36,38,39,33,28,29,28,23,24,21,20,19,18,19,18,16,17,15,16,15,15 │
├───────────────────────────┼─────────┼──────────────┼───────────┼───────────┼──────────┼──────────────────────────────────────────────────────────────────────────────────┤
│ connect-7.1.3             │ 49.66   │ 6.9, 0.3     │ 19983.51  │ 3796.60   │ 736.26   │ 60,59,60,59,60,59,60,59,60,59,55,59,56,53,52,43,47,40,39,35,32,31,28,28          │
├───────────────────────────┼─────────┼──────────────┼───────────┼───────────┼──────────┼──────────────────────────────────────────────────────────────────────────────────┤
│ connect-7.1.3-719d97e     │ 47.86   │ 10.7, 0.3    │ 20590.73  │ 3764.92   │ 1024.88  │ 48,60,59,56,60,59,60,40,48,50,59,58,52,59,55,51,38,45,44,41,39,36,35,32,25,28,28 │
├───────────────────────────┼─────────┼──────────────┼───────────┼───────────┼──────────┼──────────────────────────────────────────────────────────────────────────────────┤
│ useSelector-7.1.3         │ 57.23   │ 3.7, 0.5     │ 15248.42  │ 5057.01   │ 926.14   │ 60,59,60,59,60,59,60,59,60,59,57,59,58,57,55,58,54,60,51,53,50,49,49             │
├───────────────────────────┼─────────┼──────────────┼───────────┼───────────┼──────────┼──────────────────────────────────────────────────────────────────────────────────┤
│ useSelector-7.1.3-719d97e │ 26.19   │ 73.4, 0.8    │ 26677.92  │ 1307.67   │ 381.98   │ 59,60,59,50,55,38,34,32,26,25,23,24,22,18,19,18,17,15,13,14,11,12,13,13          │
└───────────────────────────┴─────────┴──────────────┴───────────┴───────────┴──────────┴──────────────────────────────────────────────────────────────────────────────────┘
✨  Done in 2369.14s.

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.

None yet

2 participants