Konash / arabic-support-unity

This plugin allows you to use accurate and correct Arabic text in your game or 3D application. Supports Tashkeel and Hindu numbers. Supports C# and JavaScript. Supports 4 Persian Characters.
MIT License
220 stars 64 forks source link

Reduce number of memory allocations #50

Closed Saarg closed 1 year ago

Saarg commented 1 year ago

Hi, on the project I'm working at the moment your script is used to handle arabic text and I noticed it could be improved a bit to reduce GC allocs and speed up the execution. Unfortunately I don't read or speak arabic so while my changes still pass the tests included in the repo you may want to double check.

In my project on low end mobile phones and with these changes (and a few more in our code) we got from 700ms to 125ms and from 427KB of GC allocated to 126KB.