spiegel-keyman/common/web
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
..
es-bundling chore(web): tweaks per review 2023-06-19 12:18:16 +07:00
eslint chore(developer): add eslint devDependency for kmc 2023-04-25 13:44:56 +07:00
input-processor chore(web): Merge branch 'chore/web/cleanup-kmw-headless-module-builds' into chore/web/esbuild-config-cleanup 2023-06-16 12:47:20 +07:00
keyboard-processor Merge pull request #9025 from keymanapp/chore/web/esbuild-config-cleanup 2023-06-19 14:04:11 +07:00
keyman-version chore(web): Merge branch 'feature-esmodule-web-engine' into chore/web/update-feature-esmodule-a17s12-start 2023-05-02 12:59:35 +07:00
lm-message-types chore(common): updates typescript to 4.9.5 2023-02-09 08:40:52 +07:00
lm-worker chore(web): tweaks per review 2023-06-19 12:18:16 +07:00
recorder chore(web): kmw-main tsconfig -> /web, redirect in /common/web 2023-06-14 08:22:05 +07:00
sentry-manager chore(web): renames app/webview output, preserves name within embedding apps 2023-04-12 09:00:17 +07:00
tslib chore(web): relocates tslib-treeshaker def, consolidates it further 2023-06-15 10:56:44 +07:00
types fix(developer): improve kmcmplib/kmw compiler performance 2023-07-04 14:36:25 +07:00
utils chore(web): Merge branch 'chore/web/cleanup-kmw-headless-module-builds' into chore/web/esbuild-config-cleanup 2023-06-16 12:47:20 +07:00
.gitignore chore(web): move lm-worker into its own folder 2022-04-14 15:33:23 +10:00
build.sh chore(common): add common/web/build.sh, small cleanup 2023-03-14 13:05:27 +07:00
tsconfig.kmw-main-base.json chore(web): kmw-main tsconfig -> /web, redirect in /common/web 2023-06-14 08:22:05 +07:00