Updated Benchmarking your changes (markdown)
parent
e547bcc488
commit
ce359c2426
@ -1,13 +1,25 @@
|
|||||||
When working on issues related to performance, it is important to provide a performance benchmark for your changes to assess whether or not your change has a performance impact. PDF.js provides tools to do this easily.
|
When working on issues related to performance, it is important to provide a performance benchmark for your changes to assess whether or not your change has a performance impact. PDF.js provides tools to do this easily. Normally you would create a simple manifest file has couple of pdfs you trying to optimize and run it multiple times, e.g. `my_pdfs.json`:
|
||||||
|
|
||||||
|
```
|
||||||
|
[
|
||||||
|
{ "id": "tracemonkey-eq",
|
||||||
|
"file": "pdfs/tracemonkey.pdf",
|
||||||
|
"md5": "9a192d8b1a7dc652a19835f6f08098bd",
|
||||||
|
"rounds": 20,
|
||||||
|
"lastPage": 5,
|
||||||
|
"type": "load"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
```
|
||||||
|
|
||||||
Run the following command to create a 'baseline' measurement (before you make your changes):
|
Run the following command to create a 'baseline' measurement (before you make your changes):
|
||||||
|
|
||||||
cd test
|
cd test
|
||||||
node test.js --browserManifestFile=resources/browser_manifests/browser_manifest.json --statsFile=stats/results/baseline.json
|
node test.js --browserManifestFile=resources/browser_manifests/browser_manifest.json --statsFile=stats/results/baseline.json --statsDelay=5000 --manifestFile=my_pdfs.json
|
||||||
|
|
||||||
Then apply your changes and create a 'current' measurement:
|
Then apply your changes and create a 'current' measurement:
|
||||||
|
|
||||||
node test.js --browserManifestFile=resources/browser_manifests/browser_manifest.json --statsFile=stats/results/current.json
|
node test.js --browserManifestFile=resources/browser_manifests/browser_manifest.json --statsFile=stats/results/current.json --statsFile=base.json --statsDelay=5000 --manifestFile=my_pdfs.json
|
||||||
|
|
||||||
Now you can compare the measurements and see any performance differences:
|
Now you can compare the measurements and see any performance differences:
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user