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

[PERFORMANCE] [BUG] @EntityId Annotation creates a lot of garbage over time #654

Open
BambooBandit opened this issue May 13, 2022 · 0 comments
Assignees
Labels

Comments

@BambooBandit
Copy link

BambooBandit commented May 13, 2022

I noticed that after adding the @EntityID annotation to this component class

final public class EntityClusterChildCom extends Component
{
    @EntityId public int parentID;
    public boolean top;
}

my game started to generate a lot of garbage, inducing a GC once per minute.
javaw_eJ4kH8oCSl

When I removed the annotation, the GC's dropped down to occuring .13 times per minute
javaw_7AquySKgaN

visualVM says that all the garbage is Integer
javaw_7Od7eScv6K

This behavior seems strange and unintentional, so I thought I would let y'all know.
For reference, this component is created 18949 times, Artemis version 2.3.0.

EDIT
I think i boiled the issue down to this specific line of code.


Is there anything that can be done to remove this typecasting?

@BambooBandit BambooBandit changed the title [BUG] @EntityId Annotation creates a lot of garbage over time [OPTIMIZE] [BUG] @EntityId Annotation creates a lot of garbage over time May 17, 2022
@BambooBandit BambooBandit changed the title [OPTIMIZE] [BUG] @EntityId Annotation creates a lot of garbage over time [PERFORMANCE] [BUG] @EntityId Annotation creates a lot of garbage over time May 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants