Speed-up database downloads
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 35/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- github, typescript, vscode
調査の方向性
提供された bash スクリプトとその GitHub API エンドポイント /repos/{owner}/{repo}/code-scanning/codeql/databases/{language} から始め、単一チャンクと複数チャンクの例を実行します。extension が現在どのようにデータベースをダウンロードしているかを追跡し、完了の定義を、範囲リクエストを安全に並行して発行し、元のデータベースアーカイブを再構築できることとします。
索引モデルが issue の本文から書いたものです。
説明
Is your feature request related to a problem? Please describe.
I feel like it takes too long to download a CodeQL database from GitHub into VSCode.
Describe the solution you'd like
Use multi-threaded downloads to speed things up.
Describe alternatives you've considered
N/A
Additional context
For example the QL database from github/codeql is only 160MB, but it takes 2 minutes to download. If I concurrently download 10 chunks of the file the download takes less than 10 seconds. I wrote a small bash script to demonstrate.
A single 160MB chunk:
time sh script.sh github/codeql ql 1
gh api -H Accept: application/zip -H Range: bytes=0-165712932 /repos/github/codeql/code-scanning/codeql/databases/ql
real 2m9.894s
user 0m0.439s
sys 0m1.426s
and a download with 10 chunks of 16MB:
time sh script.sh github/codeql ql 10
gh api -H Accept: application/zip -H Range: bytes=0-16571293 /repos/github/codeql/code-scanning/codeql/databases/ql
gh api -H Accept: application/zip -H Range: bytes=16571294-33142587 /repos/github/codeql/code-scanning/codeql/databases/ql
gh api -H Accept: application/zip -H Range: bytes=33142588-49713881 /repos/github/codeql/code-scanning/codeql/databases/ql
gh api -H Accept: application/zip -H Range: bytes=49713882-66285175 /repos/github/codeql/code-scanning/codeql/databases/ql
gh api -H Accept: application/zip -H Range: bytes=66285176-82856469 /repos/github/codeql/code-scanning/codeql/databases/ql
gh api -H Accept: application/zip -H Range: bytes=82856470-99427763 /repos/github/codeql/code-scanning/codeql/databases/ql
gh api -H Accept: application/zip -H Range: bytes=99427764-115999057 /repos/github/codeql/code-scanning/codeql/databases/ql
gh api -H Accept: application/zip -H Range: bytes=115999058-132570351 /repos/github/codeql/code-scanning/codeql/databases/ql
gh api -H Accept: application/zip -H Range: bytes=132570352-149141645 /repos/github/codeql/code-scanning/codeql/databases/ql
gh api -H Accept: application/zip -H Range: bytes=149141646-165712932 /repos/github/codeql/code-scanning/codeql/databases/ql
real 0m9.752s
user 0m1.069s
sys 0m2.009s
The script
#! /bin/bash
nwo="$1"
lang="$2"
count="$3"
URL="/repos/${nwo}/code-scanning/codeql/databases/${lang}"
SIZE=$(gh api -H "Accept: application/zip" -H "Range: bytes=0-1" -i "${URL}" | tr -d '\r' | grep "Content-Range: bytes 0-1/" | cut -d / -f 2)
CHUNK_SIZE=$(expr "${SIZE}" / "${count}")
start=0
parts=""
for i in $(seq $(expr "${count}" - 1))
do
end=$(expr "${start}" + "${CHUNK_SIZE}")
echo gh api -H "Accept: application/zip" -H "Range: bytes=${start}-${end}" "${URL}"
gh api -H "Accept: application/zip" -H "Range: bytes=${start}-${end}" "${URL}" > "part-$i" &
start=$(expr "${end}" + 1)
parts="${parts}part-${i} "
done
if [ "${start}" -lt "${SIZE}" ] ; then
echo gh api -H "Accept: application/zip" -H "Range: bytes=${start}-${SIZE}" "${URL}"
gh api -H "Accept: application/zip" -H "Range: bytes=${start}-${SIZE}" "${URL}" > "part-${count}"
parts="${parts}part-${count}"
fi
wait
cat $parts > database.zip
rm -f $parts
- 主要言語
- TypeScript
- スター
- 539
- フォーク
- 240
- 平均マージ
- 2日 6時間
- マージ済み PR(30日)
- 29
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
github/vscode-codeql のほかの issue
-
bug VSCode
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
github/vscode-codeql#4471 · コメント 1 件 ·
-
bug enhancement VSCode
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
github/vscode-codeql#592 · コメント 2 件 ·
-
enhancement VSCode
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
github/vscode-codeql#4432 · コメント 1 件 ·
-
bug VSCode
難易度 3/5 1〜2日 初心者へのやさしさ 52/100
github/vscode-codeql#4356 ·
-
bug VSCode
難易度 3/5 1〜2日 初心者へのやさしさ 64/100
github/vscode-codeql#4339 · コメント 1 件 ·
github/vscode-codeql の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
safetrustcr/dApp-SafeTrust#426 ·
-
area:workflow bug ready-for-agent
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
fil-donadoni/tolaria#4409 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
Fission-AI/OpenSpec#1960 ·
-
Add dependabot オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
corsairdev/corsair#1764 ·