[cfe-dev] Proposed C++ optimization with big speed gains with big objects

_ neuralll at gmail.com
Mon Sep 24 03:37:41 PDT 2012

Hi guys

Hi guys

I wana discuss proposed optimization step(optional switch?) to c++
compiller that would make old and new code in some cases order of
magnitude faster by just pure recompilation.

...After all those attempts to store anything via = without waste I
think that compiller should do "placement new" transparently for us
whenever he encounters = on movable object.  Instead of forcing us to
implement zillion && operators that solve only heap side of problem.
Deciding what kind of "this" object should use is easy since static
analysis deciding what object is movable is already part of new
compillers as part of support for &&.

Skyscrapper city[1000];                         // instead of temp
city[1] = Skyscrapper("Empire State Building"); // compiller should
use &city[1] as this pointer

This would fix heap and static waste = zero alloc/copy.
Why is static mem waste equally if not more important? Majority of
objects are small thus majority of their memory is static.

Benchmark results in article www codeproject

I am kinda lost in clang code but maybe somebody from you guys can
trow togethed this auto placement new a lot faster since you know your
I just can't wait to see the numbers gained from untouched c++ code.
Like running benchmark code from my article but with such compiller

I  love what you guys do. Finally better alternative to gcc monster.
Keep up the great opensource work.

Best Regards Ladislav [Unemployed]

More information about the cfe-dev mailing list