diff options
author | Wesley <wesley.werner@gmail.com> | 2018-10-27 09:40:29 +0200 |
---|---|---|
committer | Wesley <wesley.werner@gmail.com> | 2018-10-27 09:40:29 +0200 |
commit | 0406b05840f88274fe374a1058aabceaa32ee6cf (patch) | |
tree | 9d94add4b218f45e65d87751033e217e19ca77a7 /README.md | |
parent | f329ba1d9663175ea0b4955f502b0ba761cdf2a6 (diff) | |
download | lua-star-0406b05840f88274fe374a1058aabceaa32ee6cf.tar.xz |
Add performance test
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 20 |
1 files changed, 19 insertions, 1 deletions
@@ -1,6 +1,6 @@ # lua-star -[](https://travis-ci.org/wesleywerner/lua-star) Easy A* path finding for Lua +[](https://travis-ci.org/wesleywerner/lua-star) Lua-star is a pure Lua A* path-finding library.  @@ -60,6 +60,24 @@ Unit testing is done with busted, the `.busted` config already defines everythin busted +# Performance + +There is a performance measurement tool in `tests/performance.lua`, it calculates the average time to find a path on a large, random map. + + # copy the lib to tests + $ cp ../src/lua-star.lua . + + # measure performance + $ lua performance.lua + Running with seed 1540584306 + Building a map of 3000x3000... + Precalculating 6000 random start/goal positions... + Finding 1000 paths... + Done in 16.37 seconds. + That is 0.0164 seconds, or 16 milliseconds, per path. + The map has 9.0 million locations, with about 65% open space. + + # Example There is an [interactive example](example/main.lua) that can be run with [Love](https://love2d.org). |