Open
Description
- Type, bbox and transform do not need to be updated, yet they are included in the update loop. We should have an overridable flag for them to indicate if need updating.
- translateXProperty() and other properties shouldn't be used in the loop. Raw primitive values should be used instead. Start with a benchmark with lots of entities moving left and right to measure impact.
- Have a flag for components that don't require injecting other components, should speed up component addition
- Keep a separate container for non-updated entities?
- Animations should have their own update inside a scene so they don't interfere with scene update and then we won't need CopyOnWriteArrayList
- ViewComponent does not always need root without the transform. Removing it will improve performance. Perhaps we can add it dynamically (when needed).
-
ViewComponent parent and view roots do not seem to be necessary. We can bind transforms directly to passed nodes themselves. However, this changes current transform semantics. For example, we wouldn't be able to useNo clear advantage over semantic costtranslate*
to do local transforms of views, we would need then to uselayout*
. - EntityBuilder can pre-create entities and keep a pool of entities that are created on a bg thread. Update: after a few quick tests, there does not seem to be a big performance gain (if any), so this is delayed for now.
- Do not produce Optional<> objects in the game world update
- Pre-render text for animations (setCache(true) can help with font based UI)
- Image.map() can be improved by using setPixels()
- Don't use Properties in critical sections and use guarded returns for primitives (obs == null) ? primitive : obs.value