Buckets:
| const { workerData: benchmark, parentPort } = require('worker_threads') | |
| const Benchmark = require('benchmark') | |
| // The default number of samples for Benchmark seems to be low enough that it | |
| // can generate results with significant variance (~2%) for this benchmark | |
| // suite. This makes it sometimes a bit confusing to actually evaluate impact of | |
| // changes on performance. Setting the minimum of samples to 500 results in | |
| // significantly lower variance on my local setup for this tests suite, and | |
| // gives me higher confidence in benchmark results. | |
| Benchmark.options.minSamples = 500 | |
| const suite = Benchmark.Suite() | |
| const FindMyWay = require('..') | |
| const findMyWay = new FindMyWay() | |
| for (const { method, url, opts } of benchmark.setupURLs) { | |
| if (opts !== undefined) { | |
| findMyWay.on(method, url, opts, () => true) | |
| } else { | |
| findMyWay.on(method, url, () => true) | |
| } | |
| } | |
| suite | |
| .add(benchmark.name, () => { | |
| findMyWay.lookup(...benchmark.arguments) | |
| }) | |
| .on('cycle', (event) => { | |
| parentPort.postMessage(String(event.target)) | |
| }) | |
| .on('complete', () => {}) | |
| .run() | |
Xet Storage Details
- Size:
- 1.1 kB
- Xet hash:
- 556166a6af9c87ae76bc7d9db1d78b1285f23e32bffd04e9424621aee98265af
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.