Skip to content

Commit

Permalink
Enable SIMD convolution by default #1213
Browse files Browse the repository at this point in the history
  • Loading branch information
lovell committed Sep 19, 2018
1 parent c8ff7e1 commit deacd55
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
3 changes: 3 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ Requires libvips v8.7.0.
* Drop Node 4 support.
[#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.
[#1379](https://github.com/lovell/sharp/issues/1379)

Expand Down
13 changes: 5 additions & 8 deletions lib/utility.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,23 +82,20 @@ function counters () {
* 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.
*
* 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
* 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
* const simd = sharp.simd(true);
* // attempts to enable the use of SIMD, returning true if available
* const simd = sharp.simd(false);
* // prevent libvips from using liborc at runtime
*
* @param {Boolean} [simd=false]
* @param {Boolean} [simd=true]
* @returns {Boolean}
*/
function simd (simd) {
return sharp.simd(is.bool(simd) ? simd : null);
}
simd(false);
simd(true);

/**
* Decorate the Sharp class with utility-related functions.
Expand Down
Binary file modified test/fixtures/expected/extract-lch.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion test/unit/extract.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ describe('Partial image extraction', function () {
if (err) throw err;
assert.strictEqual(280, info.width);
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);
});
});

Expand Down

0 comments on commit deacd55

Please sign in to comment.