Scenario: I have an immutable blob of data that consists of a few integers, enums, and a few string values. To store these string values, however, are a few options: BlobString, NativeString, and FixedString
My question is how to determine which to use?
BlobStrings are variable sized and theoretically immutable.
So far when comparing FixedStrings and NativeStrings, at first glance, FixedStrings seem more readable and elaborated upon. Some clarifications here would be nice. If there are no differences then perhaps NativeStrings should be deprecated if no longer needed.
In regards to BlobData, is there a reason not to use FixedStrings besides the size limitations?
So far from my findings, if I want to actually use the string and have burstable code, then FixedStrings are the way to go. This however is not true when wanting to debug said FixedString in a job. The console complains about the Log method not running on main thread.
No. There are a lot of caveats you need to deal with.
For now, the things you CAN do, is check with FixedStrings whether or not a FixedString matches another. However, as expected you are missing most of the string aspects that make them more viable for a web communication aspect, Regex matching, toUpper, Appending (sorta), etc.
So some options of what I have done, is burst do logic on everything that is needed, then with that logic done, in a non busted job or on main thread, handle string communications. It is not the end desired effect, but I still keep the performance components of iterating through all my relevant entities. I’m hoping that strings (while reference types) are semi converted to a value type with burst later on or FixedStrings gain more features.
THE ABSOLUTE needed aspect is for the internal packages to PICK a standard and lean into it, rather than introducing BlobStrings, NativeStrings, FixedStrings, StringStrings, DimensionalVoidStrings, StringsFromTheUnderworld, etc.
FixedStrings are plenty and more clear. They should be added upon.
NativeString are not even documented anymore, FixedString should be used in almost all cases, BlobString is the alternative for when dealing with Blobs