diff --git a/blog/2024-07-09-boa-release-19.md b/blog/2024-07-09-boa-release-19.md index 77fee92c..be012139 100644 --- a/blog/2024-07-09-boa-release-19.md +++ b/blog/2024-07-09-boa-release-19.md @@ -1,9 +1,9 @@ ---- + ## Summary @@ -51,6 +51,45 @@ Over time we will eventually need to work with other engines to have a more adva This change also offered a nice side effect of not having benchmark or test262 data in the main repository anymore. Last time we released we had [reports](https://www.reddit.com/r/rust/comments/1b91ora/comment/ktue8rf/) of the repository being too large, so we've taken steps to reduce the size of the repository by moving this data to a separate repository and building a nightly version for reporting. Not only this makes it easier for anyone cloning Boa today but pushes to `main` are now much faster due to us not having to run test262 or Benchmarks each time. +## Optimizations + +### Release binary stripping + +Boa's binaries are on the larger side by default due to including ICU data. We may eventually move to a system where this needs to be fed from the host. However, until then there are other tricks we can employ to bring down our size, one of those is binary stripping. We can remove debug information from the release binary to reduce the size. + +| crate | v0.18 | v0.19 | +| ---------- | ----- | ----- | +| boa | 26MB | 25MB | +| boa_tester | 27MB | 25MB | + +### Dense array storage variants for i32 and f64 + +This release adds [dense array storage](https://github.com/boa-dev/boa/pull/3760) variants for `i32` and `f64` types. This allows us to store arrays of these types more efficiently, and also allows us to optimize certain operations on these arrays. + +If you want to inspect the storage type of an array in Boa you can use the `$boa.object.indexedStorageType()` APi. Here are [some examples](https://github.com/boa-dev/boa/blob/d3e539593fe206f18d44f20498cb54be15477a58/docs/boa_object.md#function-boaobjectindexedstoragetypeobject): + +```js +let a = [1, 2]; + +$boa.object.indexedStorageType(a); // 'DenseI32' + +a.push(0xdeadbeef); +$boa.object.indexedStorageType(a); // 'DenseI32' + +a.push(0.5); +$boa.object.indexedStorageType(a); // 'DenseF64' + +a.push("Hello"); +$boa.object.indexedStorageType(a); // 'DenseElement' + +a[100] = 100; // Make a hole +$boa.object.indexedStorageType(a); // 'SparseElement' +``` + +Much of this work is possible thanks to our implementation of [Object Shapes](https://github.com/boa-dev/boa/blob/main/docs/shapes.md) + +### + ## Intl updates ## Builtins updates @@ -59,8 +98,6 @@ This change also offered a nice side effect of not having benchmark or test262 d ### Experimental features -## Optimizations - ## Conclusion ### How can you support Boa?