sql-js / sql-js/sql.js

First Query Very Slow (~3s) on Chrome (64.0.3282.167)

Aperta
#230 7 commenti 2 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Lingua principale
JavaScript
Stelle
13.7k
Fork
1.1k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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:

sqljs first exec slow

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();
})();

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
javascript, sqlite
Ambito
database, web-dev
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
45/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.