So, some context. SIMDString is an extremely fast string library specifically created for gamedev by Roblox Research. It is reportedly 10-100x faster than std::string and is 100% compatible with it. It is also faster than std::string_view, and can be natively converted to it where needed.
I don't have specific benchmarks but after implementing it in my mod, SA GPS Redux, there's a noticeable improvement in frametimes and frame smoothness. Using it instead of std::string also reduced the final size of the built asi by around 1/4 or so.
Now, due to windows.h redefining std::min and std::max as macros I had to undefine them but the code is fine.
~~At the moment it doesn't build for me though, I'm getting a weird linking error that I've literally never seen anywhere else and googling literally any part of it yields no actual results:
Details Error LNK2001 unresolved external symbol "bool __cdecl inConstSegment(char const *)"~~
This might be related to the undefines though, so it should be relatively easy to fork SIMDString and make it compatible with windows.h if necessary.
Ideally, I think it would be practical to implement this into the hooking and ini libraries as well instead of std::string. I personally have already created a mINI fork utilizing it.
Anyway, I don't expect this to be merged. Again this is just a proof of concept to raise awareness about this cool thing!
P.S. I didn't touch nearly as many lines as the diff claims, it's mostly just automatic formatting changes by VS.
So, some context. SIMDString is an extremely fast string library specifically created for gamedev by Roblox Research. It is reportedly 10-100x faster than
std::string
and is 100% compatible with it. It is also faster thanstd::string_view
, and can be natively converted to it where needed.I don't have specific benchmarks but after implementing it in my mod, SA GPS Redux, there's a noticeable improvement in frametimes and frame smoothness. Using it instead of std::string also reduced the final size of the built asi by around 1/4 or so.
Now, due to
windows.h
redefiningstd::min
andstd::max
as macros I had to undefine them but the code is fine. ~~At the moment it doesn't build for me though, I'm getting a weird linking error that I've literally never seen anywhere else and googling literally any part of it yields no actual results:Details Error LNK2001 unresolved external symbol "bool __cdecl inConstSegment(char const *)"
~~This might be related to the undefines though, so it should be relatively easy to fork SIMDString and make it compatible withwindows.h
if necessary.Ideally, I think it would be practical to implement this into the hooking and ini libraries as well instead of std::string. I personally have already created a mINI fork utilizing it.
Anyway, I don't expect this to be merged. Again this is just a proof of concept to raise awareness about this cool thing!
P.S. I didn't touch nearly as many lines as the diff claims, it's mostly just automatic formatting changes by VS.