Skip to content

Class caches #94

@Jebbs

Description

@Jebbs

This is already implemented in a couple of places, but I have noticed that there are some cases where performance(mainly regarding the GC) could be better if some things are cached.

Consider this generic getter function:

const(someClass) getSomeClass()
{
     return new someClass(sf_someThing_getsomeClass(sfPtr));
}

This appears quite often. But having a private "someClass" instance, it could be updated instead of returning a new instance each time, greatly reducing the number of new instances that the GC has to keep track of. SFML would return a const ref anyways, so it works basically the same.

Metadata

Metadata

Assignees

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions