Skip to content

Commit c944db1

Browse files
committed
release binary stripping and dense array variants
1 parent bb6bf66 commit c944db1

File tree

1 file changed

+41
-4
lines changed

1 file changed

+41
-4
lines changed

blog/2024-07-09-boa-release-19.md

Lines changed: 41 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
---
1+
<!-- ---
22
layout: post
33
tags: [post]
44
title: "Boa release v0.19"
55
author: Boa Developers
6-
---
6+
--- -->
77

88
## Summary
99

@@ -51,6 +51,45 @@ Over time we will eventually need to work with other engines to have a more adva
5151

5252
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.
5353

54+
## Optimizations
55+
56+
### Release binary stripping
57+
58+
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.
59+
60+
| crate | v0.18 | v0.19 |
61+
| ---------- | ----- | ----- |
62+
| boa | 26MB | 25MB |
63+
| boa_tester | 27MB | 25MB |
64+
65+
### Dense array storage variants for i32 and f64
66+
67+
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.
68+
69+
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):
70+
71+
```js
72+
let a = [1, 2];
73+
74+
$boa.object.indexedStorageType(a); // 'DenseI32'
75+
76+
a.push(0xdeadbeef);
77+
$boa.object.indexedStorageType(a); // 'DenseI32'
78+
79+
a.push(0.5);
80+
$boa.object.indexedStorageType(a); // 'DenseF64'
81+
82+
a.push("Hello");
83+
$boa.object.indexedStorageType(a); // 'DenseElement'
84+
85+
a[100] = 100; // Make a hole
86+
$boa.object.indexedStorageType(a); // 'SparseElement'
87+
```
88+
89+
Much of this work is possible thanks to our implementation of [Object Shapes](https://github.com/boa-dev/boa/blob/main/docs/shapes.md)
90+
91+
###
92+
5493
## Intl updates
5594

5695
## Builtins updates
@@ -59,8 +98,6 @@ This change also offered a nice side effect of not having benchmark or test262 d
5998

6099
### Experimental features
61100

62-
## Optimizations
63-
64101
## Conclusion
65102

66103
### How can you support Boa?

0 commit comments

Comments
 (0)