DEV Community 👩‍💻👨‍💻

Valentin Silvestre
Valentin Silvestre

Posted on

What's more important on C++ to have a great performance?

Multi-host, multi-process, multithread?
(My case is a crypto miner for courses that don't use GPU... And I have troubles finding information !)

Top comments (1)

Collapse
 
noah11012 profile image
Noah11012 • Edited on

One of the things about C++ that draws me towards it is that I can write high-level code while not giving up efficiency. This is called the zero-overhead principle. What you don't use, you don't pay for in terms of overhead. C++ also has a large collection of tools that you get for free. Including in this tool set is the The Standard Template Library (STL) which is a rich collection of containers that help you as a programmer write better code. In C, you don't get this. You either have to create a container yourself or find a library that someone else has written that fulfills your needs.

This isn't to say that C++ is completely faultless. One example is templates: templates are there so that you can write generic code. However, if you get a template error(s), they are hard to read and diagnosis.

With all that being said, C++ is my language of choice because of efficiency, the ability to write higher-level code, and expressiveness.

Want to rep DEV and be comfy at the same time?

Check out our classic DEV shirt — available in multiple colors.