- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 1.2k
Closed
Labels
defectSomething that is supposed to work, but doesn't. Less severe than a "bug"Something that is supposed to work, but doesn't. Less severe than a "bug"
Milestone
Description
If your code frequently adds new Light-objects to the scene and removes old ones, DefaultLightFilter will keep the old Light-objects alive by storing them in its internal HashSet.
The internal HashSet will never be cleared, therefore they are kept alive forever.
After a few hours of running a benchmark on my game, I realized that the HashSet has grown to ~18MiB size with ~190.000 entries.
Changing the camera (which may happen multiple times per frame) can get very expensive in this scenario.
I would suggest clearing the HashSet each frame.
neph1
Metadata
Metadata
Assignees
Labels
defectSomething that is supposed to work, but doesn't. Less severe than a "bug"Something that is supposed to work, but doesn't. Less severe than a "bug"