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:
mossroy 2013-06-08 13:21:13 +02:00
parent fd38c7edc0
commit 82dec4d423

View File

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