https://github.com/pauldraper/const-enum-perf
https://github.com/pauldraper/const-enum-perf
Last synced: 11 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/pauldraper/const-enum-perf
- Owner: pauldraper
- Created: 2020-11-22T22:34:41.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-11-22T22:34:55.000Z (over 5 years ago)
- Last Synced: 2025-01-09T07:41:02.163Z (over 1 year ago)
- Language: TypeScript
- Size: 48.8 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Const enum performance
Assessing the performance of TypeScript const enum.
## Run
```
yarn install
yarn run build
yarn run run
```
Tests Chrome, Firefox, and Node.js.
Results:
```txt
Chrome Headless 80.0.3987.149 (Linux x86_64)
enum test #1: constEnum at 36582 ops/sec (1.37x faster than enum)
enum test #2: constEnum at 35965 ops/sec (1.34x faster than enum)
Firefox 83.0 (Ubuntu 0.0.0)
enum test #1: enum at 31397 ops/sec (2.76x faster than constEnum)
enum test #2: enum at 33399 ops/sec (2.95x faster than constEnum)
WebKit 537.36 (linux 0.0.0)
enum test #1: constEnum at 36139 ops/sec (1.20x faster than enum)
enum test #2: constEnum at 35046 ops/sec (1.18x faster than enum)
```