You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm measuring whole loop of Save&Load + inner validation logic. BUT validation is SAME for all measures.
I'm using nested Data structures (~70 structs).
The data is very specific to gamedev - most of it arrays of data...
it's not an ad for struct pack from yalantinglibs... Even though it's crazy fast, almost memcopy speed - making it forward/backward compatible is a lot of boilerplate
Did you test untagged BEVE? write_beve_untagged will omit the keys and use BEVE arrays. But, it still doesn't do any compression and is intended to be schema-less like JSON. I do want to add a pure struct packing binary format for C++ in Glaze for maximum performance, but I don't expect to get to it soon. Compatibility is important, and certainly a challenge for complex objects. One issue is that struct packing is dependent on not only compilers but optimization levels, and forcing a particular padding requires #pragma statements that cannot be programmatically generated in C++. Hopefully with future reflection enhancements we will be able to generate structs with specific alignments and padding, which would make this much more stable and compatible across compilers and compiler flags.
No, just the regular BEVE. I just did some benchmarks for myself and decided to share, maybe someone will found it helpful.
The main thing that i get from it - compression in my case is making a lot of sense.
Also i forget to write - all measures were at clang 20 + o3 level optimizations.
Struct pack (yalantinglibs) is very interesting!
[+] Much faster compiling time than Glaze.
[+] Much faster runtime (very close to memset)
[+] Automatic reflection as Glaze.
[-] Does not support migration unless field is std::optional.
I did try Apache Fory/Fury too.
I added 1 macro to globdef and compile time cmake + ninja jumped from 1.5 minutes to 4 minutes.
I did not like it =0
So, Glaze is balanced for my use case.
Probably it will be interesting for you to look into struct pack code base.
Yeah, thanks for sharing yalantinglibs's struct pack. I had never looked at this library before. A pure binary approach to copying structures with std::memcpy will provide the best performance, so this is probably what struct pact is doing. It probably isn't truly compatible across compilers, operating systems, and compiler settings, but I'll have to dig in to see if they're making any guarantees.
If you're in a closed system and not saving to load later, then BEVE's untagged approach (serializes structs as arrays without the fields), will get you closer to struct pack performance. You'll also get faster compilation times if you use untagged data, because a lot of the compilation time in Glaze is to optimize the string field hash tables. struct pack isn't doing this because it isn't serializing field names.
And, you're right that compression is probably a good idea, if you're doing any network traffic or care about size.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I'm measuring whole loop of Save&Load + inner validation logic. BUT validation is SAME for all measures.
I'm using nested Data structures (~70 structs).
The data is very specific to gamedev - most of it arrays of data...
it's not an ad for struct pack from yalantinglibs... Even though it's crazy fast, almost memcopy speed - making it forward/backward compatible is a lot of boilerplate
Beta Was this translation helpful? Give feedback.
All reactions