You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, every call of DisplayedString does a marshalling from/to C and copying of the string data.
If you update the Text instance often (e.g. FPS counter), than we're wasting a lot of processing time to convert and allocate memory to get the string data.
It would be less expensive too cache the string data on C# side. As there isn't anything on SFML's side that could lead to a change of the string on its own, it should be fine to update the string data in the set method and have return only return the cached value.
Currently, every call of DisplayedString does a marshalling from/to C and copying of the string data.
If you update the Text instance often (e.g. FPS counter), than we're wasting a lot of processing time to convert and allocate memory to get the string data.
It would be less expensive too cache the
string
data on C# side. As there isn't anything on SFML's side that could lead to a change of the string on its own, it should be fine to update the string data in the set method and have return only return the cached value.Three (?) edge cases to consider:
set
has never been calledText
instance was copiedCPointer
changes somehowSee also forum thread.
The text was updated successfully, but these errors were encountered: