GCC 4.10 will help C++ libs' size

Discussion about everything. New games, 3d math, development tips...
Post Reply
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

GCC 4.10 will help C++ libs' size

Post by hendu »

http://arxiv.org/pdf/1403.6997

C++ templates can cause some exceedingly inefficient code, with much duplication. Refcounting is one such example: you have foo::grab, bar::grab, and so on for every single refcounted type, compiled as a separate function. The code of each function is the same - increment an int. Likewise, many constructors and destructors are identical in code.

This is some new work, should be in gcc 4.10, that can remove duplicate functions. It was tested on Firefox: 5.41% smaller binary.
Post Reply