mirror of
https://github.com/Mezeporta/Erupe.git
synced 2026-03-21 23:22:34 +01:00
perf(channelserver): move UserBinary and minidata to memory-only
UserBinary type1-5 and EnhancedMinidata are transient session state resent by the client on every login. Persisting them to the DB on every set was unnecessary I/O. Both are now served exclusively from server-scoped in-memory maps (userBinaryParts, minidataParts). Includes a schema migration to drop the now-unused type2/type3 columns from user_binary and minidata column from characters. Ref #158
This commit is contained in:
@@ -60,6 +60,10 @@ type Server struct {
|
||||
userBinaryPartsLock sync.RWMutex
|
||||
userBinaryParts map[userBinaryPartID][]byte
|
||||
|
||||
// EnhancedMinidata
|
||||
minidataLock sync.RWMutex
|
||||
minidataParts map[uint32][]byte
|
||||
|
||||
// Semaphore
|
||||
semaphoreLock sync.RWMutex
|
||||
semaphore map[string]*Semaphore
|
||||
@@ -89,6 +93,7 @@ func NewServer(config *Config) *Server {
|
||||
sessions: make(map[net.Conn]*Session),
|
||||
stages: make(map[string]*Stage),
|
||||
userBinaryParts: make(map[userBinaryPartID][]byte),
|
||||
minidataParts: make(map[uint32][]byte),
|
||||
semaphore: make(map[string]*Semaphore),
|
||||
semaphoreIndex: 7,
|
||||
discordBot: config.DiscordBot,
|
||||
|
||||
Reference in New Issue
Block a user