3 ms·
Yeah, I think of avoiding the call from main as a devex consideration rather than a performance one, since either way the initialization code runs once at proce
by ameliaquining 4mo ago
Yeah, I think of avoiding the call from main as a devex consideration rather than a performance one, since either way the initialization code runs once at process startup.
- Animats 4mo agoI'm trying to think of any useful crate that really uses this. "Tracy", the profiling crate, used to self-start on loading, but that was changed to require a call to get it going.
- rcxdude 4mo agoBut it can cause problems when there's multiple crates trying to do it. If the call is explicit, the application developer can sequence the calls appropriately (or at least deterministically), as opposed to having the order determined by details of the implementation (something that was learned from the C++ 'static initialization order fiasco')