I would like to compare the performance of two PureScript functions in jsPerf.
What compilation do I need to do and what parts do I need to put in 'setup' and each snippet box?
Using psc or pulp.
I would like to compare the performance of two PureScript functions in jsPerf.
What compilation do I need to do and what parts do I need to put in 'setup' and each snippet box?
Using psc or pulp.
Copyright © 2021 Jogjafile Inc.
Use FFI
Because you are referring to a JavaScript utility it would be the easiest to write the test in JS.
You can write your performance tests in a separate
jsfile (named accordingly to your testing module name) and call it from purescript via Foreign Function Interface.Assuming you want to compare performance of
fandgfunctions, the code scheme could be described by the following template:This will delegate the
performanceTestImplimplementation into JavaScript with two callbacks whose performance should be measured and compared. Note that you need to pass unevaluated lambdas in order to defer the computation since PureScript isn't lazy as Haskell. PureScript should take care of linking. Note that both files need to have matching names and be put in the same directory.