Proposal: suggest a common utility to "rule them all"
See original GitHub issueAS I’ve found myself copying and pasting a similar domc scope
utility all over, I wonder if we could simply normalize all tests (which is also an opportunity to call for updates, so that those that won’t be updated can be discarded) through an utility that can easily handle all cases, including returning {...scope}
whenever it’s needed to trigger updates (i.e. neverland, or react-hooks).
For this purpose, I’ve created the js-framework-benchmark-utils module, which, accordingly with the discussion and the outcome we’ll have in this ticket (if any), could be used already for all my libraries.
This should make any benchmark scope/state handling at pair, in terms of performance, so that nobody can cheat or do things wrong, simplifying both maintenance of every library/framework in this repository, but also helping in making future pull requests easier to review.
Happy to hear your opinion 👋
P.S. if it’s OK to use such module, I could update all my PRs with it, so that you won’t need to re-run tests after. Please let me know, thanks.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:23 (19 by maintainers)
Top GitHub Comments
@WebReflection I’m absolutely fine with the common utility module (but I don’t think I’ll enforce its usage for all js frameworks).
@krausest just FYI all my 5 PRs are ready to land. I’ve used js-framework-benchmark-utils in all of them, and also described a particular case with hooks and state, handled via neverland but working anyway.
It’s worth saying that my last days of investigation with this benchmark brought under my attention a variety of issues, most noticeable the cost of WeakMap, which I have previously used without thinking too much, as I couldn’t expect such big slowdown when these contains many weak references as key.
This means that I have to work to optimize as much as possible augmentor, as if there’s any chance to avoid using a WeakMap in
useState
, I’ll go for it, as the selectRow tests shows these are the bottleneck for both neverland and heresy.That being said, I am overly satisfied about current state of my libraries, especially 'cause I’ve found out that hyperHTML test case was using
performance.now()
all over the place, it wasn’t minized properly, and there was a lot of wrong things with it, so that now it seems like it’s faster than lit or lighter html in the keyed result 😅TL;DR please do merge those PRs whenever you have time, but I hope in a month (busy time ahead) I can just bump neverland and heresy versions to see way better results not ruined by the selectRow score.
Thanks again for patience, hints, and for welcoming the 3rd parts utils library proposal 👋