Benchmarks are meant to compare actual processing time of pieces of code - putting processing in new coroutines or threads during the benchmark beats the purpose of a benchmark.
Putting code into coroutines can make throttling easier, but it doesn’t prevent overloading the processor since normally Lua runs on a single processor core and simply resumes a coroutine immediately after a previous one yields.
I use the IEEE 754 NaN value encoding method to serialize custom binary data directly within the fraction bits of a NaN value. This allows me to store small pieces of binary information in a compact floating-point format, which I like since it is ideal for embedding metadata, flags, or other small data that doesn’t need a full object structure. I’ve been focusing on making this as fast as possible, so I also use buffers to handle raw binary data, which lets me manipulate the bytes without the annoying overhead directly.
Pretty good method since it lets me serialize data efficiently, using buffers for fast reading and writing of the manipulated NaN values. And by avoiding the more complex serialization formats, I can quickly encode and decode binary data stored in the NaN’s fraction field.
The IEEE 754 standard, which is a method for floating point numbers in binary, is just naturally faster than more complicated serialization methods tbh. It breaks the number into three parts the sign bit, the exponent, and the fraction. This was made to be optimized for the hardware level, particularly when using hardware supported operations for floating point values but thats beyond Roblox.