futursolo / stylist-rs

A CSS-in-Rust styling solution for WebAssembly Applications
https://crates.io/crates/stylist
MIT License
370 stars 22 forks source link

Enable consistent AST generation by reusing output in literal style macro #33

Closed WorldSEnder closed 2 years ago

WorldSEnder commented 2 years ago

Addresses #32 by reusing the output code from inline style in the literal style.

Running the benchmarks in firefox revealed that the last test stalls for some reason. I'd guess this is because of the large number of styles mounted, maybe each one triggers a recalculation of css props and that trips it up at some point. In any case, the number of iterations has been tuned down to 2000.

WorldSEnder commented 2 years ago

I now also have a follow up commit https://github.com/WorldSEnder/stylist/commit/e56e54f8e02bf7520ae284a05029f49c6cceaebd that yields performance improvements for complex style sheets (with sparsely interpolated values).

WorldSEnder commented 2 years ago

The increase is due to the 21 lines of added test case code :tada: