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

Duplicate call for _cleanupLookupMap #520

Closed
LMestre14 opened this issue Dec 12, 2023 · 0 comments · Fixed by #532 or #540
Closed

Duplicate call for _cleanupLookupMap #520

LMestre14 opened this issue Dec 12, 2023 · 0 comments · Fixed by #532 or #540

Comments

@LMestre14
Copy link

In our project I've been doing some investigation on where we could improve in terms of performance (both on our implementation and on the framework itself).
After adding some logs to understand the framework's behaviour I saw that when we are reaching the limit of the memory pressure, the garbage collection function is called, and one of the things I noticed is that we have a duplicated call of the function _cleanupLookupMap when we call the gc function in the TextureManager.

src/tree/TextureManager.mjs

    gc() {
        this.freeUnusedTextureSources();
        this._cleanupLookupMap(); // we are calling the function here
    }
    
    freeUnusedTextureSources() {
        let remainingTextureSources = [];
        for (let i = 0, n = this._uploadedTextureSources.length; i < n; i++) {
            let ts = this._uploadedTextureSources[i];
            if (ts.allowCleanup()) {
                this._freeManagedTextureSource(ts);
            } else {
                remainingTextureSources.push(ts);
            }
        }

        this._uploadedTextureSources = remainingTextureSources;

        this._cleanupLookupMap(); // and we already call it here
    }
@uguraslan uguraslan linked a pull request Apr 17, 2024 that will close this issue
@uguraslan uguraslan mentioned this issue Jun 4, 2024
2 tasks
@uguraslan uguraslan linked a pull request Jun 4, 2024 that will close this issue
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant