Minor BitmapFont code architecture issues. Functionally it works just fine :)
- https://github.com/jMonkeyEngine/jmonkeyengine/blob/master/jme3-core/src/main/java/com/jme3/font/BitmapTextPage.java constructor takes in parameter
arrayBased. It never uses it, it is always true. Some of these have been deprecated already in the hierarchy, maybe this one should also be. Now it is just confusing
|
void assemble(Letters quads) { |
is called every frame your text changes. This might be all the time, like with the jME FPS counter. pageQuads is LinkedList, and the said method heavily uses get(int) on it. This is not great, n^2 problem, right?
|
LinkedList<Range> getTags() { |
, same with all the implementations that use this in jME code. Go through the collection using get(int).
LinkedList is probably utilized since its steady add performance and that it doesn't leave potentially big arrays behind (if your text goes from being 2,147,483,647 to 1 character... you'll never recover). At least point 2 could be covered by a for each loop on the LinkedList and having a manual counter for the index as it is needed elsewhere.
Minor BitmapFont code architecture issues. Functionally it works just fine :)
arrayBased. It never uses it, it is always true. Some of these have been deprecated already in the hierarchy, maybe this one should also be. Now it is just confusingjmonkeyengine/jme3-core/src/main/java/com/jme3/font/BitmapTextPage.java
Line 153 in ea715d8
pageQuadsisLinkedList, and the said method heavily usesget(int)on it. This is not great, n^2 problem, right?jmonkeyengine/jme3-core/src/main/java/com/jme3/font/ColorTags.java
Line 68 in ea715d8
get(int).LinkedList is probably utilized since its steady
addperformance and that it doesn't leave potentially big arrays behind (if your text goes from being 2,147,483,647 to 1 character... you'll never recover). At least point 2 could be covered by afor eachloop on theLinkedListand having a manual counter for the index as it is needed elsewhere.