Paul Krill
Editor at Large

Microsoft improves Visual C++ compilation

news
May 6, 20163 mins

An advanced code optimizer is in the works to boost performance and analysis, and cut down code size

fingers keyboard code hands programming
Credit: Thinkstock

Microsoft is developing an advanced code optimizer for its Visual C++ compiler back end to improve performance and code size.

Visual C++ is Microsoft’s variant of the still-popular general-purpose systems programming language founded in 1979. Offered in an unsupported preview release this week, the code optimizer right now is mostly for testing purposes, said Microsoft’s Gratian Lup, a software engineer in the company’s compiler and language platform group.

Microsoft wants to enable more aggressive optimizations, including some that can leverage more compile-time information and modern compiler technologies, Lup said. “The design of some of the older optimization passes made it difficult to implement more advanced transformations and to make improvements at a faster pace,” he said. “As the new framework was intended to be the basis of many future optimization efforts, a core design objective was to make it easier to implement, test and measure new optimizations.”

When it comes to code types, Microsoft is improving both scalar and vector code. “There are many cases where both performance and code size can be improved, sometimes quite substantially. The framework attempts to solve several deficiencies of the old optimizer,” said Lup.

With the current technology, the old expression optimizer has a small set of functions and a limited view of the function; it’s also missing many small optimizations. “The new optimizer takes advantage of the Static Single Assignment form, which allows handling more complex expressions, that potentially span the entire function,” Lup said. “Another advantage of the SSA form is that it makes it possible to write simpler and more efficient algorithms, eliminating the need of using more complicated and slower techniques such as data-flow analysis.”

The project also enables easy development with less potential for mistakes, offering better static analysis of code and emphasizing testing and correctness. “Given the large scope of the project, ensuring and maintaining correctness was a top priority,” said Lup. “This was achieved by using formal verification, testing with randomly-generated programs (fuzz testing) and popular programs and libraries, such as Chrome, Firefox, CoreCLR, and Chakra.”

Lup is advising developers to build and test applications with the new optimizer and report any problems. He pledged there would be more improvements forthcoming; optimizations likely for the next Visual Studio release include improvements for Boolean expressions, merging of similar branches and bit estimator enhancements.

Compiler bits with the new optimizer are accessible by installing the most recent VisualCppTools package using NuGet. The official release of the optimizer is planned for Visual Studio 2015 Update 3. Microsoft would not comment on when this would be available; Update 2 was released in late-March.

Paul Krill

Paul Krill is editor at large at InfoWorld. Paul has been covering computer technology as a news and feature reporter for more than 35 years, including 30 years at InfoWorld. He has specialized in coverage of software development tools and technologies since the 1990s, and he continues to lead InfoWorld’s news coverage of software development platforms including Java and .NET and programming languages including JavaScript, TypeScript, PHP, Python, Ruby, Rust, and Go. Long trusted as a reporter who prioritizes accuracy, integrity, and the best interests of readers, Paul is sought out by technology companies and industry organizations who want to reach InfoWorld’s audience of software developers and other information technology professionals. Paul has won a “Best Technology News Coverage” award from IDG.

More from this author