As a Roblox developer, it is currently too hard to write clean and efficient performance-sensitive code when commonly used functionality is only exposed through singleton service methods.
Many core APIs require calling methods on singleton services even when the operation itself does not depend on mutable service state. In high-frequency execution contexts (such as per-frame or per-input updates), this leads to:
- repeated singleton access in hot paths
- limited ability to cache callable logic
- reduced code clarity when object state is not conceptually involved
This makes it harder to write performant systems while keeping code easy to reason about.
If this issue is addressed, it would improve my development experience because it would allow me to structure hot-path logic more clearly and efficiently while maintaining readable, beginner-friendly code.
This would:
- reduce unnecessary overhead in frequently executed loops
- make intent clearer when an API does not rely on object state
- improve maintainability in systems like camera controllers, input handling, and per-frame logic
- support better mental models around when methods vs functions are appropriate
Use Cases
- Camera systems querying input every frame
- Input processing inside
PreRender(mouse delta and such) - Performance-sensitive gameplay or animation systems (Tween creation)
- Large projects where hot-path optimization is important but clarity must be preserved
Additional Context (Non-prescriptive)
Some APIs could conceptually support function-style access in addition to existing methods. This would allow developers to cache callable logic once and reuse it efficiently without passing service singleton as an argument, without removing or breaking current APIs.
This is not a request to remove singleton services, but to provide more flexibility in how frequently used functionality can be accessed.
Why this matters
This request is focused on improving developer ergonomics, clarity, and scalability in performance-sensitive code, rather than large architectural changes. Even small reductions in overhead and ambiguity can have meaningful impact at scale.