Skip to content

Commit a57d7b5

Browse files
committedMar 14, 2021
Tests: match concurrency with CPU count
1 parent 1a3c38d commit a57d7b5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed
 

‎test/bench/perf.js

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
'use strict';
22

3+
const os = require('os');
34
const fs = require('fs');
45

56
const async = require('async');
@@ -25,6 +26,9 @@ const height = 588;
2526
// Disable libvips cache to ensure tests are as fair as they can be
2627
sharp.cache(false);
2728

29+
// Spawn one thread per CPU
30+
sharp.concurrency(os.cpus().length);
31+
2832
async.series({
2933
jpeg: function (callback) {
3034
const inputJpgBuffer = fs.readFileSync(fixtures.inputJpg);

0 commit comments

Comments
 (0)
Please sign in to comment.