tursodatabase / tursodatabase/libsql-js

Make query execution timing more convenient to collect

Open
#203 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
335
Forks
48
Avg merge
3d 2h
Merged PRs (30d)
3

Description

On node-sqlite3 one collects query timing using .on('profile'). It's a very convenient method for collecting such data. I recently created a tool for collecting and analyzing queries on SQLITE3 using this API interface: https://www.npmjs.com/package/sqlite3-query-log

This was created while studying how to improve the performance of my application.

I'm currently evaluating whether to use libsql instead of node-sqlite3, and like what I see.

One thing I came across is that you added a feature to collect timing for run and get methods:

https://github.com/tursodatabase/libsql-js/pull/154
https://github.com/tursodatabase/libsql-js/issues/122

Going by the test cases (https://github.com/tursodatabase/libsql-js/pull/156) it appears this feature added a duration field to the object returned from run and get.

That's useful, but having written a tool for collecting and analyzing such data, my opinion is that this is an inconvenient way of collecting this data.

The use case is that a developer hoping to analyze SQL performance in their application needs a simple way to turn on and collect such data.

The approach you developed requires hunting down all run and get method calls to collect data. Further, it misses all, iterate, etc.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the existing timing behavior for the run and get methods, along with the linked issues and pull requests, then compare it with the node-sqlite3 profile event API. The work is complete when there is a clearly defined, opt-in way to collect timing for run, get, all, iterate, and other query methods without locating each call site.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, nodejs, sqlite
Domain
databases
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.