spiegel-keyman/developer
Marc Durdin d2acfdec5c fix(developer): improve kmcmplib/kmw compiler performance
Fixes #9154.

Improves performance in both kmcmplib and in kmc-kmn/kmw-compiler. After
these changes are applied, vietnamese_telex keyboard builds in around 6
seconds on my machine (down from over 2 minutes). This is certainly only
the surface of performance improvements we could make.

Addresses excessive memory reallocations in kmcmplib, by reallocating
store and key arrays in large chunks of 100 items rather than
reallocating on each new item added. This resulted in a 250x speed-up on
functions such as `AddStore` in WASM build.

Some careful modulus arithmetic was needed for resizing the key array,
which can be grown in larger increments.

Resolved excessive zeroing out of destination buffer in u16ncpy, which
was being called with an 8kb destination buffer on every line of the
file.

In the kmw side, vast majority of the performance cost was in copying of
buffers while loading a .kmx into memory, rather than creating views
into the memory. Essentially replaced this pattern:

```
return this.rString.fromBuffer(source.slice(offset));
```

with:

```
const data = new Uint8Array(source.buffer, source.byteOffset + offset);
return this.rString.fromBuffer(data);
```
2023-07-04 14:36:25 +07:00
..
src fix(developer): improve kmcmplib/kmw compiler performance 2023-07-04 14:36:25 +07:00
.gitignore chore(developer): move server with no changes 2022-05-23 12:15:34 +10:00
build.sh refactor(developer): kmc-kmw becomes component of kmc-kmn 2023-06-20 11:52:23 +07:00