• Ryan Groch's avatar
    perf: change db to WAL mode (#3140) · 55e3ad70
    Ryan Groch 提交于
    This PR changes the SQLite database setting to use WAL (Write-Ahead
    Logging) mode. From what I can tell, it should be an easy performance
    improvement with no real downside for our case. Documentation is here:
    https://sqlite.org/wal.html
    
    Also, the [docs for
    better-sqlite3](https://www.npmjs.com/package/better-sqlite3) explicitly
    recommend it:
    
    > Though not required, it is generally important to set the WAL pragma
    for performance reasons.
    
    I came across this as I was looking into the issue where the chat code
    blocks slow down Dyad's framerate. I'm not entirely sure whether this is
    related, but I did notice that sometimes database calls were taking a
    lot longer than I expected, and that would cause Dyad's framerate to
    drop significantly on my machine. This change seems to be an improvement
    in that regard, so it might also have an effect on the code blocks issue
    as well.
    
    It's hard to accurately benchmark this because its effect is only
    substantial when there are multiple database calls going on at the same
    time. I can definitely attempt a benchmark if that would be worthwhile
    though.
    <!-- devin-review-badge-begin -->
    
    ---
    
    <a href="https://app.devin.ai/review/dyad-sh/dyad/pull/3140"
    target="_blank">
      <picture>
    <source media="(prefers-color-scheme: dark)"
    srcset="https://static.devin.ai/assets/gh-open-in-devin-review-dark.svg?v=1">
    <img
    src="https://static.devin.ai/assets/gh-open-in-devin-review-light.svg?v=1"
    alt="Open with Devin">
      </picture>
    </a>
    <!-- devin-review-badge-end -->
    55e3ad70
名称
最后提交
最后更新
..
__tests__ 正在载入提交数据...
app 正在载入提交数据...
atoms 正在载入提交数据...
client_logic 正在载入提交数据...
components 正在载入提交数据...
constants 正在载入提交数据...
contexts 正在载入提交数据...
db 正在载入提交数据...
errors 正在载入提交数据...
hooks 正在载入提交数据...
i18n 正在载入提交数据...
ipc 正在载入提交数据...
lib 正在载入提交数据...
main 正在载入提交数据...
neon_admin 正在载入提交数据...
pages 正在载入提交数据...
paths 正在载入提交数据...
pro 正在载入提交数据...
prompts 正在载入提交数据...
routes 正在载入提交数据...
shared 正在载入提交数据...
store 正在载入提交数据...
styles 正在载入提交数据...
supabase_admin 正在载入提交数据...
utils 正在载入提交数据...
backup_manager.ts 正在载入提交数据...
main.ts 正在载入提交数据...
preload.ts 正在载入提交数据...
renderer.tsx 正在载入提交数据...
router.ts 正在载入提交数据...