[cfe-dev] Proposing optional C++ Optimization of = operator with huge speed boost on large objects

neurall 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
needed).

I got this optimization idea during writing of kinda lame article about &&
rvalue references 
http://www.codeproject.com/Articles/453022/The-new-Cplusplus-11-rvalue-reference-and-why-you#fix

In Short:

"...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.

Code Example:

Skyscrapper city[1000];                         // instead of temp
city[1] = Skyscrapper("Empire State Building"); // compiller should
use &city[1] 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
com/Articles/453022/The-new-Cplusplus-11-rvalue-reference-and-why-you

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
code.
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
changes.

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]
neuralll[@]gmail[.]com



--
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 mailing list