[cfe-dev] Proposing optional C++ Optimization of = operator with huge speed boost on large objects
neuralll at gmail.com
Mon Sep 24 06:49:48 PDT 2012
I wana propose optimization step(at first just as optional switch?) to c++
compiller that would make old and new code in some cases order of
magnitude faster by just pure recompilation(no code change or new operators
I got this optimization idea during writing of kinda lame article about &&
"...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.
Skyscrapper city; // instead of temp
city = Skyscrapper("Empire State Building"); // compiller should
use &city as this pointer
Deciding what kind of "this" object should use is easy since static
analysis deciding what object is movable/temp is already part of new
compillers as part of support for &&.
This would fix heap and static waste = zero alloc/copy.
Why is maybe 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 good open source c++ compiller. Too bad
openmp is missing since I use it a lot.
Keep up the fantastic work.
Best Regards Ladislav Nevery [Unemployed]
View this message in context: http://clang-developers.42468.n3.nabble.com/Proposing-optional-C-Optimization-of-operator-with-huge-speed-boost-on-large-objects-tp4026874.html
Sent from the Clang Developers mailing list archive at Nabble.com.
More information about the cfe-dev