gergoerdi / functional-mos6502-web-performance

https://unsafeperform.io/blog/2022-07-02-a_small_benchmark_for_functional_languages_targeting_web_browsers/
https://unsafeperform.io/blog/2022-07-02-a_small_benchmark_for_functional_languages_targeting_web_browsers/
26 stars 5 forks source link

Use an optimizer for PureScript output #6

Open toastal opened 1 year ago

toastal commented 1 year ago

https://github.com/aristanetworks/purescript-backend-optimizer

Code size and performance improvement varies by usecase, but we've generally observed:

  • 25-35% improvement in runtime.
  • 20-25% improvement in minified bundle size.
  • 15-20% improvement in minified+gzip bundle size.

I'm not entirely sure if this supplants Zephyr or not, bundle size and performance aren't going to match most production PureScript project who will be running an optimizer.

If those stats are to be believed, we would expect

Implementation Generated code size (bytes) Average time of 4142 instructions (ms)
JavaScript 12,877 0.98
PureScript (opt) 113,652 - 121,229 89.05 - 102.75
PureScript 151,536 137.03

This would not improve standings, but might be closer to "real world".