Bun v0.1.9 #1098
Jarred-Sumner
announced in
Announcements
Bun v0.1.9
#1098
Replies: 2 comments
-
Thank you |
Beta Was this translation helpful? Give feedback.
0 replies
-
Awesome work to all! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
What's new
bun install
andfetch()
mostly)Bun.serve
gets about 20% faster outside of "hello world" benchmarks due to optimizing howHeaders
are copied/read and faster generated bindingsrequire("buffer")
andrequire("process")
now point to Bun's implementation instead of a browserify polyfill (thanks @zhuzilin)setTimeout
orsetInterval
to not keep the process alive (thanks @zhuzilin)ptr()
inbun:ffi
JIT-optimized
TextEncoder.encodeInto
can be a 1.5x perf boost up to around a 5x perf boostThe
hash()
function in this microbenchmark callsptr()
:Internals
Bun learns how to JIT
DOMJIT
is a JavaScriptCore API that gives 3rd-party embedders low-level access to the JIT compiler/assembler to optimize native functions and getters/setters. Safari leverages DOMJIT to make commonly-accessed properties likeelement.parentNode
fasterBun is beginning to use DOMJIT now, starting in two places:
ptr()
function inbun:ffi
TextEncoder.encodeInto
To better support Bun's usecase, I extended
DOMJIT
to support Typed Array arguments, as well as added support for specifying more kinds of side effects that enable/disable optimizations:Faster and more reliable JSC <> Zig bindings
At Bun's compile-time, Bun now code-generates C++ binding classes for JavaScript objects implemented in Zig. Previously, Bun mostly used the JavaScriptCore C API.
Using JavaScriptCore's C++ API improves performance and is important for making the garbage collector better aware of Bun's usage. But, writing bindings manually can be very repetitive.
Given a class definition in JavaScript like this:
Bun generates corresponding:
This approach is inspired by WebIDL bindings which both Safari and Chromium use.
More reliable event loop on Linux
This screenshot is with a simulated bandwidth limit and no throttling of max http connections
Previously, bun had a tendency to hang in situations like this
What's Changed
IntPrimtiive
->IntPrimitive
by @ryanrussell in refactor(src/tagged_pointer):IntPrimtiive
->IntPrimitive
#1046New Contributors
Full Changelog: bun-v0.1.8...bun-v0.1.9
This discussion was created from the release Bun v0.1.9.
Beta Was this translation helpful? Give feedback.
All reactions