Add compilation/benchmarks section to README
ci/woodpecker/push/woodpecker Pipeline failed Details

WIP-cache
Hugo Thunnissen 9 months ago
parent 52e1254001
commit e9d547af07

@ -76,6 +76,52 @@ git clone https://git.snorba.art/hugo/phpinspect.el ~/projects/phpinspect.el
(require 'phpinspect)
```
## Compilation
It is highly recommended to byte- or native compile phpinspect. Aside from the
normal performance boost that this brings to most packages, it can reduce
phpinspect's parsing time by up to 90%. It especially makes a difference when
incrementally parsing edited buffers. For example:
### benchmarks/parse-file.el uncompiled on Ryzen 5 3600 (time in seconds):
```
Incremental parse (warmup):
Elapsed time: 0.168390 (0.019751 in 1 GCs)
Incremental parse:
Elapsed time: 0.143811 (0.000000 in 0 GCs)
Incremental parse (no edits):
Elapsed time: 0.000284 (0.000000 in 0 GCs)
Incremental parse repeat (no edits):
Elapsed time: 0.000241 (0.000000 in 0 GCs)
Incremental parse after buffer edit:
Elapsed time: 0.012449 (0.000000 in 0 GCs)
Incremental parse after 2 more edits:
Elapsed time: 0.015839 (0.000000 in 0 GCs)
Bare (no token reuse) parse (warmup):
Elapsed time: 0.048996 (0.000000 in 0 GCs)
Bare (no token reuse) parse:
Elapsed time: 0.052495 (0.000000 in 0 GCs)
```
### benchmarks/parse-file.el with native compilation on Ryzen 5 3600 (time in seconds):
```
Incremental parse (warmup):
Elapsed time: 0.023432 (0.000000 in 0 GCs)
Incremental parse:
Elapsed time: 0.018350 (0.000000 in 0 GCs)
Incremental parse (no edits):
Elapsed time: 0.000076 (0.000000 in 0 GCs)
Incremental parse repeat (no edits):
Elapsed time: 0.000058 (0.000000 in 0 GCs)
Incremental parse after buffer edit:
Elapsed time: 0.001212 (0.000000 in 0 GCs)
Incremental parse after 2 more edits:
Elapsed time: 0.001381 (0.000000 in 0 GCs)
Bare (no token reuse) parse (warmup):
Elapsed time: 0.013874 (0.000000 in 0 GCs)
Bare (no token reuse) parse:
Elapsed time: 0.013878 (0.000000 in 0 GCs)
```
## Development
### Running tests

Loading…
Cancel
Save