streamich / nano-css

Distilled CSS-in-JS for gourmet developers
The Unlicense
427 stars 23 forks source link

chore: switch to safe-stable-stringify #257

Closed BridgeAR closed 2 years ago

BridgeAR commented 2 years ago

This replaces the fastest-stable-stringify with safe-stable-stringify for performance reasons. There is no behavior change.

fastest-stable-stringify x 17,945 ops/sec ±2.92% (84 runs sampled) safe-stable-stringify x 24,922 ops/sec ±2.78% (82 runs sampled)

BridgeAR commented 2 years ago

There is actually one difference: circular references are not going to cause errors anymore and may from now on be used as well.

streamich commented 2 years ago

Thank you for the effort! Your library looks really good! I also like optimizing JavaScript code and I really appreciate some of the tricks you use, like regexes in strEscape and using own insertion sort implementation instead of the native .sort() method. I will definitely borrow some optimization tricks from you.

Having said that, unfortunately, "nano" in nano-css stands for "small", so for bundle size reasons I cannot swap the libraries.