mirror of
https://github.com/lovell/sharp.git
synced 2025-12-19 07:15:08 +01:00
Linter: apply all recommended biome settings
Enforces previously-skipped useArrowFunction check
This commit is contained in:
@@ -16,31 +16,29 @@ const height = 480;
|
||||
|
||||
sharp.concurrency(1);
|
||||
|
||||
const timer = setInterval(function () {
|
||||
const timer = setInterval(() => {
|
||||
console.dir(sharp.counters());
|
||||
}, 100);
|
||||
|
||||
async.mapSeries([1, 1, 2, 4, 8, 16, 32, 64], function (parallelism, next) {
|
||||
async.mapSeries([1, 1, 2, 4, 8, 16, 32, 64], (parallelism, next) => {
|
||||
const start = Date.now();
|
||||
async.times(parallelism,
|
||||
function (_id, callback) {
|
||||
sharp(fixtures.inputJpg).resize(width, height).toBuffer(function (err, buffer) {
|
||||
(_id, callback) => {
|
||||
sharp(fixtures.inputJpg).resize(width, height).toBuffer((err, buffer) => {
|
||||
buffer = null;
|
||||
callback(err, Date.now() - start);
|
||||
});
|
||||
},
|
||||
function (err, ids) {
|
||||
(err, ids) => {
|
||||
assert(!err);
|
||||
assert(ids.length === parallelism);
|
||||
ids.sort();
|
||||
const mean = ids.reduce(function (a, b) {
|
||||
return a + b;
|
||||
}) / ids.length;
|
||||
const mean = ids.reduce((a, b) => a + b) / ids.length;
|
||||
console.log(`${parallelism} parallel calls: fastest=${ids[0]}ms slowest=${ids[ids.length - 1]}ms mean=${mean}ms`);
|
||||
next();
|
||||
}
|
||||
);
|
||||
}, function () {
|
||||
}, () => {
|
||||
clearInterval(timer);
|
||||
console.dir(sharp.counters());
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user