As you can see, this creates a garbage string to act as a key. This method gets called a lot - at least every
time a string is drawn. I propose this ought to be replaced with a similar per-font cache which won't need
to create strings for keys.
Of course, this method only directly affects the simulator. I haven't checked the corresponding code
for ios and android.
While sleuthing performance issues, I came across this method in JavaCEFSEPort
private int canDisplayUpTo(java.awt.Font fnt, String str) { String key = fnt.getName() + ":" + str; if (canDisplayUpToCache.containsKey(key)) { return canDisplayUpToCache.get(key); } ...
As you can see, this creates a garbage string to act as a key. This method gets called a lot - at least every time a string is drawn. I propose this ought to be replaced with a similar per-font cache which won't need to create strings for keys.
Of course, this method only directly affects the simulator. I haven't checked the corresponding code for ios and android.