dignifiedquire / dignifiedquire/pull-block
Example browser benchmark
- Dominant language
- JavaScript
- Stars
- 7
- Forks
- 3
- PR merge metrics
- No merged PRs in 30d
Description
It isn't the prettiest framework, but it produced some insights.
https://github.com/Beanow/pull-block-browserbench
To test the #2 theories. There's a "dev" version of pull-block there which has the implementation without any concat or slices, using only alloc and copy. PR #4
```js
var tests = {
// Suspected worst-case.
manyPairs: test({
inSize: 16*KB,
inCount: 10000,
blockSize: 30*KB
}),
// Suspected worst-case.
manyTriplets: test({
inSize: 11*KB,
inCount: 14000,
blockSize: 30*KB
}),
// Large incoming buffers scenario.
bigBuffers: test({
inSize: 20*MB,
inCount: 1,
blockSize: 50*KB
})
}
```
```
Firefox:
Test manyPairs with pull-block dev ran an average of 107ms
Test manyPairs with pull-block master ran an average of 257ms
Test manyPairs with pull-block v1.2.0 ran an average of 178ms
Test manyTriplets with pull-block dev ran an average of 105ms
Test manyTriplets with pull-block master ran an average of 318ms
Test manyTriplets with pull-block v1.2.0 ran an average of 186ms
Test bigBuffers with pull-block dev ran an average of 39ms
Test bigBuffers with pull-block master ran an average of 23ms
Test bigBuffers with pull-block v1.2.0 ran an average of 2951ms
Chromium:
Test manyPairs with pull-block dev ran an average of 63ms
Test manyPairs with pull-block master ran an average of 99ms
Test manyPairs with pull-block v1.2.0 ran an average of 57ms
Test manyTriplets with pull-block dev ran an average of 61ms
Test manyTriplets with pull-block master ran an average of 101ms
Test manyTriplets with pull-block v1.2.0 ran an average of 66ms
Test bigBuffers with pull-block dev ran an average of 25ms
Test bigBuffers with pull-block master ran an average of 16ms
Test bigBuffers with pull-block v1.2.0 failed: RangeError: Array buffer allocation failed
```
So it's a gain, but certainly not as big of a difference as the previous patch. And interestingly it seems my previous patch slightly regressed performance for the high volume scenario.
I do suppose that these tests don't cover enough cases to decide which is better. Hence I'm putting it up as a separate issue. Does this make sense as a test method and what more cases does it need?
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.