garrynewman/garrysmod — pull request #473 by Dessix (2013-07-01 21:25:02+00:00)
Title: Variadic Hook Returns - Revised for Performance

I have created one last attempt at variadic hook returns, revising them for performance at the cost of readability. I am not entirely sure that this method is faster (The cost of varargs should be significantly less than the creation of a table since the removal of the "arg" table brought in by LuaJit), but it does attempt to keep varargs on the stack rather than in a table on hooks which don't return anything, preventing creation of a table on such hooks.

P.S. Sorry for the multitude of pull requests on this subject, this last version is my final attempt at implementing this feature