Performance: Pre-calculate or cache MyDefinitionId.ToString results

Viktor Ferenczi shared this bug 4 months ago
Reported – Awaiting fix

Game version: 1.200.032

Method: MyDefinitionId.ToString

This method is called frequently, it also allocates memory. There are only 1000-1500 distinct definition IDs to format (depending on mods), so these are cacheable without expiration.

Measured 1.9% CPU load just on this formatting method on a multiplayer server, which is too much for basically nothing.

Replies (1)

photo
1

Hello, Viktor!

Thank you for letting us know about this. I have reported this internally.

Kind Regards

Laura, QA Department

Leave a Comment
 
Attach a file