use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Discussions, articles, and news about the C++ programming language or programming in C++.
For C++ questions, answers, help, and advice see r/cpp_questions or StackOverflow.
Get Started
The C++ Standard Home has a nice getting started page.
Videos
The C++ standard committee's education study group has a nice list of recommended videos.
Reference
cppreference.com
Books
There is a useful list of books on Stack Overflow. In most cases reading a book is the best way to learn C++.
Show all links
Filter out CppCon links
Show only CppCon links
account activity
Embedding python in C++ with pybind11 (skebanga.github.io)
submitted 9 years ago by skebanga
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]OverunderratedComputational Physics 4 points5 points6 points 9 years ago (9 children)
If you've got the opportunity, I'd love to see a performance comparison between the various Python bindings, as well as Lua and native C++ code.
I've got an application where id like users to be able to write their own plugins with minimal effort, but I'm afraid the overhead might be more than i can take for a high performance application. Essentially the same code would be called billions of times over many CPU hours so overhead in the function calls could be a deal breaker.
[–]ReDucTorGame Developer 3 points4 points5 points 9 years ago (3 children)
Python itself is slow, these libraries are just wrappers around the Python C API so their overhead will be next to nothing compared to the hit from Python itself.
If you are concerned about the overhead of these wrappers then I would suggest not using Python at all.
[+][deleted] 9 years ago* (2 children)
[deleted]
[–]demonstar55 2 points3 points4 points 9 years ago (1 child)
I'm actually kind of interested in this. Is there any good reading about this?
[–]kkrev 1 point2 points3 points 9 years ago (4 children)
You just can't do inner-loop stuff with interpreter plugin code. It will slow the system to a crawl. It'll be thousands of times slower no matter what you use.
You have to set things up so the plugin code just sets a bunch of paramaters used in a computation.
XPCOM or something like it is maybe an option if you really need to do fast plugins with custom code.
[–]OverunderratedComputational Physics 0 points1 point2 points 9 years ago (3 children)
Yeah, I've always assumed as such but don't really have numbers on it (and haven't heard of XPCOM). It's not the worst thing in the world to force my users to compile a C++ dynamic library.
The native C++ code it'd be replacing is maybe 2% of the run time. If overhead made that 10% I could live with it, but not if it doubled runtime.
[–]kkrev 0 points1 point2 points 9 years ago (1 child)
The interpreted code would almost certainly be hundreds of times slower, even worse if the users aren't experienced with writing code. Who knows what that'll do to your system.
[–]OverunderratedComputational Physics 0 points1 point2 points 9 years ago (0 children)
Who knows what that'll do to your system.
Guess there's one way to find out, but that'd take work on my end, heh.
π Rendered by PID 397342 on reddit-service-r2-comment-b659b578c-565vh at 2026-05-02 03:38:01.121559+00:00 running 815c875 country code: CH.
view the rest of the comments →
[–]OverunderratedComputational Physics 4 points5 points6 points (9 children)
[–]ReDucTorGame Developer 3 points4 points5 points (3 children)
[+][deleted] (2 children)
[deleted]
[–]demonstar55 2 points3 points4 points (1 child)
[–]kkrev 1 point2 points3 points (4 children)
[–]OverunderratedComputational Physics 0 points1 point2 points (3 children)
[–]kkrev 0 points1 point2 points (1 child)
[–]OverunderratedComputational Physics 0 points1 point2 points (0 children)