Conversation
- Replace all mo:base@0.14.13/* imports with mo:core/* equivalents
- Add ListBuffer<A> class backed by mo:core/List as Buffer replacement
- Replace B.Buffer<N>(cap) with ListBuffer<N>(), B.toArray with .toArray()
- Replace BInterface.fromDeprecatedBuffer(b) with { write = b.add }
- Replace Debug.trap with Runtime.trap (mo:core/Debug has no trap)
- Replace Iter.range (inclusive) with Nat.range (exclusive upper bound)
- Fix Int64.maximumValue -> Int64.maxValue for mo:core API
- Update mops.toml: remove base/buffer deps, add core, bump moc to 1.3.0
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Benchmark Resultsbench/BigEndian.bench.mo
|
| Type to Bytes | Bytes to Type | |
|---|---|---|
| Nat8 | 2_035_851 |
5_696_302 |
| Nat16 | 2_426_732 |
7_397_059 |
| Nat32 | 3_000_429 |
12_168_413 |
| Nat64 | 3_738_860 |
20_398_693 |
| Int8 | 2_078_474 |
5_698_921 |
| Int16 | 2_429_355 |
7_399_678 |
| Int32 | 3_284_239 |
12_446_322 |
| Int64 | 4_131_524 |
20_771_394 |
| Float | 306_155_630 |
256_233_982 |
| LEB128_64 | 151_507_702 |
166_562_160 |
| SLEB128_64 | 222_340_836 |
171_332_191 |
Heap
| Type to Bytes | Bytes to Type | |
|---|---|---|
| Nat8 | 272 B |
272 B |
| Nat16 | 272 B |
272 B |
| Nat32 | 272 B |
272 B |
| Nat64 | 272 B |
272 B |
| Int8 | 272 B |
272 B |
| Int16 | 272 B |
272 B |
| Int32 | 272 B |
272 B |
| Int64 | 272 B |
272 B |
| Float | 272 B |
272 B |
| LEB128_64 | 272 B |
272 B |
| SLEB128_64 | 272 B |
272 B |
Garbage Collection
| Type to Bytes | Bytes to Type | |
|---|---|---|
| Nat8 | 133.62 KiB |
641.43 KiB |
| Nat16 | 328.93 KiB |
641.43 KiB |
| Nat32 | 485.18 KiB |
680.68 KiB |
| Nat64 | 797.68 KiB |
758.62 KiB |
| Int8 | 133.62 KiB |
641.43 KiB |
| Int16 | 328.93 KiB |
641.43 KiB |
| Int32 | 524.5 KiB |
719.89 KiB |
| Int64 | 914.87 KiB |
875.81 KiB |
| Float | 10.58 MiB |
7.49 MiB |
| LEB128_64 | 5.41 MiB |
5.01 MiB |
| SLEB128_64 | 9.66 MiB |
5.27 MiB |
bench/LittleEndian.bench.mo $({\color{red}+10.21\%})$
ByteUtils library Benchmarks: Little Endian Conversions
Benchmarking the performance with 10k calls for type-to-bytes and bytes-to-type conversions
Instructions:
Heap:
Stable Memory:
Garbage Collection:
Instructions
| Type to Bytes | Bytes to Type | |
|---|---|---|
| Nat8 | 2_035_851 |
5_696_302 |
| Nat16 | 2_426_732 |
7_397_059 |
| Nat32 | 3_000_429 |
12_168_413 |
| Nat64 | 3_738_860 |
20_398_693 |
| Int8 | 2_078_474 |
5_698_921 |
| Int16 | 2_429_355 |
7_399_678 |
| Int32 | 3_284_239 |
12_446_322 |
| Int64 | 4_131_524 |
20_771_394 |
| Float | 299_755_630 |
249_833_982 |
| LEB128_64 | 151_507_702 |
166_562_160 |
| SLEB128_64 | 222_340_836 |
171_332_191 |
Heap
| Type to Bytes | Bytes to Type | |
|---|---|---|
| Nat8 | 272 B |
272 B |
| Nat16 | 272 B |
272 B |
| Nat32 | 272 B |
272 B |
| Nat64 | 272 B |
272 B |
| Int8 | 272 B |
272 B |
| Int16 | 272 B |
272 B |
| Int32 | 272 B |
272 B |
| Int64 | 272 B |
272 B |
| Float | 272 B |
272 B |
| LEB128_64 | 272 B |
272 B |
| SLEB128_64 | 272 B |
272 B |
Garbage Collection
| Type to Bytes | Bytes to Type | |
|---|---|---|
| Nat8 | 133.62 KiB |
641.43 KiB |
| Nat16 | 328.93 KiB |
641.43 KiB |
| Nat32 | 485.18 KiB |
680.68 KiB |
| Nat64 | 797.68 KiB |
758.62 KiB |
| Int8 | 133.62 KiB |
641.43 KiB |
| Int16 | 328.93 KiB |
641.43 KiB |
| Int32 | 524.5 KiB |
719.89 KiB |
| Int64 | 914.87 KiB |
875.81 KiB |
| Float | 10.58 MiB |
7.49 MiB |
| LEB128_64 | 5.41 MiB |
5.01 MiB |
| SLEB128_64 | 9.66 MiB |
5.27 MiB |
bench/Sorted.bench.mo $({\color{red}+12.56\%})$
ByteUtils library Benchmarks: Sorted Encodings
Benchmarking the performance with 10k calls for type-to-bytes and bytes-to-type conversions using sortable encodings
Instructions:
Heap:
Stable Memory:
Garbage Collection:
Instructions
| Type to Bytes | Bytes to Type | |
|---|---|---|
| Nat8 | 2_035_839 |
5_626_700 |
| Nat16 | 2_426_720 |
7_337_047 |
| Nat32 | 2_995_020 |
12_097_267 |
| Nat64 | 3_738_766 |
20_328_640 |
| Int8 | 2_098_503 |
5_628_950 |
| Int16 | 2_449_384 |
7_339_707 |
| Int32 | 3_020_262 |
12_171_280 |
| Int64 | 3_761_430 |
20_391_382 |
| Float | 314_813_782 |
278_194_365 |
Heap
| Type to Bytes | Bytes to Type | |
|---|---|---|
| Nat8 | 272 B |
272 B |
| Nat16 | 272 B |
272 B |
| Nat32 | 272 B |
272 B |
| Nat64 | 272 B |
272 B |
| Int8 | 272 B |
272 B |
| Int16 | 272 B |
272 B |
| Int32 | 272 B |
272 B |
| Int64 | 272 B |
272 B |
| Float | 272 B |
272 B |
Garbage Collection
| Type to Bytes | Bytes to Type | |
|---|---|---|
| Nat8 | 133.62 KiB |
641.43 KiB |
| Nat16 | 328.93 KiB |
641.43 KiB |
| Nat32 | 485.18 KiB |
680.18 KiB |
| Nat64 | 797.68 KiB |
758.62 KiB |
| Int8 | 133.62 KiB |
641.43 KiB |
| Int16 | 328.93 KiB |
641.43 KiB |
| Int32 | 485.18 KiB |
680.82 KiB |
| Int64 | 797.68 KiB |
758.62 KiB |
| Float | 11.12 MiB |
8.68 MiB |
No description provided.