使用Benchmark.js进行Elm性能测试
在Elm中使用Benchmark.js,您需要首先安装一些依赖项:
$cabal install
$npm install benchmark
$npm install jsdom
注意:在Windows上安装jsdom可能会遇到一些困难,可以参考相关文档进行解决。
测试示例:每个测试必须是() -> ()
类型的传出port。在Benchmark模块中定义任意数量的测试。以下是一个基本示例:
module Benchmark where
discard : a -> ()
discard _ = ()
port testAdd10 : () -> ()
port testAdd10 =
该方法可以用来测试不同代码块的执行效率,适用于基于Elm的性能基准测试。
Elm-Benchmark-master.zip
预估大小:9个文件
Elm-Benchmark-master
文件夹
prescript.js
126B
Test.elm
883B
ElmBenchmark.cabal
934B
mkExe.hs
2KB
LICENSE
1KB
Setup.hs
46B
.gitignore
63B
postscript.js
558B
README.md
2KB
5.25KB
文件大小:
评论区