diff options
author | 2022-11-26 21:04:38 -0800 | |
---|---|---|
committer | 2022-11-26 21:04:38 -0800 | |
commit | 10996a797a6cae831a292b40f80ed3446277eccb (patch) | |
tree | 7da625d903dc2166d4b611d9e366ff96f0c9ebe9 /test/bun.js/text-decoder.test.js | |
parent | 949d715a141890286d3b04ded8e209ac899ed2af (diff) | |
download | bun-10996a797a6cae831a292b40f80ed3446277eccb.tar.gz bun-10996a797a6cae831a292b40f80ed3446277eccb.tar.zst bun-10996a797a6cae831a292b40f80ed3446277eccb.zip |
Faster UTF16 -> UTF8 and UTF8 -> UTF16 (#1552)
* Fix freezing test
* Add SIMDUTF
* More micro bench snippets
* Update .gitattributes
* Update .gitattributes
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Diffstat (limited to '')
-rw-r--r-- | test/bun.js/text-decoder.test.js | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/test/bun.js/text-decoder.test.js b/test/bun.js/text-decoder.test.js index 2a88a8bc8..bc10bf649 100644 --- a/test/bun.js/text-decoder.test.js +++ b/test/bun.js/text-decoder.test.js @@ -1,5 +1,5 @@ import { expect, it, describe } from "bun:test"; -import { gc as gcTrace } from "./gc"; +import { gc as gcTrace, withoutAggressiveGC } from "./gc"; const getByteLength = (str) => { // returns the byte length of an utf8 string @@ -74,10 +74,12 @@ describe("TextDecoder", () => { it("DOMJIT call", () => { const array = new Uint8Array(bytes.buffer); - for (let i = 0; i < 100_000; i++) { - const decoded = decoder.decode(array); - expect(decoded).toBe(text); - } + withoutAggressiveGC(() => { + for (let i = 0; i < 100_000; i++) { + const decoded = decoder.decode(array); + expect(decoded).toBe(text); + } + }); }); }); |