ipkn / crow

Crow is very fast and easy to use C++ micro web framework (inspired by Python Flask)
BSD 3-Clause "New" or "Revised" License
7.49k stars 890 forks source link

Large build time. Time to create a dylib? #49

Closed gabrielbiga closed 9 years ago

gabrielbiga commented 9 years ago

How can I reduce the build time of my application with Crow?

Is possible create a dynamic lib of Crow?

I created one precompiled header of crow.h -> .h.gch, but not improved much.

I'm using clang llvm compiler.

Any idea?

ipkn commented 9 years ago

Crow is template-heavy and templates are defined in header files, so making dynamic lib doesn't help improving build time too.

If you really want to reduce compile time, I think the only way currently is separating the main module into two files, one describing routing (thus including crow.h) and another containing logics. By this way the long build time is avoided if the routing is unchanged.

gabrielbiga commented 9 years ago

Cool. I just split my app in 3 parts. The libRoutes(Crow routes), libController(Calls for libRoutes and checks) and libService(Business Logic). To compile libService more fast (Uses Crow JSON), I just precompile the crow.h -> chrow.h.gch. This greatly improved my productivity with Crow.