Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C++: linters and profilers #30

Open
egpbos opened this issue Jun 27, 2016 · 7 comments
Open

C++: linters and profilers #30

egpbos opened this issue Jun 27, 2016 · 7 comments

Comments

@egpbos
Copy link
Member

egpbos commented Jun 27, 2016

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

  • cpplint (is mentioned already): checks (mostly?) for style, following the Google style guide.
  • cppcheck: does static analysis, checks for bugs.

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

Profilers:

  • cachegrind
  • gprof

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

@LourensVeen
Copy link
Member

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
Copy link
Member

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
Copy link
Collaborator

arnikz commented Jun 20, 2017

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
Copy link
Member

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
Copy link
Member

@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
Copy link
Member Author

egpbos commented Sep 10, 2020

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

@c-martinez
Copy link
Member

Sure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants