chore: set up code formatter#332
Conversation
Benchmark Resultsbench/1-buffer-vector-add.bench.mo
|
| 10 | 10000 | 1000000 | |
|---|---|---|---|
| Buffer | 9_493 |
5_687_530 |
525_783_824 |
| Vector | 13_461 |
4_378_548 |
417_864_434 |
Heap
| 10 | 10000 | 1000000 | |
|---|---|---|---|
| Buffer | 272 B |
272 B |
272 B |
| Vector | 272 B |
272 B |
272 B |
Garbage Collection
| 10 | 10000 | 1000000 | |
|---|---|---|---|
| Buffer | 1.09 KiB |
143.28 KiB |
12.02 MiB |
| Vector | 1.09 KiB |
45.65 KiB |
3.86 MiB |
bench/2-vector-buffer-add.bench.mo $({\color{green}-10.20\%})$
Add
Add items one-by-one
Instructions:
Heap:
Stable Memory:
Garbage Collection:
Instructions
| 10 | 10000 | 1000000 | |
|---|---|---|---|
| Vector | 13_461 |
4_378_902 |
417_886_028 |
| Buffer | 9_493 |
5_686_822 |
525_780_992 |
Heap
| 10 | 10000 | 1000000 | |
|---|---|---|---|
| Vector | 272 B |
272 B |
272 B |
| Buffer | 272 B |
272 B |
272 B |
Garbage Collection
| 10 | 10000 | 1000000 | |
|---|---|---|---|
| Vector | 1.09 KiB |
45.65 KiB |
3.86 MiB |
| Buffer | 1.09 KiB |
143.28 KiB |
12.02 MiB |
bench/array.bench.mo $({\color{green}-18.10\%})$
Array
arr arr
Instructions:
Heap:
Stable Memory:
Garbage Collection:
Instructions
| 100k x1 | reset1 | 100k x3 | reset2 | 100k x4 | reset3 | |
|---|---|---|---|---|---|---|
| Array | 13_502_032 |
3_271 |
27_003_206 |
3_745 |
54_004_063 |
4_219 |
Heap
| 100k x1 | reset1 | 100k x3 | reset2 | 100k x4 | reset3 | |
|---|---|---|---|---|---|---|
| Array | 390.9 KiB |
-390.37 KiB |
390.9 KiB |
-390.37 KiB |
390.9 KiB |
-390.37 KiB |
Garbage Collection
| 100k x1 | reset1 | 100k x3 | reset2 | 100k x4 | reset3 | |
|---|---|---|---|---|---|---|
| Array | 360 B |
390.97 KiB |
391 KiB |
390.97 KiB |
1.14 MiB |
390.97 KiB |
bench/removeLast.bench.mo $({\color{green}-10.90\%})$
Remove items using removeLast
Vector and buffer are initialized with 100k items and then 70k items are removed one-by-one.
Instructions:
Heap:
Stable Memory:
Garbage Collection:
Instructions
| remove 70k | |
|---|---|
| Vector | 27_707_652 |
| Buffer | 29_236_913 |
Heap
| remove 70k | |
|---|---|
| Vector | -136.8 KiB |
| Buffer | -269.76 KiB |
Garbage Collection
| remove 70k | |
|---|---|
| Vector | 139.45 KiB |
| Buffer | 540.43 KiB |
bench/stable-memory.bench.mo $({\color{green}-134.72\%})$
Stable Memory and Region
Grow Region and store blobs in it
Instructions:
Heap:
Stable Memory:
Garbage Collection:
Instructions
| Region (fill 1/100) | Region (fill 1/50) | StableMemory | |
|---|---|---|---|
| 10 pages | 2_626_949 |
10_496_262 |
2_629 |
| 100 pages | 52_466_545 |
104_914_682 |
2_634 |
| 256 pages | 134_273_638 |
268_574_495 |
3_182 |
Heap
| Region (fill 1/100) | Region (fill 1/50) | StableMemory | |
|---|---|---|---|
| 10 pages | 272 B |
272 B |
276 B |
| 100 pages | 272 B |
272 B |
272 B |
| 256 pages | 272 B |
272 B |
276 B |
Garbage Collection
| Region (fill 1/100) | Region (fill 1/50) | StableMemory | |
|---|---|---|---|
| 10 pages | 208.34 KiB |
832.38 KiB |
336 B |
| 100 pages | 4.06 MiB |
8.13 MiB |
340 B |
| 256 pages | 10.4 MiB |
20.8 MiB |
340 B |
Stable Memory
| Region (fill 1/100) | Region (fill 1/50) | StableMemory | |
|---|---|---|---|
| 10 pages | 8 MiB |
8 MiB |
8 MiB |
| 100 pages | 8 MiB |
8 MiB |
0 B |
| 256 pages | 16 MiB |
16 MiB |
16 MiB |
Packages removed: - root: @stylistic/eslint-plugin, @stylistic/eslint-plugin-migrate (plugins loaded but no rules enabled since formatter PR #332 replaced them with Prettier) - cli: cacheable-request (transitive via got), @types/glob (glob ships own types) - frontend: @dfinity/auth-client, events, svelte-simple-modal (none imported) - frontend: move @types/throttle-debounce from dependencies → devDependencies - cli-releases/frontend: hast-util-to-html (import was commented out) All lockfiles (package-lock.json, bun.lock) regenerated. Lint and type checks pass. Made-with: Cursor
## What changed Removes npm packages that were no longer doing anything, across all sub-packages. | Package | Location | Reason | |---------|----------|--------| | `@stylistic/eslint-plugin` | root | Plugins were listed in `.eslintrc.json` but **no `@stylistic/*` rules were enabled** since PR #332 replaced them with Prettier. Orphaned for ~1 year. | | `@stylistic/eslint-plugin-migrate` | root | Same as above. | | `cacheable-request` | `cli` | No direct import; already pulled in as a transitive dep of `got`. | | `@types/glob` | `cli` | `glob` v10+ ships its own bundled types. | | `@dfinity/auth-client` | `frontend` | No import anywhere in the frontend. | | `events` | `frontend` | No import; grep hits were CSS `pointer-events`. | | `svelte-simple-modal` | `frontend` | No import; modals use a local `Modal.svelte` component. | | `@types/throttle-debounce` | `frontend` | Moved from `dependencies` → `devDependencies` (type packages belong in dev deps for a bundled app). | | `hast-util-to-html` | `cli-releases/frontend` | The only reference was a commented-out import on `main`. Dead comment also removed. | Also aligns `.eslintrc.json` `plugins` array with what is actually installed. ## Lockfile note Running `bun install` to regenerate `cli/bun.lock` also caught up a stale lockfile on `main` — several packages that were already updated in `cli/package.json` (`glob`, `jsdom`, `minimatch`, `prettier-plugin-motoko`, `tar`) were not reflected at the right resolved version in the old lockfile. Those are now correct. ## How to test ```sh npm run lint # 0 errors npm run check # cli tsc + svelte-check pass cd cli && npm test # existing test suite ``` ## Notes - `prettier-eslint` was intentionally **kept** — the recommended VS Code extension (`rvest.vs-code-prettier-eslint`) resolves it from the workspace. - All lockfiles (`package-lock.json` ×5, `bun.lock`) were regenerated.
No description provided.