A thread-safe Lua library for Roblox that simplifies garbage collection by managing object cleanup through a unified interface.
Janitor is a Lua library for Roblox that simplifies garbage collection by providing a centralized interface to manage and clean up objects like instances, events, and tweens. It helps prevent memory leaks and reduces cleanup code complexity in Roblox games.
Roblox developers and scripters who need reliable, organized cleanup of game objects and resources to maintain performance and avoid memory issues.
Developers choose Janitor for its thread-safe design, flexible cleanup methods, and performance advantages over alternatives like Maid, making object lifecycle management less error-prone.
Janitor library.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Provides a single `:Add()` method to manage diverse objects like instances, events, and tweens, reducing cognitive overhead as highlighted in the README's key features.
Allows specifying custom cleanup functions, such as calling `:Stop` on tweens, demonstrated in the JanitorPromise library reference in the README.
Links Janitor to Roblox Instances, automatically cleaning up all managed objects when the instance is destroyed, a feature explicitly mentioned in the README's benefits.
Benchmarks show it runs faster than Maid and comparably to Dumpster, with evidence from boatbomber's benchmark plugin and a graph in the README.
This version avoids global state, making it safer for multi-threaded use in Roblox game development, as stated in the README's description of the thread-safe branch.
Relies on original documentation from an unmaintained version, which may not fully cover the thread-safe branch, leading to potential confusion for new users.
Compared to simpler libraries like Maid, the API can be more verbose, e.g., `Janitor:Add(X, nil, 'A')` vs Maid's direct assignment, as noted in the README's comparisons.
Designed specifically for Roblox objects, so it cannot be used in other Lua environments, limiting its portability and usefulness outside Roblox development.