alexmingoia / purescript-pux

Build type-safe web apps with PureScript.
https://www.purescript-pux.org
Other
566 stars 76 forks source link

Permission to submit benchmark #143

Closed thomashoneyman closed 7 years ago

thomashoneyman commented 7 years ago

Hi Alex,

I've created an implementation of the JavaScript framework benchmarks that I plan to add to that repository. The repository is fairly popular, and already includes an Elm benchmark, but there is no representation from PureScript. I thought it'd be useful to add Pux into the mix as well.

I've already implemented the benchmark and it passes the repository's tests, so I can submit this at any time. Before I do, though, I wanted to make sure y'all are OK with that, and double-check if I've done anything horribly inefficient that could cast a bad light on the framework.

In my implementation, Pux sees a ~13x slowdown compared to vanilla JS. Halogen and Thermite both see a ~4x slowdown. The reason Pux is so much slower seems to be because of the Smolder library (pre-v11.0.0 Pux, the benchmark failed altogether because of Smolder not being stack-safe in prior versions).

My repository containing the code is linked below. You should be able to follow the few instructions to run the code yourself in ~1 minute if you would like. https://github.com/saylu/purescript-framework-benchmark

I wanted to check in with you before submitting the benchmark.

Cheers, Thomas

alexmingoia commented 7 years ago

This is great, thank you. You're correct that the slowdown is due to the use of smolder. It's that combined with the lack of a virtual-dom differ written to use smolder. Pux has to transform smolder to react elements each render pass. Thermite wraps React elements directly and Halogen uses its own virtual-dom differ written in PureScript.

alexmingoia commented 7 years ago

I'll close this when I add a link to the README and wiki

alexmingoia commented 7 years ago

I've added benchmarks and an explanation of slow performance to the readme. Closing for now.

thomashoneyman commented 7 years ago

Thanks! I appreciate your openness and explanations.