2010-03-29 20:18:54 +02:00
|
|
|
PEG.js Benchmark Suite
|
|
|
|
======================
|
|
|
|
|
|
|
|
This is the PEG.js benchmark suite. It measures speed of the parsers generated
|
|
|
|
by PEG.js on various inputs. Its main goal is to provide data for code generator
|
2014-05-09 15:06:32 +02:00
|
|
|
optimizations.
|
2010-03-29 20:18:54 +02:00
|
|
|
|
2014-05-09 15:06:32 +02:00
|
|
|
Running in Node.js
|
|
|
|
------------------
|
2010-03-29 20:18:54 +02:00
|
|
|
|
2014-05-09 15:06:32 +02:00
|
|
|
All commands in the following steps need to be executed in PEG.js root directory
|
|
|
|
(one level up from this one).
|
2010-03-29 20:18:54 +02:00
|
|
|
|
2014-05-09 15:06:32 +02:00
|
|
|
1. Install all PEG.js dependencies, including development ones:
|
2010-03-29 20:18:54 +02:00
|
|
|
|
2016-05-05 10:15:28 +02:00
|
|
|
```console
|
|
|
|
$ npm install
|
|
|
|
```
|
2012-11-10 14:21:14 +01:00
|
|
|
|
2014-05-09 15:06:32 +02:00
|
|
|
2. Execute the benchmark suite:
|
2012-11-10 14:21:14 +01:00
|
|
|
|
2016-05-05 10:15:28 +02:00
|
|
|
```console
|
|
|
|
$ make spec
|
|
|
|
```
|
2012-11-10 14:21:14 +01:00
|
|
|
|
2014-05-09 15:06:32 +02:00
|
|
|
3. Wait for results.
|
2010-03-29 20:18:54 +02:00
|
|
|
|
2014-05-10 16:40:39 +02:00
|
|
|
Running in the Browser
|
2014-05-09 15:06:32 +02:00
|
|
|
----------------------
|
2010-03-29 20:18:54 +02:00
|
|
|
|
2014-05-09 15:06:32 +02:00
|
|
|
All commands in the following steps need to be executed in PEG.js root directory
|
|
|
|
(one level up from this one).
|
2010-03-29 20:18:54 +02:00
|
|
|
|
2016-05-05 17:35:40 +02:00
|
|
|
1. Make sure you have Node.js installed.
|
2011-01-26 12:53:58 +01:00
|
|
|
|
2014-05-09 15:06:32 +02:00
|
|
|
2. Install all PEG.js dependencies, including development ones:
|
2011-01-26 12:53:58 +01:00
|
|
|
|
2016-05-05 10:15:28 +02:00
|
|
|
```console
|
|
|
|
$ npm install
|
|
|
|
```
|
2011-01-26 12:53:58 +01:00
|
|
|
|
2014-05-09 15:06:32 +02:00
|
|
|
3. Build browser version of PEG.js:
|
2011-01-26 12:53:58 +01:00
|
|
|
|
2016-05-05 10:15:28 +02:00
|
|
|
```console
|
|
|
|
$ make browser
|
|
|
|
```
|
2011-01-26 12:53:58 +01:00
|
|
|
|
2014-05-09 15:06:32 +02:00
|
|
|
4. Serve PEG.js root directory using a web server:
|
|
|
|
|
2016-05-05 10:15:28 +02:00
|
|
|
```console
|
2016-05-05 17:35:40 +02:00
|
|
|
$ node_modules/.bin/http-server
|
2016-05-05 10:15:28 +02:00
|
|
|
```
|
2014-05-09 15:06:32 +02:00
|
|
|
|
2016-05-05 17:35:40 +02:00
|
|
|
5. Point your browser to the [benchmark suite](http://localhost:8080/benchmark/index.html).
|
2014-05-09 15:06:32 +02:00
|
|
|
|
|
|
|
6. Click the **Run** button and wait for results.
|