NLeSC / guide

Software Development Guide
https://guide.esciencecenter.nl
Creative Commons Attribution 4.0 International
47 stars 30 forks source link

C++: linters and profilers #30

Open egpbos opened 8 years ago

egpbos commented 8 years ago

Good linters perhaps should be listed under a separate subheader under Style:

These can (and perhaps should, though cpplint can be debated, I guess) be used simultaneously, they are complementary.

Profilers:

Good article explaining pitfalls in using profilers: http://yosefk.com/blog/how-profilers-lie-the-cases-of-gprof-and-kcachegrind.html

LourensVeen commented 8 years ago

Also perf, the Linux kernel profiler is very good, if a bit difficult to use due to not overly abundant documentation. There's a CppCon 2015 presentation on it that is useful, I'll see if I can dig up some links.

I've tried cpplint and cppcheck, but they didn't find any errors in my code. Especially cpplint seems to check mainly for mistakes that you won't make if you use proper C++. Still, could be useful for if you're dealing with crappy existing code.

nielsdrost commented 8 years ago

Especially cpplint seems to check mainly for mistakes that you won't make if you use proper C++

So it does exactly what you would hope for ;-)

Remember: the target of this information is also less experienced programmers.

arnikz commented 7 years ago

Another useful blog on pros/cons of different profilers can be found here. In addition to these tools, there is an interesting one called PAPI using hardware performance counters but I haven't used it (yet).

LourensVeen commented 7 years ago

Sweet, didn't know about PAPI but it looks pretty awesome. I think I'll try that on my forest fragmentation code next time a round tuit comes, I'll let you know how it goes :).

c-martinez commented 4 years ago

@jhidding and @egpbos -- is this issue still relevant? Does the guide contain sufficient detail on these topics (or points to resources on these topics).

egpbos commented 4 years ago

No time to review now, can we try again at the next sprint? :)

c-martinez commented 4 years ago

Sure.