Skip to content

Commit bfcb6ca

Browse files
committed
Add bgzf cache
1 parent fd4f3b0 commit bfcb6ca

File tree

5 files changed

+889
-873
lines changed

5 files changed

+889
-873
lines changed

CHANGELOG.md

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,15 @@
11
## [3.0.5](https://github.com/GMOD/tabix-js/compare/v3.0.4...v3.0.5) (2025-05-26)
22

3-
4-
53
## [3.0.4](https://github.com/GMOD/tabix-js/compare/v3.0.3...v3.0.4) (2025-05-13)
64

7-
8-
95
## [3.0.3](https://github.com/GMOD/tabix-js/compare/v3.0.2...v3.0.3) (2025-05-13)
106

11-
12-
137
## [3.0.2](https://github.com/GMOD/tabix-js/compare/v3.0.1...v3.0.2) (2025-04-30)
148

15-
16-
179
## [3.0.1](https://github.com/GMOD/tabix-js/compare/v3.0.0...v3.0.1) (2025-04-30)
1810

19-
20-
2111
# [3.0.0](https://github.com/GMOD/tabix-js/compare/v2.0.5...v3.0.0) (2025-04-30)
2212

23-
24-
2513
## [2.0.5](https://github.com/GMOD/tabix-js/compare/v2.0.4...v2.0.5) (2025-03-18)
2614

2715
## [2.0.4](https://github.com/GMOD/tabix-js/compare/v2.0.3...v2.0.4) (2024-12-18)

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,6 @@ console.log(lines)
179179

180180
- `args`
181181
**[object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
182-
183182
- `args.path`
184183
**[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** 
185184
- `args.filehandle` **filehandle?** 

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
"documentation": "^14.0.3",
6464
"eslint": "^9.9.0",
6565
"eslint-plugin-import": "^2.31.0",
66-
"eslint-plugin-unicorn": "^59.0.0",
66+
"eslint-plugin-unicorn": "^60.0.0",
6767
"prettier": "^3.3.3",
6868
"rimraf": "^6.0.1",
6969
"standard-changelog": "^7.0.1",

src/tabixIndexedFile.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ export default class TabixIndexedFile {
3535
private index: IndexFile
3636
private renameRefSeq: (n: string) => string
3737
private chunkCache: AbortablePromiseCache<Chunk, ReadChunk>
38+
public cache = new LRU<string, { buffer: Uint8Array; nextIn: number }>({
39+
maxSize: 1000,
40+
})
3841

3942
/**
4043
* @param {object} args
@@ -507,6 +510,6 @@ export default class TabixIndexedFile {
507510
c.minv.blockPosition,
508511
opts,
509512
)
510-
return unzipChunkSlice(ret, c)
513+
return unzipChunkSlice(ret, c, this.cache)
511514
}
512515
}

0 commit comments

Comments
 (0)