mirror of
https://github.com/lionsoul2014/ip2region.git
synced 2025-12-08 19:25:22 +00:00
update docs
This commit is contained in:
parent
ee1c22f932
commit
a835d15d0a
@ -43,7 +43,7 @@ func main() {
|
|||||||
|
|
||||||
### 缓存 `VetorIndex` 索引
|
### 缓存 `VetorIndex` 索引
|
||||||
|
|
||||||
可以预先加载 vecotorIndex 缓存,然后做成全局变量,每次创建 searcher 的时候使用全局的 vectorIndex,可以减少一次固定的 IO 操作从而加速查询减少系统 io 压力。
|
可以预先加载 vecotorIndex 缓存,然后做成全局变量,每次创建 searcher 的时候使用全局的 vectorIndex,可以减少一次固定的 IO 操作从而加速查询,减少系统 io 压力。
|
||||||
```golang
|
```golang
|
||||||
// 1、从 dbPath 加载 VectorIndex 缓存,把下述 vIndex 变量全局到内存里面。
|
// 1、从 dbPath 加载 VectorIndex 缓存,把下述 vIndex 变量全局到内存里面。
|
||||||
vIndex, err := LoadVectorIndexFromFile(dbPath)
|
vIndex, err := LoadVectorIndexFromFile(dbPath)
|
||||||
|
|||||||
@ -28,7 +28,7 @@ printf("{region: %s, took: %.5f ms}\n", $region, XdbSearcher::now() - $sTime);
|
|||||||
|
|
||||||
### 缓存 `VectorIndex` 索引
|
### 缓存 `VectorIndex` 索引
|
||||||
|
|
||||||
如果你的 php 母环境支持,可以预先加载 vectorIndex 缓存,然后做成全局变量,每次创建 Searcher 的时候使用全局的 vectorIndex,可以减少一次固定的 IO 操作从而加速查询减少 io 压力。
|
如果你的 php 母环境支持,可以预先加载 vectorIndex 缓存,然后做成全局变量,每次创建 Searcher 的时候使用全局的 vectorIndex,可以减少一次固定的 IO 操作从而加速查询,减少 io 压力。
|
||||||
```php
|
```php
|
||||||
// 1、从 dbPath 加载 VectorIndex 缓存,把下述的 vIndex 变量缓存到内存里面。
|
// 1、从 dbPath 加载 VectorIndex 缓存,把下述的 vIndex 变量缓存到内存里面。
|
||||||
$vIndex = XdbSearcher::loadVectorFromFile($dbPath);
|
$vIndex = XdbSearcher::loadVectorFromFile($dbPath);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user