include performance #216
-
Hi, The ns-3 project uses cppyy to generate automated bindings for its c++ interfaces. In practice, it takes a little more than 10s to start on my laptop which is... A bit slow. I looked into what is going on and it appears that cppyy.include takes the crux of this time: cppyy.include(f"ns3/{module}-module.h") I am not entirely surprised by this so I'd like to know if there is a way to speed this up. i.e., would it be possible to cache the result of this include call so that later calls to this function for the same header is faster ? Mathieu |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
I'd like to point out that, intuitively, I suspect that there is something to be done with PCH. I suspect I might just need generate a specific pch from the headers of my project and then, to set the CLING_STANDARD_PCH environment variable. I guess the makepch script from cppyy-backend might be the ticket to generate the pch file... Is this hopeless or am I on the right track ? |
Beta Was this translation helpful? Give feedback.
-
Yes, I'm afraid so. There have been several times that upstream has promised better, but none of the proposed solutions were portable and workable. I've been parroting their promises, but now feel silly making them as I wasn't able to keep them. And now the last they recommended was that I should make it easier for developers to add to the PCH... I haven't done that yet, b/c one of the neat things about modules, would be the ability to have different preprocessor defines and/or compiler flags. This would especially be important for projects that have their header files nicely organized. Anyway, you'll find in the
then set |
Beta Was this translation helpful? Give feedback.
-
The "failed to materialize" symbols is an old one: #175. There has been a partial fix which solves it in some cases (the problematic code was in the standard STL header for Left-over startup time is likely from loading the .so's and the PCH from disk. Especially the PCH is not small. Further, there's some more disk access such as checking whether it up-to-date, searching for As for the change, you mean adding this:
to The |
Beta Was this translation helpful? Give feedback.
Yes, I'm afraid so. There have been several times that upstream has promised better, but none of the proposed solutions were portable and workable. I've been parroting their promises, but now feel silly making them as I wasn't able to keep them. And now the last they recommended was that I should make it easier for developers to add to the PCH... I haven't done that yet, b/c one of the neat things about modules, would be the ability to have different preprocessor defines and/or compiler flags. This would especially be important for projects that have their header files nicely organized.
Anyway, you'll find in the
cppyy_backend
directory in your site-packages location the directoriesetc/d…