]> git.lizzy.rs Git - lua-star.git/blobdiff - README.md
Add performance test
[lua-star.git] / README.md
index 6fd2ebe16d530b69f8c727d249e884a19d50dfd8..5cb49b5b67c69074871c82fcc62357aa47caeaeb 100644 (file)
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
 # lua-star
 
-[![Build Status](https://travis-ci.org/wesleywerner/lua-star.svg?branch=master)](https://travis-ci.org/wesleywerner/lua-star) Easy A* path finding for Lua
+[![Build Status](https://travis-ci.org/wesleywerner/lua-star.svg?branch=master)](https://travis-ci.org/wesleywerner/lua-star) Lua-star is a pure Lua A* path-finding library.
 
 ![lua star example screenshot](example/lua-star-01.png)
 
@@ -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).