Closed andrewgazelka closed 1 week ago
Step 1 of this endeavor, IMO, is to delete as much unsafe code as possible without tanking benchmarks. Literally delete it all if it still performs well afterward. Undefined behavior is not worth the trouble. How many usages of unsafe in this codebase are motivated by benchmark data, and how many of them are just "well, it ought to be faster this way, and faster is better"?
Step 1 of this endeavor, IMO, is to delete as much unsafe code as possible without tanking benchmarks. Literally delete it all if it still performs well afterward. Undefined behavior is not worth the trouble. How many usages of unsafe in this codebase are motivated by benchmark data, and how many of them are just "well, it ought to be faster this way, and faster is better"?
Yea, I have to go in a bench/profiling -> delete loop for this.
fortunately, there isn't a ton of explicit unsafe code
sadly we are using flecs
which can be subtly unsafe even when we arent explicitly using unsafe
(although not very often)
biggest place where unsafe code is nice is probably for the BVH stuff, but that isn't being used a ton right now and can be tested/fuzzed pretty thoroughly.
closing as low prio for now
go over unsafe code and double check it is all valid/makes sense. we do not want the server to suddenly crash during the 10k player event.