Breaking News

Home / PC & Laptops / Microsoft Highlights Visual C++ Progress on C++17/20

Microsoft Highlights Visual C++ Progress on C++17/20

Even though Visual C++ is very popular on Windows, the compiler has received some criticism about things like its standards conformance and code generation. It has been getting better, though, especially since the Visual C++ 2015 lifecycle. Microsoft has kept up with C++17 and C++20 standards conformance, and their compiler team adds new optimizations with each minor release. They are even competitive with previews of unreleased features, such as C++20 modules.

Microsoft has published a blog post highlighting some key additions over the last year. One interesting change in Visual C++ 2019 16.6 is the pair of attributes, [[likely]] and [[unlikely]]. For a while, C++ compilers have provided vendor-specific hints to guide CPU branch prediction. The idea is to avoid the CPU accidentally traversing down an edge-case and having to flush its pipeline, which costs around 15 to 20 cycles on AMD Zen and Intel -Lake architectures. For context, this is around 10x cheaper than a main RAM read, and it is only 1/200,000,000th of a second at 4 GHz, but it can be a problem if you’re pushing a lot of data down that function. These attributes have been added to C++20, and Microsoft beat Clang to the punch (although GCC added it last year).

Microsoft has also open-sourced their C++ standard library at CppCon 2019. Their GitHub page highlights the improvements over there.

Source link

About admin

Check Also

HP Omen Frequency Wireless Headset With 7.1 Surround Sound, Up to 30-Hour Battery Announced

HP Omen Frequency wireless headset, along with Omen Vector wireless mouse and Omen Spacer wireless ...

Leave a Reply

Your email address will not be published. Required fields are marked *