[PR #7136] [CLOSED] 🧪 Experimenting with OPFS over absurd-sql #32881

Closed
opened 2026-04-18 08:51:03 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/actualbudget/actual/pull/7136
Author: @MikesGlitch
Created: 3/5/2026
Status: Closed

Base: masterHead: experiment/opfs-instead-of-absurd-sql


📝 Commits (4)

📊 Changes

18 files changed (+429 additions, -384 deletions)

View changed files

📝 packages/desktop-client/src/browser-preload.browser.js (+1 -7)
📝 packages/desktop-client/src/browser-server.js (+0 -12)
📝 packages/desktop-client/vite.config.ts (+3 -0)
📝 packages/desktop-electron/package.json (+1 -1)
📝 packages/loot-core/bin/build-browser (+2 -2)
📝 packages/loot-core/package.json (+2 -4)
📝 packages/loot-core/src/platform/server/fs/index.test.ts (+14 -25)
📝 packages/loot-core/src/platform/server/fs/index.ts (+175 -181)
📝 packages/loot-core/src/platform/server/indexeddb/index.ts (+1 -1)
📝 packages/loot-core/src/platform/server/sqlite/index.electron.ts (+4 -0)
📝 packages/loot-core/src/platform/server/sqlite/index.test.ts (+2 -7)
📝 packages/loot-core/src/platform/server/sqlite/index.ts (+166 -82)
📝 packages/loot-core/src/server/budgetfiles/backups.ts (+1 -1)
📝 packages/loot-core/src/server/db/index.ts (+1 -1)
📝 packages/loot-core/src/server/migrate/migrations.ts (+5 -6)
📝 packages/loot-core/src/server/sheet.ts (+2 -3)
📝 packages/loot-core/vite.config.ts (+17 -0)
📝 yarn.lock (+32 -51)

📄 Description

Notes

  • Reopening to see if it works better with the fix for multi-tabs
  • Currently fails when opening multiple budgets at the same time on diff tab
    • I should be able to make this work with multiple tabs by removing the validation and creating a new opfs shapool directory per budget (I think)
  • Bundle size is larger - not sure what's causing it yet - need to assess bundle
  • Haven't done performance metrics - not sure how to do that yet
  • Other than that it seems to work well.

Note

Just an experiment - only doing this to see how it would perform.
No consideration made for data in IndexedDB via absurd-sql
I don't think COOP/COEP headers are needed with this due to no SharedArrayBuffer requirement. Kept the headers anyway.

Description

Testing

Large budget file:
Large.Budget.30k.transactions.zip

Doesn't seem much faster to me, but doesn't seem slower either.

Checklist

  • Release notes added (see link above)
  • No obvious regressions in affected areas
  • Self-review has been performed - I understand what each change in the code does and why it is needed

Bundle Stats

Bundle Files count Total bundle size % Changed
desktop-client 27 → 26 14.89 MB → 14.87 MB (-16.35 kB) -0.11%
loot-core 1 5.82 MB → 7.21 MB (+1.39 MB) +23.87%
api 1 4.43 MB 0%
View detailed bundle stats

desktop-client

Total

Files count Total bundle size % Changed
27 → 26 14.89 MB → 14.87 MB (-16.35 kB) -0.11%
Changeset
File Δ Size
locale/pl.json 📈 +985 B (+1.09%) 88.37 kB → 89.33 kB
locale/en.json 📈 +88 B (+0.05%) 170.33 kB → 170.42 kB
locale/ca.json 📉 -185 B (-0.10%) 188.11 kB → 187.93 kB
locale/de.json 📉 -183 B (-0.10%) 180.07 kB → 179.89 kB
locale/nb-NO.json 📉 -166 B (-0.10%) 156.96 kB → 156.8 kB
locale/it.json 📉 -182 B (-0.10%) 171.16 kB → 170.98 kB
locale/es.json 📉 -186 B (-0.10%) 174.55 kB → 174.37 kB
locale/uk.json 📉 -232 B (-0.11%) 214.88 kB → 214.65 kB
locale/fr.json 📉 -194 B (-0.11%) 179.6 kB → 179.41 kB
locale/nl.json 📉 -156 B (-0.13%) 113.21 kB → 113.06 kB
locale/da.json 📉 -158 B (-0.15%) 106.35 kB → 106.2 kB
locale/th.json 📉 -303 B (-0.16%) 181.87 kB → 181.58 kB
locale/pt-BR.json 📉 -307 B (-0.16%) 183.19 kB → 182.89 kB
src/browser-preload.browser.js 📉 -210 B (-4.55%) 4.51 kB → 4.31 kB
node_modules/absurd-sql/dist/indexeddb-main-thread-worker-e59fee74.js 🔥 -12.94 kB (-100%) 12.94 kB → 0 B
node_modules/absurd-sql/dist/indexeddb-main-thread.js 🔥 -2.05 kB (-100%) 2.05 kB → 0 B
View detailed bundle breakdown

Added
No assets were added

Removed

Asset File Size % Changed
static/js/indexeddb-main-thread-worker-e59fee74.js 12.94 kB → 0 B (-12.94 kB) -100%

Bigger

Asset File Size % Changed
static/js/pl.js 88.37 kB → 89.33 kB (+985 B) +1.09%
static/js/en.js 170.33 kB → 170.42 kB (+88 B) +0.05%

Smaller

Asset File Size % Changed
static/js/index.js 9.54 MB → 9.54 MB (-2.25 kB) -0.02%
static/js/pt-BR.js 183.19 kB → 182.89 kB (-307 B) -0.16%
static/js/th.js 181.87 kB → 181.58 kB (-303 B) -0.16%
static/js/uk.js 214.88 kB → 214.65 kB (-232 B) -0.11%
static/js/fr.js 179.6 kB → 179.41 kB (-194 B) -0.11%
static/js/es.js 174.55 kB → 174.37 kB (-186 B) -0.10%
static/js/ca.js 188.11 kB → 187.93 kB (-185 B) -0.10%
static/js/de.js 180.07 kB → 179.89 kB (-183 B) -0.10%
static/js/it.js 171.16 kB → 170.98 kB (-182 B) -0.10%
static/js/nb-NO.js 156.96 kB → 156.8 kB (-166 B) -0.10%
static/js/da.js 106.35 kB → 106.2 kB (-158 B) -0.15%
static/js/nl.js 113.21 kB → 113.06 kB (-156 B) -0.13%

Unchanged

Asset File Size % Changed
static/js/workbox-window.prod.es5.js 5.64 kB 0%
static/js/en-GB.js 7.18 kB 0%
static/js/resize-observer.js 18.37 kB 0%
static/js/BackgroundImage.js 120.54 kB 0%
static/js/ReportRouter.js 1.16 MB 0%
static/js/narrow.js 638.11 kB 0%
static/js/TransactionList.js 106.22 kB 0%
static/js/wide.js 164.15 kB 0%
static/js/AppliedFilters.js 9.71 kB 0%
static/js/usePayeeRuleCounts.js 10.04 kB 0%
static/js/useTransactionBatchActions.js 13.23 kB 0%
static/js/FormulaEditor.js 1.04 MB 0%

loot-core

Total

Files count Total bundle size % Changed
1 5.82 MB → 7.21 MB (+1.39 MB) +23.87%
Changeset
File Δ Size
node_modules/@sqlite.org/sqlite-wasm/dist/index.mjs 🆕 +1.49 MB 0 B → 1.49 MB
home/runner/work/actual/actual/packages/loot-core/src/platform/server/sqlite/index.ts 📈 +2.49 kB (+61.46%) 4.05 kB → 6.54 kB
home/runner/work/actual/actual/packages/loot-core/src/platform/server/fs/index.ts 📈 +684 B (+7.67%) 8.71 kB → 9.37 kB
node_modules/@jlongster/sql.js/dist/sql-wasm.js 🔥 -67.47 kB (-100%) 67.47 kB → 0 B
node_modules/absurd-sql/dist/indexeddb-backend.js 🔥 -30.67 kB (-100%) 30.67 kB → 0 B
node_modules/absurd-sql/dist/index.js 🔥 -6.32 kB (-100%) 6.32 kB → 0 B
node_modules/@jlongster/sql.js/dist/sql-wasm.js?commonjs-es-import 🔥 -118 B (-100%) 118 B → 0 B
node_modules/@jlongster/sql.js/dist/sql-wasm.js?commonjs-module 🔥 -32 B (-100%) 32 B → 0 B
View detailed bundle breakdown

Added

Asset File Size % Changed
kcab.worker.Bqk597K7.js 0 B → 7.21 MB (+7.21 MB) -

Removed

Asset File Size % Changed
kcab.worker.MNtpiHkH.js 5.82 MB → 0 B (-5.82 MB) -100%

Bigger
No assets were bigger

Smaller
No assets were smaller

Unchanged
No assets were unchanged


api

Total

Files count Total bundle size % Changed
1 4.43 MB 0%
View detailed bundle breakdown

Added
No assets were added

Removed
No assets were removed

Bigger
No assets were bigger

Smaller
No assets were smaller

Unchanged

Asset File Size % Changed
bundle.api.js 4.43 MB 0%

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/actualbudget/actual/pull/7136 **Author:** [@MikesGlitch](https://github.com/MikesGlitch) **Created:** 3/5/2026 **Status:** ❌ Closed **Base:** `master` ← **Head:** `experiment/opfs-instead-of-absurd-sql` --- ### 📝 Commits (4) - [`d6ac876`](https://github.com/actualbudget/actual/commit/d6ac876206dde9e8725b571164f3e98efa056c66) experimenting with opfs over absurd-sql - [`d1723bf`](https://github.com/actualbudget/actual/commit/d1723bf527924717cf1f3ce4ffc918b941fa370a) throw error when multiple tabs - [`4eec665`](https://github.com/actualbudget/actual/commit/4eec66549d6b961f3b802d1aed9427fd17098c71) bring in latest - [`00a8503`](https://github.com/actualbudget/actual/commit/00a8503eb2717d90e9f5ea3cddd269148eca838d) copy sqlite ### 📊 Changes **18 files changed** (+429 additions, -384 deletions) <details> <summary>View changed files</summary> 📝 `packages/desktop-client/src/browser-preload.browser.js` (+1 -7) 📝 `packages/desktop-client/src/browser-server.js` (+0 -12) 📝 `packages/desktop-client/vite.config.ts` (+3 -0) 📝 `packages/desktop-electron/package.json` (+1 -1) 📝 `packages/loot-core/bin/build-browser` (+2 -2) 📝 `packages/loot-core/package.json` (+2 -4) 📝 `packages/loot-core/src/platform/server/fs/index.test.ts` (+14 -25) 📝 `packages/loot-core/src/platform/server/fs/index.ts` (+175 -181) 📝 `packages/loot-core/src/platform/server/indexeddb/index.ts` (+1 -1) 📝 `packages/loot-core/src/platform/server/sqlite/index.electron.ts` (+4 -0) 📝 `packages/loot-core/src/platform/server/sqlite/index.test.ts` (+2 -7) 📝 `packages/loot-core/src/platform/server/sqlite/index.ts` (+166 -82) 📝 `packages/loot-core/src/server/budgetfiles/backups.ts` (+1 -1) 📝 `packages/loot-core/src/server/db/index.ts` (+1 -1) 📝 `packages/loot-core/src/server/migrate/migrations.ts` (+5 -6) 📝 `packages/loot-core/src/server/sheet.ts` (+2 -3) 📝 `packages/loot-core/vite.config.ts` (+17 -0) 📝 `yarn.lock` (+32 -51) </details> ### 📄 Description <!-- Thank you for submitting a pull request! Make sure to follow the instructions to write release notes for your PR — it should only take a minute or two: https://github.com/actualbudget/docs#writing-good-release-notes. Try running yarn generate:release-notes *before* pushing your PR for an interactive experience. --> # Notes - Reopening to see if it works better with the fix for multi-tabs - Currently fails when opening multiple budgets at the same time on diff tab - I should be able to make this work with multiple tabs by removing the validation and creating a new opfs shapool directory per budget (I think) - Bundle size is larger - not sure what's causing it yet - need to assess bundle - Haven't done performance metrics - not sure how to do that yet - Other than that it seems to work well. > [!note] Just an experiment - only doing this to see how it would perform. No consideration made for data in IndexedDB via absurd-sql I don't think COOP/COEP headers are needed with this due to no SharedArrayBuffer requirement. Kept the headers anyway. ## Description <!-- What does this PR do? Why is it needed? Please give context on the "why?": why do we need this change? What problem is it solving for you?--> ## Related issue(s) <!-- e.g. Fixes #123, Relates to #456 --> ## Testing <!-- What did you test? How can we reproduce the issue you are fixing or how can we test the feature you built? --> Large budget file: [Large.Budget.30k.transactions.zip](https://github.com/user-attachments/files/25781297/Large.Budget.30k.transactions.zip) Doesn't seem much faster to me, but doesn't seem slower either. ## Checklist - [ ] Release notes added (see link above) - [ ] No obvious regressions in affected areas - [ ] Self-review has been performed - I understand what each change in the code does and why it is needed <!--- actual-bot-sections ---> <!--- bundlestats-action-comment key:combined start ---> ### Bundle Stats Bundle | Files count | Total bundle size | % Changed ------ | ----------- | ----------------- | --------- desktop-client | 27 → 26 | 14.89 MB → 14.87 MB (-16.35 kB) | -0.11% loot-core | 1 | 5.82 MB → 7.21 MB (+1.39 MB) | +23.87% api | 1 | 4.43 MB | 0% <details> <summary>View detailed bundle stats</summary> #### desktop-client **Total** Files count | Total bundle size | % Changed ----------- | ----------------- | --------- 27 → 26 | 14.89 MB → 14.87 MB (-16.35 kB) | -0.11% <details> <summary>Changeset</summary> File | Δ | Size ---- | - | ---- `locale/pl.json` | 📈 +985 B (+1.09%) | 88.37 kB → 89.33 kB `locale/en.json` | 📈 +88 B (+0.05%) | 170.33 kB → 170.42 kB `locale/ca.json` | 📉 -185 B (-0.10%) | 188.11 kB → 187.93 kB `locale/de.json` | 📉 -183 B (-0.10%) | 180.07 kB → 179.89 kB `locale/nb-NO.json` | 📉 -166 B (-0.10%) | 156.96 kB → 156.8 kB `locale/it.json` | 📉 -182 B (-0.10%) | 171.16 kB → 170.98 kB `locale/es.json` | 📉 -186 B (-0.10%) | 174.55 kB → 174.37 kB `locale/uk.json` | 📉 -232 B (-0.11%) | 214.88 kB → 214.65 kB `locale/fr.json` | 📉 -194 B (-0.11%) | 179.6 kB → 179.41 kB `locale/nl.json` | 📉 -156 B (-0.13%) | 113.21 kB → 113.06 kB `locale/da.json` | 📉 -158 B (-0.15%) | 106.35 kB → 106.2 kB `locale/th.json` | 📉 -303 B (-0.16%) | 181.87 kB → 181.58 kB `locale/pt-BR.json` | 📉 -307 B (-0.16%) | 183.19 kB → 182.89 kB `src/browser-preload.browser.js` | 📉 -210 B (-4.55%) | 4.51 kB → 4.31 kB `node_modules/absurd-sql/dist/indexeddb-main-thread-worker-e59fee74.js` | 🔥 -12.94 kB (-100%) | 12.94 kB → 0 B `node_modules/absurd-sql/dist/indexeddb-main-thread.js` | 🔥 -2.05 kB (-100%) | 2.05 kB → 0 B </details> <details> <summary>View detailed bundle breakdown</summary> <div> **Added** No assets were added **Removed** Asset | File Size | % Changed ----- | --------- | --------- static/js/indexeddb-main-thread-worker-e59fee74.js | 12.94 kB → 0 B (-12.94 kB) | -100% **Bigger** Asset | File Size | % Changed ----- | --------- | --------- static/js/pl.js | 88.37 kB → 89.33 kB (+985 B) | +1.09% static/js/en.js | 170.33 kB → 170.42 kB (+88 B) | +0.05% **Smaller** Asset | File Size | % Changed ----- | --------- | --------- static/js/index.js | 9.54 MB → 9.54 MB (-2.25 kB) | -0.02% static/js/pt-BR.js | 183.19 kB → 182.89 kB (-307 B) | -0.16% static/js/th.js | 181.87 kB → 181.58 kB (-303 B) | -0.16% static/js/uk.js | 214.88 kB → 214.65 kB (-232 B) | -0.11% static/js/fr.js | 179.6 kB → 179.41 kB (-194 B) | -0.11% static/js/es.js | 174.55 kB → 174.37 kB (-186 B) | -0.10% static/js/ca.js | 188.11 kB → 187.93 kB (-185 B) | -0.10% static/js/de.js | 180.07 kB → 179.89 kB (-183 B) | -0.10% static/js/it.js | 171.16 kB → 170.98 kB (-182 B) | -0.10% static/js/nb-NO.js | 156.96 kB → 156.8 kB (-166 B) | -0.10% static/js/da.js | 106.35 kB → 106.2 kB (-158 B) | -0.15% static/js/nl.js | 113.21 kB → 113.06 kB (-156 B) | -0.13% **Unchanged** Asset | File Size | % Changed ----- | --------- | --------- static/js/workbox-window.prod.es5.js | 5.64 kB | 0% static/js/en-GB.js | 7.18 kB | 0% static/js/resize-observer.js | 18.37 kB | 0% static/js/BackgroundImage.js | 120.54 kB | 0% static/js/ReportRouter.js | 1.16 MB | 0% static/js/narrow.js | 638.11 kB | 0% static/js/TransactionList.js | 106.22 kB | 0% static/js/wide.js | 164.15 kB | 0% static/js/AppliedFilters.js | 9.71 kB | 0% static/js/usePayeeRuleCounts.js | 10.04 kB | 0% static/js/useTransactionBatchActions.js | 13.23 kB | 0% static/js/FormulaEditor.js | 1.04 MB | 0% </div> </details> --- #### loot-core **Total** Files count | Total bundle size | % Changed ----------- | ----------------- | --------- 1 | 5.82 MB → 7.21 MB (+1.39 MB) | +23.87% <details> <summary>Changeset</summary> File | Δ | Size ---- | - | ---- `node_modules/@sqlite.org/sqlite-wasm/dist/index.mjs` | 🆕 +1.49 MB | 0 B → 1.49 MB `home/runner/work/actual/actual/packages/loot-core/src/platform/server/sqlite/index.ts` | 📈 +2.49 kB (+61.46%) | 4.05 kB → 6.54 kB `home/runner/work/actual/actual/packages/loot-core/src/platform/server/fs/index.ts` | 📈 +684 B (+7.67%) | 8.71 kB → 9.37 kB `node_modules/@jlongster/sql.js/dist/sql-wasm.js` | 🔥 -67.47 kB (-100%) | 67.47 kB → 0 B `node_modules/absurd-sql/dist/indexeddb-backend.js` | 🔥 -30.67 kB (-100%) | 30.67 kB → 0 B `node_modules/absurd-sql/dist/index.js` | 🔥 -6.32 kB (-100%) | 6.32 kB → 0 B `node_modules/@jlongster/sql.js/dist/sql-wasm.js?commonjs-es-import` | 🔥 -118 B (-100%) | 118 B → 0 B `node_modules/@jlongster/sql.js/dist/sql-wasm.js?commonjs-module` | 🔥 -32 B (-100%) | 32 B → 0 B </details> <details> <summary>View detailed bundle breakdown</summary> <div> **Added** Asset | File Size | % Changed ----- | --------- | --------- kcab.worker.Bqk597K7.js | 0 B → 7.21 MB (+7.21 MB) | - **Removed** Asset | File Size | % Changed ----- | --------- | --------- kcab.worker.MNtpiHkH.js | 5.82 MB → 0 B (-5.82 MB) | -100% **Bigger** No assets were bigger **Smaller** No assets were smaller **Unchanged** No assets were unchanged </div> </details> --- #### api **Total** Files count | Total bundle size | % Changed ----------- | ----------------- | --------- 1 | 4.43 MB | 0% <details> <summary>View detailed bundle breakdown</summary> <div> **Added** No assets were added **Removed** No assets were removed **Bigger** No assets were bigger **Smaller** No assets were smaller **Unchanged** Asset | File Size | % Changed ----- | --------- | --------- bundle.api.js | 4.43 MB | 0% </div> </details> </details> <!--- bundlestats-action-comment key:combined end ---> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-18 08:51:03 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#32881