Skip to content
This repository has been archived by the owner on Jun 21, 2023. It is now read-only.

JS Benchmark - Keyed Version #63

Open
davidbwaters opened this issue Apr 15, 2018 · 1 comment
Open

JS Benchmark - Keyed Version #63

davidbwaters opened this issue Apr 15, 2018 · 1 comment

Comments

@davidbwaters
Copy link

davidbwaters commented Apr 15, 2018

Hey. I noticed simulacra is listed as 'non-keyed' in the benchmarks test by JS Performance Benchmarks. They define the classification:

Keyed implementations create an association between the domain data and a dom element by assigning a ‘key’. If data changes the dom element with that key will be updated. This feature might be necessary when integrating with 3rd-party libraries, transitions or when the DOM keeps some state. Non-keyed implementations are free to reuse the existing dom nodes in whatever way they like and thus might be faster, but may cause issues if there’s a dependency on the particular dom nodes.

Here is an overview of the classification and potential problems.

This is out of my scope, but if I am understanding correctly from the readme section on safety-checks, simulacra is keyed by default. The benchmark includes a test that is supposed to check if a library is keyed or not, which I'm assuming classified simulacra as non-keyed.

If simulacra is keyed or can be configured to be, I'd like to see how performance is effected. It scores very high in the current test, as it stands.

Is simulacra keyed by their standards described above? If not, is there a reason why safety checks to prevent the potential problems tracking DOM nodes mentioned were not included or shouldn't be added? Thanks.

@gr0uch
Copy link
Owner

gr0uch commented Apr 21, 2018

Hi there, sorry for the late reply, I was on vacation.

I think I could implement a "keyed" version but I don't see the motivation. If you look at the difference between vanilla keyed vs non-keyed, non-keyed performs faster in certain operations like replacing rows, because it is allowed to make optimizations that aren't possible with keyed implementations.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants