https://github.com/nikku/js-sax-parser-tests
The { EasySax - sax-js - Saxen } performance shoot out
https://github.com/nikku/js-sax-parser-tests
Last synced: 3 months ago
JSON representation
The { EasySax - sax-js - Saxen } performance shoot out
- Host: GitHub
- URL: https://github.com/nikku/js-sax-parser-tests
- Owner: nikku
- Created: 2017-10-19T22:39:38.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-11-11T11:31:36.000Z (over 8 years ago)
- Last Synced: 2025-01-28T12:47:25.596Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 38.1 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Benchmarking JS XML parsers
This small test compares the following SAX-style XML parsers avaliable:
* [sax-js](https://github.com/isaacs/sax-js)
* [easysax](https://github.com/vflash/easysax)
* [saxen](https://github.com/nikku/saxen)
## Test Coverage
The following aspects are tested
* strict mode (parsing XML only)
* events: `openTag`, `closeTag`, `text`
* attribute processing on
* entity decoding on
* namespace parsing on
## Results
### Size
Comparing parsers by bundled size:
| parser | default | min+gzipped |
| :--- | ---:|---:|
| sax-js | 40KB | 6.7 KB |
| easysax | 20KB | 2.1KB |
| saxen | 21KB | 2.6KB |
### XML Parse Time
Parsing [`./complex.bpmn`](./complex.bpmn).
| parser | average time |
| :--- | ---:|
| sax-js | 30.3ms |
| easysax | 5.2ms |
| saxen | 5.1ms |
Cf. [tests](./index.js).
## How to Run
```
npm install
# test minify
npm run minify
# test performance (in browser)
npm run perf
# open index.html in a web browser
```
:rocket: