Most of the structs are being heap allocated but are static in size, this is slow and using stack allocation is much faster. Convert from heap to stack allocations where possible