RawLib
GitHub: here
Warning:
This module will most likely be patched as it is technically unintentional
Also this module is based upon this post
This is a module that collects most of the common Roblox metamethods in order to directly call them. You ask why? For optimization!
You might be thinking it provides a huge performance boost, but no. It fits between the ranges of microoptimizations as it is only intended for situations where the classic data type calls are the
performance bottleneck.
Example usage:
local RawLib = require("./RawLib")
local instance_index = RawLib.instance_index -- equivalent to local foo = script.Name (the dot operator)
local instance_newIndex = RawLib.instance_newIndex -- equivalent to script.Name = foo
local cframe_index = RawLib.cframe_index
print(instance_index(script,"Name")) -- prints the name of your script
instance_newIndex(script,"Name","asdas") -- sets the name of your script to asdas
local part = workspace:FindFirstChildOfClass("Part") or Instance.new("Part")
print(cframe_index(instance_index(part,"CFrame"),"LookVector")) -- prints 0,0,1 or the look vector of the found part
As you see, it makes code unreadable for the most part. So it is crucial to remember that you should only use it in cases where the standard operators create a massive bottleneck on your performance.
This module also includes *,-,/, and other such operators for their respective data types. Those work even better and provide even better optimization
Sounds fake?:
You can check this post to see the benchmarks of such raw calls. They only include raw instance indexing, but even that one is faster than standard dot indexing
Important info:
Please read this page to understand where to use the raw indexing and wherenot. Also, this does not work for methods. Please call them using the : as normal.