[0.2] BufferUtil - Fast and cheap serialization library

πŸ’» BufferUtil

Fast and cheap serialization library.

Github | Creator Store

:page_facing_up: About

BufferUtil created due to the emergence of new methods for serializing various types from CFrame to Float. BufferUtil is currently in alpha and may be updated continuously. I focus on speed and cheapness of the serializing/deserializing methods, and every method I checked for speed.

:star: Features

  • Faster and improved CFrame
  • Fast Vector3

:bar_chart: Benchmarks

3 tests were performed with CFrame and Vector3 serialization checks in Scriptbench. Benchmark code you can see in BufferUtil github.



:clipboard: Roadmap

  • Make float 16 bit (2 bytes)
  • Add other roblox data types

:pushpin: Conclusion

I will be very happy and grateful to everyone who will help with developing (even with 1 commit), because I am actively developing it from scratch and want it to be faster and cheaper than everyone else. I’d also be interested to know if this is worth considering, as there are a ton of serialization libraries out there.

4 Likes

For CFrame’s i recommend quantize angles to u16. it will give same accuracy but you save 2 bytes per angle!

i use this formula:

local a = value % TAU
if a > PI then a = a - TAU end

local quantized = math.floor((a + PI) / TAU * 65535 + 0.5) -- 65535 = MAX_U16, and +0.5 is a rounding

and for converting u16 to f32 i use this

local result = (quantized / 0xFFFF) * TAU - PI
2 Likes

Thanks for the advice! Can you create a pull request on github with this?

i created pull request here a link:

Thanks, I left a comment under your pull request.