`return .` currently compiles to a `GETVAR dot`, then `RET`.
`return` currently compiles to `END`, with the dot being implicitly carried over.
This leads to `return .` being 3% slower than `return`, which can make a difference in hot procs.
On tgstation, we are currently beginning to use `return .` in some places where we would otherwise just use `return`, as it makes it more obvious a value is being returned (whereas just `return` on its own is not obvious), makes it easy to jump to that value with editor tools, while also preserving runtime resilience (because `.` is returned when a proc runtimes/yields).
It would be nice if our very basic style choice did not result in unoptimized compilations.
ID:2787448
May 3 2022, 7:53 pm
|
|||||||
Resolved
| |||||||