Skip to content
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

Improve performance #121

Open
penberg opened this issue Jun 27, 2024 · 1 comment
Open

Improve performance #121

penberg opened this issue Jun 27, 2024 · 1 comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@penberg
Copy link
Contributor

penberg commented Jun 27, 2024

We are still a bit behind better-sqlite3. For example, there's more overhead in get():

penberg@vonneumann libsql-js % node perf/perf-libsql.js

cpu: Apple M1
runtime: node v18.19.0 (arm64-darwin)

benchmark      time (avg)             (min … max)       p75       p99      p999
------------------------------------------------- -----------------------------
• Statement
------------------------------------------------- -----------------------------
get(1)      1'969 ns/iter   (1'911 ns … 2'539 ns)  1'970 ns  2'424 ns  2'539 ns

summary for Statement
  get(1)

penberg@vonneumann libsql-js % node perf/perf-better-sqlite3.js
cpu: Apple M1
runtime: node v18.19.0 (arm64-darwin)

benchmark      time (avg)             (min … max)       p75       p99      p999
------------------------------------------------- -----------------------------
• Statement
------------------------------------------------- -----------------------------
get(1)        587 ns/iter     (555 ns … 1'122 ns)    584 ns    944 ns  1'122 ns

The assumption that a lot of this is memory memory allocations and copies as values are passed between the C, Rust, and JavaScirpt layers. We also suspect that Neon Bindings may be less efficient than better-sqlite3 is which seems to hook into the V8 APIs directly.

Let's improve the benchmarks, profile, and fix performance to be on-par with better-sqlite3.

@penberg penberg added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers labels Jun 27, 2024
@drewbitt
Copy link

This would be great; think there is most every feature I want here in replacing and improving on better-sqlite3 (once extension support in 0.40 lands), except performance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants