|
|
Subscribe / Log in / New account

Initialization

Initialization

Posted Mar 11, 2022 0:29 UTC (Fri) by tialaramex (subscriber, #21167)
In reply to: Toward a better list iterator for the kernel by NYKevin
Parent article: Toward a better list iterator for the kernel

There was a CPP Con talk some years back about exactly this work by Microsoft. Basically let us teach the compiler to zero initialize everything, then run tests to see how awful the results are, teach the compiler to optimize away these dead stores and/or perform zero initialization that it more easily recognises as dead stores, iterate. IIRC The first few loops are very, very bad, nothing you could possibly ship, but as they learn what they're doing by the end they can more or less do this over the bulk of the system and get the same performance as before but with more confidence there aren't scary initialisation bugs. Obviously they were in C++ and their own C++ compiler, where Linux would want C and GCC, but it's not so different otherwise. If people can't find it themselves I can search Youtube maybe.


to post comments

Initialization

Posted Mar 11, 2022 1:25 UTC (Fri) by bartoc (guest, #124262) [Link] (1 responses)

MSVC's behavior is a bit of a problem because there's no great opt-out, and it doesn't really do the optimizations in debug mode, meaning if you ever use stack arrays it's really easy to have awful debug mode performance. It's one of the bigger "MSVC debug perf sucks" things around (along with like, not having a way to write inline functions that are always inlined, even in debug).

If there was an opt-out, and if MSVC had a saner "debug mode" (really these optimizations should be turned on in debug mode imo) then it would be a great behavior.

Initialization

Posted Mar 11, 2022 1:29 UTC (Fri) by bartoc (guest, #124262) [Link]

Note, I'm talking more about /RTCs rather than "InitAll", which might work better.


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds