First Query Very Slow (~3s) on Chrome (64.0.3282.167)
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- javascript, sqlite
Research direction
Reproduce the issue using the provided XHR and SQL.Database example, comparing the first SELECT in Chrome 64 with Firefox 58. Start with the Chrome DevTools timing shown in the report and the database-loading path; done means the cause of the slow first query is identified and the regression or behavior is addressed with a verified reproduction.
Written by the indexing model from the issue text.
Description
I'm seeing slow first queries against an database loaded via XHR. All the queries are fairly trivial, and after the first they complete quickly. Here's a picture of the chrome dev-tools:

Firefox (58.0.2) doesn't have this problem, so perhaps something browser related?
The following JS recreates this:
let db = null;
let experimentUrl = 'https://storage.googleapis.com/axelbrooke-public/experiments/toxic-comment-clf/experiments.sqlite';
(function() {
let xhr = new XMLHttpRequest();
xhr.open('GET',
experimentUrl,
true);
xhr.responseType = 'arraybuffer';
xhr.onload = function (e) {
let uInt8Array = new Uint8Array(this.response);
db = new SQL.Database(uInt8Array);
console.log(new Date(), 'Database created.');
console.log(queryDb('SELECT * FROM hparams'));
console.log(new Date(), 'Database loaded.');
app();
};
xhr.send();
})();
- Dominant language
- JavaScript
- Stars
- 13.7k
- Forks
- 1.1k
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from sql-js/sql.js
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
Similar issues
-
bug confirmed issue
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
open-webui/open-webui#30750 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Mend: dependency security vulnerability untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 70/100