Skip to content

Performance improvements #778

Open
Open
@AlmasB

Description

@AlmasB
  • 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 use translate* to do local transforms of views, we would need then to use layout*. No clear advantage over semantic cost
  • 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

Metadata

Metadata

Assignees

Labels

in progressOn-going / being worked on

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions