First Query Very Slow (~3s) on Chrome (64.0.3282.167)
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 13.7k
- Forks
- 1.1k
- PR merge metrics
- No merged PRs in 30d
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();
})();
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.
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.
Assessment
- Tech stack
- javascript, sqlite
- Domain
- database, web-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100