Skip to content

Commit

Permalink
fix: #94
Browse files Browse the repository at this point in the history
  • Loading branch information
JairusSW committed Oct 23, 2024
1 parent cc3eec7 commit 3a2e046
Show file tree
Hide file tree
Showing 6 changed files with 385 additions and 380 deletions.
5 changes: 0 additions & 5 deletions assembly/__benches__/string.bench.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
import { bs } from "../custom/bs";
import { serializeBool, serializeBool_BS } from "../serialize/bool";
import { serialize_simd_v1, serializeString, serializeString_BS } from "../serialize/string";

const out = memory.data(65536);

bench("UTF-16 to UTF-8", () => {
blackbox<ArrayBuffer>(String.UTF8.encode(blackbox<string>("hello world")));
Expand Down
1 change: 0 additions & 1 deletion assembly/deserialize/string.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { bs } from "../custom/bs";
import {
CHAR_B,
BACK_SLASH,
Expand Down
12 changes: 0 additions & 12 deletions assembly/serialize/bool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,7 @@
* @returns string
*/

import { bs } from "../custom/bs";

// @ts-ignore: Decorator valid here
@inline export function serializeBool(data: bool): string {
return data ? "true" : "false";
}

@inline export function serializeBool_BS(data: bool): void {
if (data === true) {
bs.write_64(28429475166421108); /* true */
} else {
//bs.write_128_n(i16x8(102, 97, 108, 115, 101, 0, 0, 0), 10);
bs.write_64(32370086184550502); /* fals */
bs.write_16(101); /* e */
}
}
11 changes: 0 additions & 11 deletions assembly/serialize/string.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,3 @@
import {
BACK_SLASH,
BACKSPACE,
CARRIAGE_RETURN,
FORM_FEED,
NEW_LINE,
QUOTE,
TAB
} from "../custom/chars";
import { OBJECT, TOTAL_OVERHEAD } from "rt/common";
import { bs } from "../custom/bs";
import { _intTo16, intTo16, unsafeCharCodeAt } from "../custom/util";
import { Sink } from "../custom/sink";

Expand Down
Loading

0 comments on commit 3a2e046

Please sign in to comment.