I decided to investigate a bit if the Camera Script could use a bit of optimization by storing things like local CFramenew = CFrame.new to prevent the constant index calls, and… well…
Before micro-optimizations:
After:
Before, I had a constant 2.344% (edit: ok, now it is fluctuating between 2.1 and 3.6 when I changed the angle), but after it fluctuates between 0.3% and 1.2% (has gone up to 1.6%-2% though). Both were done in the same Play Solo session, and bizarrely enough had the same song in the background (which isn’t a factor).
Anyway, my point is that the Camera scripts could use micro-optimizations like this, since 2.344% is a probably bigger if you don’t have an i7 4700MQ (Quad core @ 3.25 GHz with Turbo Boost).
I only modified the RootCamera and ClassicCamera scripts by the way.
RootCamera:
local min,max,rad,atan2,abs = math.min,math.max,math.rad,math.atan2,math.abs
local CFramenew = CFrame.new
Classic Camera:
local atan2,rad,min,max,sin,asin,floor,abs = math.atan2,math.rad,math.min,math.max,math.sin,math.asin,math.floor,math.abs
local pi = math.pi
local Vector2new,Vector3new = Vector2.new,Vector3.new
local CFramenew,CFrameAngles = CFrame.new,CFrame.Angles
Yes, this does make the code harder to read, but I think the performance improvement outweighs that.