mirror of
https://github.com/kiwix/kiwix-js.git
synced 2025-09-23 04:28:30 -04:00
Patch contributed by christian@evopedia.info, to improve performance of
title searching in the dump So far, we were reading the title file till its end. In fact, we only need a very small part of it. This should really reduce I/O and memory consumption while searching for titles
This commit is contained in:
parent
fd38c7edc0
commit
82dec4d423
@ -223,7 +223,9 @@ define(function(require) {
|
||||
}
|
||||
callbackFunction(titleList);
|
||||
};
|
||||
var blob = this.titleFile.slice(titleOffset);
|
||||
// 300 bytes is arbitrary : we actually do not really know how long the titles will be
|
||||
// But mediawiki titles seem to be limited to ~200 bytes, so 300 should be more than enough
|
||||
var blob = this.titleFile.slice(titleOffset, titleOffset + titleCount * 300);
|
||||
// Read in the file as a binary string
|
||||
reader.readAsArrayBuffer(blob);
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user