Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
@TempestasLudi it's too basic to post anywhere right now, so I'm keeping it local. If you're interested, this talk was the inspiration:
https://youtu.be/IiVl5oSU5B8
A lot of fast C++ libraries (like the linear algebra library Eigen) use expression templates. Also, the Boost Spirit parser library uses it to make writing grammars a breeze.
Have a look at Boost Proto if you want to make your own without too much effort.
You may also want to have a look at template metaprogramming first. -
Unbuffered algorithms 4 win.
BTW did you hear about MATPACK?
I heard that it is The fastest maths lib that you can get. (its cpu optymalised 😮, and they used heavy assembler optymalisation) -
@Gregozor2121 hmm, I'll have to disagree, sometimes buffering can really make your program go faster overall, because it allows you to work with and reason about larger chunks. But yes, lots of tiny buffers are terrible.
I haven't, I'll have a look, thanks. Eigen and the standard library generally cover my performance needs, and there's always specific libraries like Intel MKL, etc. for extreme cases. Fast math was almost never a problem for me, though.
Also, I believe the word you're looking for is "optimized" (or optimised). And most of these heavy number crunching libraries have CPU specific optimizations. -
I know the difference about buffered and unbuffered appilactions.
I helped my friend with his project that begged for unbuffered approach.
In my case my unbuffered algorithm is better because if you process data line by line you wont use any ram at all. Buffered application is slower because it neeeds to load few gb of data into ram... and loading, saving times were terrible in that case.
Unbuffered app spreads saving, loading operations thats why it dosent saturate hdd io.
I agree with you but in my case unbuffered is superior :) -
Hmm, I don't know what your use case is but that usually leads to absolutely terrible utilisation of resources.
Sure, loading all the data in the memory is a bad idea, but so is processing it line by line. Load and process data in the biggest chunksize your system can handle (if that's one line, cool).
Data streaming and reactive programming can really help here.
Related Rants
-
xjose97x19Just saw a variable in C named like this: long time_ago; //in a galaxy far away I laughed no stop.
-
Unskipp24So this happened last night... Gf: my favorite bra is not fitting me anymore Me: get a new one ? Gf: but it ...
-
sam966911Hats off to this lady .... I would have just flipped the machine
!rant
The more I learn about advanced C++ the more I love this language. C++'s template system is so insanely cool!
Just made a proof of concept expression templates based linear algebra library for my own projects. It was actually a lot of fun to make, and seeing it spit out optimized, loop-fused code with no temporary variables...magic.
Long live C++.
rant
c++
expression templates