diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2018-10-17 13:04:28 -0400 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2018-10-17 20:20:06 -0400 |
commit | 213885a9d00a913e3fd2eb21a5992efb63c888f5 (patch) | |
tree | 7ac1c5ffad1c3125d72155e40ef5ea75c39945ba /js/timers.ts | |
parent | 4e2e185de74edaf49d77983c935686616ba9d07c (diff) |
Optimization: Reuse ArrayBuffer during serialization.
Diffstat (limited to 'js/timers.ts')
-rw-r--r-- | js/timers.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/js/timers.ts b/js/timers.ts index 58367c1ea..292f1c613 100644 --- a/js/timers.ts +++ b/js/timers.ts @@ -1,7 +1,7 @@ // Copyright 2018 the Deno authors. All rights reserved. MIT license. import { assert } from "./util"; import * as msg from "gen/msg_generated"; -import { flatbuffers } from "flatbuffers"; +import * as flatbuffers from "./flatbuffers"; import { sendSync, setFireTimersCallback } from "./dispatch"; // Tell the dispatcher which function it should call to fire timers that are @@ -51,7 +51,7 @@ function setGlobalTimeout(due: number | null, now: number) { assert(timeout >= 0); } // Send message to the backend. - const builder = new flatbuffers.Builder(); + const builder = flatbuffers.createBuilder(); msg.SetTimeout.startSetTimeout(builder); msg.SetTimeout.addTimeout(builder, timeout); const inner = msg.SetTimeout.endSetTimeout(builder); |