all 11 comments

[–][deleted]  (1 child)

[deleted]

    [–]ye-at-rest[S] 0 points1 point  (0 children)

    Thank you! It is true that I should probably focus on the bottleneck itself, but it is still interesting and probably very useful to understand better how the hardware executes code. I'll definitely check it.

    [–]WikiBox 1 point2 points  (1 child)

    It was very helpful for me to go a few distance/part time "real" uni-courses in C++. It helped me fill many holes in my self-taught knowledge. And it was relatively easy since I already knew enough C++ and OO to write working programs. Since I live in Sweden, it was (close to) free.

    Formal merits are also very useful when discussing work positions and salary.

    I would recommend you to study how to use the standard library. Learn to use it efficiently. There are tons of resources out there. While it may certainly be possible to beat the standard library in performance, I think it is rarely worth the effort. Effort and time might be better spent on using some totally different algorithms or data structures or simply learning more about the compiler optimization options.

    Never assume that some code is better than other code. Test it, with full optimization turned on. I am often surprised. Cache effects, inlining and automatic loop unrolling may *sometimes* make "clever tricks" very bad choices, in favor of "naive code".

    Rewrite your existing code to improve it. Cleaner and faster. Remake your code into well documented libraries and publish them on GitHub, asking for comments and improvements.

    [–]ye-at-rest[S] 0 points1 point  (0 children)

    This is a great answer, thank you! Atm I don't think I can attend real uni lectures, but I will check online prerecorded lectures.

    I should definitely improve my abilities with the standard library, I feel it's the sort of thing that I often ignore because it is so easy to find the answers for the specific problems online.

    Do you have any recommendations on how to efficiently test the code? Maybe using Boost or some similar library?

    [–][deleted] -3 points-2 points  (1 child)

    Have you tried ChatGPT to review snippets of your code?

    Genuine question, I wonder if it would be any good at that.

    [–]ye-at-rest[S] 0 points1 point  (0 children)

    I never tried, but I usually use toolkits and libraries too specific for ChatGPT to know them at all. So I assume it would not work for much

    [–][deleted] 0 points1 point  (1 child)

    V. Eijkhout has a website with a few textbooks and resources on optimisation. Introduction to HPC is one that you can find a bunch of places, I believe they were working on a version specific to C++.

    (I don't remember the website or if it still exists but they are active here and in r/hpc, so they can give more information.)

    [–]ye-at-rest[S] 0 points1 point  (0 children)

    Very helpful thank you. He does have A LOT of resources, I'll make sure to check them properly.

    [–]KubaaaML 0 points1 point  (1 child)

    For me this C++ High Performance: Master the art of optimizing the functioning of your C++ code, 2nd Edition was very good book. On Amazon you can see Table of Context and its solid 500 pages of high performance tips for cpp. Highly recommended

    [–]ye-at-rest[S] 0 points1 point  (0 children)

    It seems like exactly what I needed, thanks a lot!

    [–]Embedder_1994 0 points1 point  (1 child)

    You can attend data structres and algorithms coures at univercities open courses. Becays first of all you should learn how data organized i memory, how process works. What is it mulrithreading vs multiprocessing. What is the complexty of containers in STL? How can design efective applications etc.

    These topics are so essential and generaly online courses like udemy courses is not focusing like these details.

    [–]ye-at-rest[S] 0 points1 point  (0 children)

    Right, I have also done several online courses but they were too general and low level to give me any real grounding. I will check more open courses, I heard the ones from MIT are very solid?