Too long generate/update time for oF project with big library
It's not really a bug but would like to share rare case problem. I'm trying to make ofxVtk which use VTK library consists of more than 2000 header files and 114 static/dynamic libs. Since it's huge, it takes 15 min to generate oF project. (on OSX)
Xcode Project setting itself is simple, like following. Header Search path : /libs/vtk/include Other linker flag : /libs/vtk/lib/vtk.a (I combined all .a files into one .a file)
This can be because PG is checking directories recursively in default.
Try to fix this, but couldn't. So I put a memo for future.
I noticed this could only happen on osx.
Xcode pbxproject file tends to be super long because of its format. And it takes long time if we have many files to add. Most of CPU time is spent at this call stack addSrc() -> findOrMakeFolderSet() -> doc.select_single_node(). Like screenshot below.
Result of Time Profiler, test with ofxVtk(not published yet).

- findOrMakeFolderSet() is called recursively
- doc.select_single_node() can be more and more expensive because xml doc becomes longer and longer.
- We are retrieving folder structure, could we cache xml element and reduce calling select_single_node?
- select_single_node is deprecated. (-> use select_node() instead, not critical though )
In fact, current PG does not have problem at all because most of addon is small enough. ofxCv is relatively big and probably many user experienced hitting generate/update button twice (because it freeze several seconds). So we could reduce little waiting time by fixing this issue, resulting less CPU usage -> less electricity -> less co2 emission 😆
I know this is a pretty old issue, but I wonder if in addons_config.mk for any specified /include paths we could avoid recursively listing them? Just add the path to include and skip searching for src files?
This could help with general speed up as mentioned in other places.
I think so. However, some big library has more than 100 include files. In this case, addon_config.mk can be messy and difficult to maintain.
On Mon, Aug 10, 2020, 5:39 AM Theodore Watson [email protected] wrote:
I know this is a pretty old issue but I wonder if in addons_config.mk is paths to/include folders are specified we could avoid recursively listing them? Just add the path to include and skip searching for src files?
This could help with general speed up as mentioned in other places.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/openframeworks/projectGenerator/issues/188#issuecomment-671149115, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABPGADO3L2AMBXVHF5FTALR75TVJANCNFSM4FUXAF5A .