Up to Main Index Up to Journal for March, 2017 JOURNAL FOR THURSDAY 16TH MARCH, 2017 ______________________________________________________________________________ SUBJECT: A panic fix and reusable message buffers DATE: Thu 16 Mar 22:51:00 GMT 2017 In my last update to the public dev branch — or maybe the one prior? — I accidentally added a minor bug that could cause a client goroutine to panic. Specifically if the player disconnected without actually going into the game. As this happens when the client is logging off anyway I doubt if more than a few people noticed. However the problem is now fixed on the public dev branch. I’ve also made some more changes after my recent foray into examining memory allocations and garbage collection. As a result WolfMUD now has a reusable pool of message buffers. To reduce allocations still further I need to look into reusable pools for the cmd.state and message.Msg types — although these are a lot hard to implement. One curious oddity I discovered, the MOVE command was updated a while ago to script the LOOK command to describe a player’s new location. When the state.script method calls buffers.Silent it generates a number of allocations and garbage through its use of maps. Something else I will have to look into. At the moment map usage in buffers.Silent and message.Allocate account for about 35% of all allocations. Another 20% of allocations is in text.Fold. The allocations are not actually a problem. I’ve been testing with up to 40,000 simulated players running around and everything runs very smoothly on an old, slow, dual core processor running the server and the players. Changes have just been updated to the public dev branch. -- Diddymus Up to Main Index Up to Journal for March, 2017