-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
feat(ext/node): implement node:sqlite
#27308
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you maybe enable some of the tests/node_compat/
cases?
cli/bench/sqlite.js
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unrelated to this PR, but... we should have a deno.json
file in cli/bench
to run various benchmarks. I never remember how to run them and it feels like half of them are already code-rotted.
cli/lsp/tsc.rs
Outdated
@@ -4496,6 +4496,7 @@ impl<'a> ToV8<'a> for TscRequestArray { | |||
|
|||
let method_name = deno_core::FastString::from_static(method_name) | |||
.v8_string(scope) | |||
.unwrap() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ugh, I must have missed that. Why is it now a Result
/Option
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
upgrades itoa requirement to `1.0.14`. needed for #27308
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Considering that node:sqlite
is still experimental in Node, should this be behind a flag?
Also, I noticed that the jsr:@db/sqlite@0.12
is still faster when reading a table with 620k rows from the northwind dataset. 483ms vs 3.5s. Does the jsr library use different defaults that might explain it?
Benchmark results with node built-in, deno built-in, and @db/sqlite
bench/sqlite (main) $ node node.mjs
(node:34767) ExperimentalWarning: SQLite is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
cpu: AMD EPYC 7B13
runtime: node v23.6.0 (x64-linux)
benchmark time (avg) (min … max) p75 p99 p999
------------------------------------------------------------------- -----------------------------
SELECT * FROM "Order" 85'356 µs/iter (80'886 µs … 92'799 µs) 87'445 µs 92'799 µs 92'799 µs
SELECT * FROM "Product" 214 µs/iter (173 µs … 527 µs) 222 µs 373 µs 494 µs
SELECT * FROM "OrderDetail" 3'797 ms/iter (3'335 ms … 4'068 ms) 4'037 ms 4'068 ms 4'068 ms
bench/sqlite (main) $ ./deno -A node.mjs
cpu: AMD EPYC 7B13
runtime: deno 2.1.4 (x86_64-unknown-linux-gnu)
benchmark time (avg) (min … max) p75 p99 p999
------------------------------------------------------------------- -----------------------------
SELECT * FROM "Order" 69'557 µs/iter (63'264 µs … 73'822 µs) 72'497 µs 73'822 µs 73'822 µs
SELECT * FROM "Product" 193 µs/iter (149 µs … 567 µs) 200 µs 331 µs 490 µs
SELECT * FROM "OrderDetail" 3'513 ms/iter (3'385 ms … 3'664 ms) 3'629 ms 3'664 ms 3'664 ms
bench/sqlite (main) $ ./deno run -A --unstable-ffi deno.js
cpu: AMD EPYC 7B13
runtime: deno 2.1.4 (x86_64-unknown-linux-gnu)
benchmark time (avg) (min … max) p75 p99 p999
------------------------------------------------------------------- -----------------------------
SELECT * FROM "Order" 48'654 µs/iter (46'948 µs … 51'232 µs) 49'696 µs 51'232 µs 51'232 µs
SELECT * FROM "Product" 121 µs/iter (88'408 ns … 2'454 µs) 126 µs 225 µs 2'183 µs
SELECT * FROM "OrderDetail" 491 ms/iter (465 ms … 523 ms) 515 ms 523 ms 523 ms
upgrades itoa requirement to `1.0.14`. needed for #27308
Depends on:
#[varargs]
in object wrap deno_core#994extension!
macro deno_core#993TypeId
not reliable for object wrap templates deno_core#999Closes #24828