-
-
Notifications
You must be signed in to change notification settings - Fork 400
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Why are "install script" times 20 seconds? #1043
Comments
Seeing this as well. Thanks! |
I'm seeing super slow times locally too, luckily we don't have this bad of times on our CI. |
I don't have slow install times for better-sqlite3 in my projects. Which NodeJS / Electron version are you using / targetting, have you checked if there is a recompile happening? |
I'm targeting Node.js v18 (latest LTS) in local dev. The lib is being used in a cloudflare workers environment for communicating with D1. How could I check if there is a recompile happening? |
I'm seeing high single CPU usage during the better-sqlite3 install script stage. Seems like it is recompiling? Certainly this lib supports mac-arm64? |
It is supported, yes. Otherwise the compilation would fail anyway. But right now there is no prebuilt binary for the use in NodeJS on arm64, only for Electron. There is still an open pull request #1002 that would add those prebuilt binaries. A pragmatic way to see if the module has been recompiled, without fiddling with logs and flasgs etc. would be to have a look at node_modules/better-sqlite3/build/Release after the module has been installed. If there is any other file than better_sqlite3.node, the module has been recompiled. |
The issue seems to have been re-introduced in |
As you are using pnpm, do you have node-gyp installed for it ( |
I do have node-gyp installed |
Also suffering from this issue (persists in I'm using Nx (same with Turbo), with Cloudflare D1 and DrizzleORM. I will be more than glad to provide more information if needed to fix this issue. P.S: UPDATE: Issue persists in |
When better-sqlite3 get's recompiled everytime you are either using a runtime where no prebuilt binary is available or something in the toolchain (pnpm, prebuild-install .. ) resolves the wrong architecture / url of the prebuilt binary to load. I don't think that the overall problem is to be solved by better-sqlite3 itself but within the tools used to provide, dsitribute and resolve the prebuilt binaries. Does the issue also occur using npm instead of pnpm? Does it also happen when installing this minimal project? {
"name": "testing",
"version": "1.0.0",
"engines" : {
"node": ">=18.0.0"
},
"dependencies": {
"better-sqlite3": "9.1.1"
}
} |
Closing due to inactivity |
Thank you for your hard work creating a wonderful library for sqlite.
Background
I am running better-sqlite3 in a turborepo with Cloudflare D1. My
pnpm install
times are 22 seconds, even with turborepo cache enabled.Most of the total time is spent on this step:
node_modules/better-sqlite3: Running install script, done in 20.6s
How to reproduce
My reproduction repo is here.
Call to action
What is happening in this install script? Can it be cached? Any recommendations are much appreciated!
The text was updated successfully, but these errors were encountered: