Skip to content

Commit

Permalink
release binary stripping and dense array variants
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonwilliams committed Jul 8, 2024
1 parent bb6bf66 commit c944db1
Showing 1 changed file with 41 additions and 4 deletions.
45 changes: 41 additions & 4 deletions blog/2024-07-09-boa-release-19.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
<!-- ---
layout: post
tags: [post]
title: "Boa release v0.19"
author: Boa Developers
---
--- -->

## Summary

Expand Down Expand Up @@ -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
Expand All @@ -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?
Expand Down

0 comments on commit c944db1

Please sign in to comment.