mirror of
https://github.com/netfun2000/ip2region.git
synced 2026-02-27 09:44:31 +08:00
content buffer directly as vectorIndex
This commit is contained in:
@@ -29,22 +29,6 @@ function testLoadVectorIndex() {
|
||||
printf("vector index loaded: length=%d\n", strlen($vIndex));
|
||||
}
|
||||
|
||||
function testLoadVectorIndexFromBuff() {
|
||||
$cBuff = XdbSearcher::loadContentFromFile('../../data/ip2region.xdb');
|
||||
if ($cBuff == null) {
|
||||
printf("failed to load content from file\n");
|
||||
return;
|
||||
}
|
||||
|
||||
$vIndex = XdbSearcher::loadVectorIndexFromBuff($cBuff);
|
||||
if ($vIndex == null) {
|
||||
printf("failed to load content from file\n");
|
||||
return;
|
||||
}
|
||||
|
||||
printf("vector index loaded, length=%d\n", strlen($vIndex));
|
||||
}
|
||||
|
||||
function testLoadContent() {
|
||||
$cBuff = XdbSearcher::loadContentFromFile('../../data/ip2region.xdb');
|
||||
if ($cBuff == null) {
|
||||
@@ -67,12 +51,6 @@ testLoadVectorIndex();
|
||||
printf("done, cost: %0.5f ms\n\n", XdbSearcher::now() - $now);
|
||||
|
||||
|
||||
printf("testing loadVectorIndexFromBuff ... \n");
|
||||
$now = XdbSearcher::now();
|
||||
testLoadVectorIndexFromBuff();
|
||||
printf("done, cost: %0.5f ms\n\n", XdbSearcher::now() - $now);
|
||||
|
||||
|
||||
printf("testing loadContent ... \n");
|
||||
$now = XdbSearcher::now();
|
||||
testLoadContent();
|
||||
|
||||
Reference in New Issue
Block a user