doc / perf notes
This commit is contained in:
parent
bb072bcf62
commit
042d17ae23
@ -9,6 +9,10 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
/*
|
||||
sqlite extract: https://stackoverflow.com/questions/15448373/how-to-dump-a-file-stored-in-a-sqlite-database-as-a-blob
|
||||
sqlite3 my.db "SELECT writefile('object0.gz', MyBlob) FROM MyTable WHERE id = 1"
|
||||
*/
|
||||
|
||||
const migrateScript = `
|
||||
alter table blocks add mtime integer default 0;
|
||||
|
@ -11,6 +11,10 @@ import (
|
||||
"strings"
|
||||
)
|
||||
|
||||
/*
|
||||
lua vm: https://github.com/yuin/gopher-lua
|
||||
*/
|
||||
|
||||
const (
|
||||
INVENTORY_TERMINATOR = "EndInventory"
|
||||
INVENTORY_END = "EndInventoryList"
|
||||
@ -103,7 +107,7 @@ func parseMetadata(mapblock *MapBlock, data []byte) (int, error) {
|
||||
txt := scanner.Text()
|
||||
offset += len(txt) + 1
|
||||
|
||||
log.WithFields(logrus.Fields{"txt":txt, "position":position}).Info("Parsing inventory")
|
||||
log.WithFields(logrus.Fields{"txt":txt, "position":position}).Trace("Parsing inventory")
|
||||
|
||||
|
||||
if strings.HasPrefix(txt, INVENTORY_START) {
|
||||
|
@ -4,6 +4,12 @@ import (
|
||||
"mapserver/coords"
|
||||
)
|
||||
|
||||
/*
|
||||
sqlite perf: https://stackoverflow.com/questions/1711631/improve-insert-per-second-performance-of-sqlite?rq=1
|
||||
PRAGMA synchronous = OFF
|
||||
PRAGMA journal_mode = MEMORY
|
||||
*/
|
||||
|
||||
type Tile struct {
|
||||
Pos *coords.TileCoords
|
||||
Data []byte
|
||||
|
@ -30,6 +30,9 @@ create table if not exists tiles(
|
||||
zoom int,
|
||||
primary key(x,y,zoom,layerid)
|
||||
);
|
||||
|
||||
-- PRAGMA synchronous = OFF;
|
||||
-- PRAGMA journal_mode = MEMORY;
|
||||
`
|
||||
|
||||
type Sqlite3Accessor struct {
|
||||
|
Loading…
Reference in New Issue
Block a user