7 ms·
Yes, but then extensions can already release the GIL and use the simple and industrial strength std::thread, which is orders of magnitude easier to debug.
by andmkl 2y ago
Yes, but then extensions can already release the GIL and use the simple and industrial strength std::thread, which is orders of magnitude easier to debug.
- woodruffw 2y agoConcurrent operations exist at all levels of the software stack. Just because native extensions might want to release the GIL and use OS threads doesn't mean pure Python can't also want (or need) that. (And as a side note: I have never, in around a decade of writing C++, heard std::thread described as "easy to debug.")
- ipsod 2y agoReally? Cool. I expected that dropping down to C/C++ would be a large jump in difficulty and quantity of code, but I've found it isn't, and the dev experience isn't entirely worse, as, for example, in-editor code-intelligence is rock solid and very fast in every corner of my code and the libraries I'm using. If anyone could benefit from speeding up some Python code, I'd highly recommend installing cppyy and giving it a try.
- woodson 2y agoThanks, I haven’t come across cppyy! But I’ve worked with pybind11, which works well, too.
- ipsod 2y agoSure! I tried pybind11, and some other things. cppyy was the first I tried that didn't give me any trouble. I've been using it pretty heavily for about a year, and still no trouble.
- nly 2y agoLast I checked cppyy didn't build any code with optimisations enabled (same as cling)
- ipsod 2y agoIt seems like you might be able to enable some optimizations with EXTRA_CLING_ARGS. Since it's based on cling, it's probably subject to whatever limitations cling has. To be honest, I don't know much about the speed, as my use-case isn't speeding up slow code.