Tests: update benchmark deps and container (#3744)

Use Node 18.x in benchmark container
This commit is contained in:
Kleis Auke Wolthuizen 2023-07-30 12:24:27 +02:00 committed by GitHub
parent 0bc79cdb95
commit 440936a699
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 6 deletions

View File

@ -5,7 +5,7 @@ ARG BRANCH=main
RUN apt-get -y update && apt-get install -y build-essential curl git
# Install latest Node.js LTS
RUN curl -fsSL https://deb.nodesource.com/setup_16.x | bash -
RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash -
RUN apt-get install -y nodejs
# Install benchmark dependencies
@ -23,4 +23,9 @@ RUN cat /etc/os-release | grep VERSION=
RUN node -v
WORKDIR /tmp/sharp/test/bench
# Workaround for: https://github.com/emscripten-core/emscripten/pull/16917
# This could be removed once Squoosh is an optional dependency.
ENV NODE_OPTIONS="--no-experimental-fetch"
CMD [ "node", "perf" ]

View File

@ -9,15 +9,15 @@
},
"dependencies": {
"@squoosh/cli": "0.7.3",
"@squoosh/lib": "0.4.0",
"@squoosh/lib": "0.5.3",
"async": "3.2.4",
"benchmark": "2.1.4",
"gm": "1.25.0",
"imagemagick": "0.1.3",
"jimp": "0.22.7"
"jimp": "0.22.10"
},
"optionalDependencies": {
"@tensorflow/tfjs-node": "4.2.0",
"@tensorflow/tfjs-node": "4.9.0",
"mapnik": "4.5.9"
},
"license": "Apache-2.0",

View File

@ -109,7 +109,7 @@ async.series({
jpegSuite.add('squoosh-lib-buffer-buffer', {
defer: true,
fn: function (deferred) {
const pool = new squoosh.ImagePool();
const pool = new squoosh.ImagePool(os.cpus().length);
const image = pool.ingestImage(inputJpgBuffer);
image.decoded
.then(function () {
@ -707,7 +707,7 @@ async.series({
pngSuite.add('squoosh-lib-buffer-buffer', {
defer: true,
fn: function (deferred) {
const pool = new squoosh.ImagePool();
const pool = new squoosh.ImagePool(os.cpus().length);
const image = pool.ingestImage(inputPngBuffer);
image.decoded
.then(function () {