mirror of
https://github.com/lovell/sharp.git
synced 2025-07-09 18:40:16 +02:00
Tests: match concurrency with CPU count
This commit is contained in:
parent
1a3c38d35f
commit
a57d7b51b1
@ -1,5 +1,6 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
const os = require('os');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
|
|
||||||
const async = require('async');
|
const async = require('async');
|
||||||
@ -25,6 +26,9 @@ const height = 588;
|
|||||||
// Disable libvips cache to ensure tests are as fair as they can be
|
// Disable libvips cache to ensure tests are as fair as they can be
|
||||||
sharp.cache(false);
|
sharp.cache(false);
|
||||||
|
|
||||||
|
// Spawn one thread per CPU
|
||||||
|
sharp.concurrency(os.cpus().length);
|
||||||
|
|
||||||
async.series({
|
async.series({
|
||||||
jpeg: function (callback) {
|
jpeg: function (callback) {
|
||||||
const inputJpgBuffer = fs.readFileSync(fixtures.inputJpg);
|
const inputJpgBuffer = fs.readFileSync(fixtures.inputJpg);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user