mirror of
https://github.com/lovell/sharp.git
synced 2025-07-09 10:30:15 +02:00
Enable SIMD convolution by default #1213
This commit is contained in:
parent
c8ff7e11a9
commit
deacd553bf
@ -9,6 +9,9 @@ Requires libvips v8.7.0.
|
|||||||
* Drop Node 4 support.
|
* Drop Node 4 support.
|
||||||
[#1212](https://github.com/lovell/sharp/issues/1212)
|
[#1212](https://github.com/lovell/sharp/issues/1212)
|
||||||
|
|
||||||
|
* Enable SIMD convolution by default.
|
||||||
|
[#1213](https://github.com/lovell/sharp/issues/1213)
|
||||||
|
|
||||||
* Add experimental prebuilt binaries for musl-based Linux.
|
* Add experimental prebuilt binaries for musl-based Linux.
|
||||||
[#1379](https://github.com/lovell/sharp/issues/1379)
|
[#1379](https://github.com/lovell/sharp/issues/1379)
|
||||||
|
|
||||||
|
@ -82,23 +82,20 @@ function counters () {
|
|||||||
* Improves the performance of `resize`, `blur` and `sharpen` operations
|
* Improves the performance of `resize`, `blur` and `sharpen` operations
|
||||||
* by taking advantage of the SIMD vector unit of the CPU, e.g. Intel SSE and ARM NEON.
|
* by taking advantage of the SIMD vector unit of the CPU, e.g. Intel SSE and ARM NEON.
|
||||||
*
|
*
|
||||||
* This feature is currently off by default but future versions may reverse this.
|
|
||||||
* Versions of liborc prior to 0.4.25 are known to segfault under heavy load.
|
|
||||||
*
|
|
||||||
* @example
|
* @example
|
||||||
* const simd = sharp.simd();
|
* const simd = sharp.simd();
|
||||||
* // simd is `true` if SIMD is currently enabled
|
* // simd is `true` if the runtime use of liborc is currently enabled
|
||||||
* @example
|
* @example
|
||||||
* const simd = sharp.simd(true);
|
* const simd = sharp.simd(false);
|
||||||
* // attempts to enable the use of SIMD, returning true if available
|
* // prevent libvips from using liborc at runtime
|
||||||
*
|
*
|
||||||
* @param {Boolean} [simd=false]
|
* @param {Boolean} [simd=true]
|
||||||
* @returns {Boolean}
|
* @returns {Boolean}
|
||||||
*/
|
*/
|
||||||
function simd (simd) {
|
function simd (simd) {
|
||||||
return sharp.simd(is.bool(simd) ? simd : null);
|
return sharp.simd(is.bool(simd) ? simd : null);
|
||||||
}
|
}
|
||||||
simd(false);
|
simd(true);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Decorate the Sharp class with utility-related functions.
|
* Decorate the Sharp class with utility-related functions.
|
||||||
|
BIN
test/fixtures/expected/extract-lch.jpg
vendored
BIN
test/fixtures/expected/extract-lch.jpg
vendored
Binary file not shown.
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
@ -115,7 +115,7 @@ describe('Partial image extraction', function () {
|
|||||||
if (err) throw err;
|
if (err) throw err;
|
||||||
assert.strictEqual(280, info.width);
|
assert.strictEqual(280, info.width);
|
||||||
assert.strictEqual(380, info.height);
|
assert.strictEqual(380, info.height);
|
||||||
fixtures.assertSimilar(fixtures.expected('rotate-extract.jpg'), data, { threshold: 6 }, done);
|
fixtures.assertSimilar(fixtures.expected('rotate-extract.jpg'), data, { threshold: 7 }, done);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user