Closed blakeembrey closed 8 years ago
While we're on the subject of performance and non-backwards-compatible changes, it might be worth trying out this alternative hashing function.
Here's a quick jsPerf test; it performs about 2x faster in my browser -- might be an easy win!
@namuol Thanks for sharing the algorithm. I'll do some test cases for speed and uniqueness, but yeah, that's definitely the biggest feature/bottleneck.
Edit: As in, it's the core of all the functionality so kind of important, not that it's the slowest feature.
A lot of the old architecture has been removed and simplified. Only strings are now cached (no duplication of object and string) and exposed to end users (E.g.
Style.registerStyle()
outputs a string instance of instance). Every instance can container other instances, and all have a consistent hash to merge duplicate styles/@-rules/selectors into each other. Basically: