Peerplays Fast Compile Library
Find a file
Daniel Larimer 3d56a96d4e major updates to stream,reflect,value,and json
- removed polymorphic reflection, made static_reflect default because
  there are cases such as deserializing an array that you need more
  information than the runtime reflection can provide such as the
  ability to resize arrays and know the array content type.

- refactored iostream, sstream, fstream to be much simpler, fewer
  indirections, and fixed getline.

- json parsing works using code from mace.
- value is reimplemented based upon mace::rpc::value and no longer uses
  the runtime reflection that was removed.

- moved the typename utility to its own header
2012-10-21 02:28:59 -04:00
CMakeModules adding missing build files 2012-09-07 22:54:43 -04:00
include major updates to stream,reflect,value,and json 2012-10-21 02:28:59 -04:00
src major updates to stream,reflect,value,and json 2012-10-21 02:28:59 -04:00
CMakeCache.txt fixed scheduler deleting retainable 2012-09-09 19:44:49 -04:00
CMakeLists.txt major updates to stream,reflect,value,and json 2012-10-21 02:28:59 -04:00
README.md Initial checkin of FC code. 2012-09-07 22:50:37 -04:00
unit_tests adding unit tests, updating boost version required 2012-09-07 22:56:46 -04:00

Fast Compiliing C++ Library


In my prior attempts at developing MACE what I discovered is that compile times would explode to unreasonable levels that hinder the rate of development more than what can be saved by reduced typing. So I began a quest to get C++ to compile as quickly as Java or C# and the result is this library.

One of the major drawbacks to templates is that they place everything in header and must be compiled with every run and generate a lot of object code. With Link Time Optimization, the benefit of inline methods mostly disapears, leaving only static vs dynamic polymorphism.

For the vast majority of applications, a virtual method call is not the bottleneck and the increased compile times costs more than is otherwise justified; therefore, the Fast Compiling C++ library opts for virtual interfaces to handle reflection instead of template interfaces. One could argue that both types of reflection could be useful.

Another source of slowness was the standard template library itself. Most standard template library classes cannot be forward declared and import thousands of lines of code into every compilation unit.

Another source of slowness is the need to include headers simply because the 'size' of the object must be known. A new utility class allows you to 'forward declare' the size required for certain types which allows you to remove their inclusion from the header file.