Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slow performance on millions of objects during VirtualUniverse.removeAllLocales or release resource. #32

Open
morris821028 opened this issue Dec 8, 2024 · 0 comments

Comments

@morris821028
Copy link

morris821028 commented Dec 8, 2024

Scenario

  1. Load millions of TransformGroup objects into specific Locales in two-level hierarchy.
- Locale
    -  TransformGroupRetained X
        -  GroupRetained
           -   TransformGroupRetained A... (millions of object in this level)
           -   TransformGroupRetained B... (millions of object in this level)
  1. Call VirtualUniverse.removeAllLocales. We will find the $O(N^2)$ time during release resource.

Reason

TransformGroupRetained.removeNodeData will call parent TransformGroupRetained X childTransformLinks.remove step by step.

Possible Solution

Predict the live state from parent class NodeRetained.

void clearLive(SetLiveState s) {

void clearLive(SetLiveState s) {

// in TransformGroupRetained.
    @Override
    void clearLive(SetLiveState s) {

        Targets[] savedTransformTargets = null;

        savedTransformTargets = s.transformTargets;
	// no need to gather targets from tg in clear live
        s.transformTargets = null;
        
        if (refCount - s.refCount <= 0) { // predict live to prevent children update.
            childTransformLinks.clear();
        }

	super.clearLive(s);
        ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant