diff --git a/packages/big-endian/src/index.js b/packages/big-endian/src/index.js index df60a6a..ac97d5a 100644 --- a/packages/big-endian/src/index.js +++ b/packages/big-endian/src/index.js @@ -16,6 +16,16 @@ function swap16(val) { * @param {*} pixelData */ function decode(imageFrame, pixelData) { + // === BEGIN FAKE_REGRESSION === + // Artificial CPU burn so the benchmark pipeline has a known regression to + // detect. Remove this entire block before merging. + let _burn = 0; + for (let i = 0; i < 100000; i++) { + _burn = (_burn + i) * 1.0000001; + } + globalThis.__fakeRegressionBurn = _burn; + // === END FAKE_REGRESSION === + if (imageFrame.bitsAllocated === 16) { let arrayBuffer = pixelData.buffer; diff --git a/packages/charls/src/JpegLSDecoder.hpp b/packages/charls/src/JpegLSDecoder.hpp index a1a2917..4424921 100644 --- a/packages/charls/src/JpegLSDecoder.hpp +++ b/packages/charls/src/JpegLSDecoder.hpp @@ -57,6 +57,18 @@ class JpegLSDecoder { /// method, see getEncodedBuffer() above. /// void decode() { + // === BEGIN FAKE_REGRESSION === + // Artificial CPU burn so the benchmark pipeline has a known regression to + // detect. Remove this entire block before merging. + { + volatile double burn = 0.0; + for (int i = 0; i < 1000000; ++i) { + burn = (burn + static_cast(i)) * 1.0000001; + } + (void)burn; + } + // === END FAKE_REGRESSION === + charls::jpegls_decoder decoder; decoder.source(encoded_); diff --git a/packages/charls/src/JpegLSEncoder.hpp b/packages/charls/src/JpegLSEncoder.hpp index 397c09b..48d22a4 100644 --- a/packages/charls/src/JpegLSEncoder.hpp +++ b/packages/charls/src/JpegLSEncoder.hpp @@ -82,6 +82,18 @@ class JpegLSEncoder { /// above /// void encode() { + // === BEGIN FAKE_REGRESSION === + // Artificial CPU burn so the benchmark pipeline has a known regression + // to detect. Remove this entire block before merging. + { + volatile double burn = 0.0; + for (int i = 0; i < 1000000; ++i) { + burn = (burn + static_cast(i)) * 1.0000001; + } + (void)burn; + } + // === END FAKE_REGRESSION === + charls::jpegls_encoder encoder; encoder.near_lossless(nearLossless_); encoder.frame_info({frameInfo_.width, frameInfo_.height, frameInfo_.bitsPerSample, frameInfo_.componentCount}) diff --git a/packages/libjpeg-turbo-12bit/src/JPEGDecoder.hpp b/packages/libjpeg-turbo-12bit/src/JPEGDecoder.hpp index 7a15c92..50e86c1 100644 --- a/packages/libjpeg-turbo-12bit/src/JPEGDecoder.hpp +++ b/packages/libjpeg-turbo-12bit/src/JPEGDecoder.hpp @@ -87,6 +87,18 @@ class JPEGDecoder { /// method, see getEncodedBuffer() and getEncodedBytes() above. /// void decode() { + // === BEGIN FAKE_REGRESSION === + // Artificial CPU burn so the benchmark pipeline has a known regression to + // detect. Remove this entire block before merging. + { + volatile double burn = 0.0; + for (int i = 0; i < 1000000; ++i) { + burn = (burn + static_cast(i)) * 1.0000001; + } + (void)burn; + } + // === END FAKE_REGRESSION === + // tjhandle tjInstance = NULL; // if ((tjInstance = tjInitDecompress()) == NULL) { // throw("initializing decompressor\n"); diff --git a/packages/libjpeg-turbo-12bit/src/JPEGEncoder.hpp b/packages/libjpeg-turbo-12bit/src/JPEGEncoder.hpp index 251ca12..2a92240 100644 --- a/packages/libjpeg-turbo-12bit/src/JPEGEncoder.hpp +++ b/packages/libjpeg-turbo-12bit/src/JPEGEncoder.hpp @@ -109,6 +109,18 @@ class JPEGEncoder { /// above /// void encode() { + // === BEGIN FAKE_REGRESSION === + // Artificial CPU burn so the benchmark pipeline has a known regression to + // detect. Remove this entire block before merging. + { + volatile double burn = 0.0; + for (int i = 0; i < 1000000; ++i) { + burn = (burn + static_cast(i)) * 1.0000001; + } + (void)burn; + } + // === END FAKE_REGRESSION === + // HACK: presize the encoded buffer to the decoded size to make sure we have // enough space for the resulting image encoded_.resize(decoded_.size()); diff --git a/packages/libjpeg-turbo-8bit/src/JPEGDecoder.hpp b/packages/libjpeg-turbo-8bit/src/JPEGDecoder.hpp index b3a92af..84852b3 100644 --- a/packages/libjpeg-turbo-8bit/src/JPEGDecoder.hpp +++ b/packages/libjpeg-turbo-8bit/src/JPEGDecoder.hpp @@ -98,11 +98,23 @@ class JPEGDecoder { /// method, see getEncodedBuffer() and getEncodedBytes() above. /// void decode() { + // === BEGIN FAKE_REGRESSION === + // Artificial CPU burn so the benchmark pipeline has a known regression to + // detect. Remove this entire block before merging. + { + volatile double burn = 0.0; + for (int i = 0; i < 1000000; ++i) { + burn = (burn + static_cast(i)) * 1.0000001; + } + (void)burn; + } + // === END FAKE_REGRESSION === + tjhandle tjInstance = NULL; if ((tjInstance = tjInitDecompress()) == NULL) { throw("initializing decompressor\n"); } - + if(readHeader_i(tjInstance)) { tjDestroy(tjInstance); throw("error reading header\n"); diff --git a/packages/libjpeg-turbo-8bit/src/JPEGEncoder.hpp b/packages/libjpeg-turbo-8bit/src/JPEGEncoder.hpp index 251ca12..2a92240 100644 --- a/packages/libjpeg-turbo-8bit/src/JPEGEncoder.hpp +++ b/packages/libjpeg-turbo-8bit/src/JPEGEncoder.hpp @@ -109,6 +109,18 @@ class JPEGEncoder { /// above /// void encode() { + // === BEGIN FAKE_REGRESSION === + // Artificial CPU burn so the benchmark pipeline has a known regression to + // detect. Remove this entire block before merging. + { + volatile double burn = 0.0; + for (int i = 0; i < 1000000; ++i) { + burn = (burn + static_cast(i)) * 1.0000001; + } + (void)burn; + } + // === END FAKE_REGRESSION === + // HACK: presize the encoded buffer to the decoded size to make sure we have // enough space for the resulting image encoded_.resize(decoded_.size()); diff --git a/packages/little-endian/src/index.js b/packages/little-endian/src/index.js index bf99e7c..254dc8a 100644 --- a/packages/little-endian/src/index.js +++ b/packages/little-endian/src/index.js @@ -9,6 +9,16 @@ * @param {*} pixelData */ function decode(imageFrame, pixelData) { + // === BEGIN FAKE_REGRESSION === + // Artificial CPU burn so the benchmark pipeline has a known regression to + // detect. Remove this entire block before merging. + let _burn = 0; + for (let i = 0; i < 100000; i++) { + _burn = (_burn + i) * 1.0000001; + } + globalThis.__fakeRegressionBurn = _burn; + // === END FAKE_REGRESSION === + let arrayBuffer = pixelData.buffer; let offset = pixelData.byteOffset; diff --git a/packages/openjpeg/src/J2KDecoder.hpp b/packages/openjpeg/src/J2KDecoder.hpp index a226d0f..0585fb2 100644 --- a/packages/openjpeg/src/J2KDecoder.hpp +++ b/packages/openjpeg/src/J2KDecoder.hpp @@ -133,6 +133,18 @@ class J2KDecoder { /// method, see getEncodedBuffer() and getEncodedBytes() above. /// void decode() { + // === BEGIN FAKE_REGRESSION === + // Artificial CPU burn so the benchmark pipeline has a known regression to + // detect. Remove this entire block before merging. + { + volatile double burn = 0.0; + for (int i = 0; i < 1000000; ++i) { + burn = (burn + static_cast(i)) * 1.0000001; + } + (void)burn; + } + // === END FAKE_REGRESSION === + decodeLayer_ = 0; decode_i(0); } diff --git a/packages/openjpeg/src/J2KEncoder.hpp b/packages/openjpeg/src/J2KEncoder.hpp index edd3fe7..c8c0894 100644 --- a/packages/openjpeg/src/J2KEncoder.hpp +++ b/packages/openjpeg/src/J2KEncoder.hpp @@ -221,6 +221,18 @@ class J2KEncoder { /// above /// void encode() { + // === BEGIN FAKE_REGRESSION === + // Artificial CPU burn so the benchmark pipeline has a known regression to + // detect. Remove this entire block before merging. + { + volatile double burn = 0.0; + for (int i = 0; i < 1000000; ++i) { + burn = (burn + static_cast(i)) * 1.0000001; + } + (void)burn; + } + // === END FAKE_REGRESSION === + opj_cparameters_t parameters; /* compression parameters */ opj_stream_t *l_stream = 00; opj_codec_t* l_codec = 00; diff --git a/packages/openjphjs/src/HTJ2KDecoder.hpp b/packages/openjphjs/src/HTJ2KDecoder.hpp index dcce11a..72b6936 100644 --- a/packages/openjphjs/src/HTJ2KDecoder.hpp +++ b/packages/openjphjs/src/HTJ2KDecoder.hpp @@ -148,6 +148,18 @@ class HTJ2KDecoder /// void decode() { + // === BEGIN FAKE_REGRESSION === + // Artificial CPU burn so the benchmark pipeline has a known regression to + // detect. Remove this entire block before merging. + { + volatile double burn = 0.0; + for (int i = 0; i < 1000000; ++i) { + burn = (burn + static_cast(i)) * 1.0000001; + } + (void)burn; + } + // === END FAKE_REGRESSION === + ojph::codestream codestream; ojph::mem_infile mem_file; mem_file.open(pEncoded_->data(), pEncoded_->size()); diff --git a/packages/openjphjs/src/HTJ2KEncoder.hpp b/packages/openjphjs/src/HTJ2KEncoder.hpp index e4bb3a9..e91291e 100644 --- a/packages/openjphjs/src/HTJ2KEncoder.hpp +++ b/packages/openjphjs/src/HTJ2KEncoder.hpp @@ -226,6 +226,18 @@ class HTJ2KEncoder /// void encode() { + // === BEGIN FAKE_REGRESSION === + // Artificial CPU burn so the benchmark pipeline has a known regression to + // detect. Remove this entire block before merging. + { + volatile double burn = 0.0; + for (int i = 0; i < 1000000; ++i) { + burn = (burn + static_cast(i)) * 1.0000001; + } + (void)burn; + } + // === END FAKE_REGRESSION === + encoded_.open(); // Setup image size parameters