devsisters / shardcake

Sharding and location transparency for Scala
https://devsisters.github.io/shardcake/
Apache License 2.0
382 stars 29 forks source link

Don't rely on Ref.Synchronized for updating entity last use time #97

Closed ghostdogpr closed 8 months ago

ghostdogpr commented 8 months ago

Ref.Synchronized#modifyZIO was called for every message which is not very good for performance considering it uses a semaphone. We moved the last usage time of each entity into a separate Ref, and always use get before modifyZIO so that the happy path is fast.