sql-js / sql-js/sql.js

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

未关闭
#230 7 条评论 2 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
JavaScript
星标
13.7k
派生
1.1k
PR 合并指标
30 天内没有已合并 PR

描述

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

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

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.

由索引模型根据 Issue 内容生成。

评估

技术栈
javascript, sqlite
领域
database, web-dev
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。