

Show HN: Reflection for C++ made easy - m4nu3l
https://github.com/m4nu3lf/eXtendedMirror

======
ddengster
Nice. Got any benchmarks as compared to other libraries? Especially in terms
of compile times, executable sizes

eg. Example benchmarks of another reflection libary:
[http://www.gamedev.net/page/resources/_/technical/general-
pr...](http://www.gamedev.net/page/resources/_/technical/general-
programming/implementing-a-meta-system-in-c-r3905)

~~~
m4nu3l
I was unable to build that benchmark, however I did some tests for reflected
vs non-reflected code. I've Implemented 40 classes each with one property and
3 methods. Every method was almost empty, just doing some computation like an
addition and returning the value. The getter and setter for the property were
standard. Here are the results: Compilation time increased by a factor of 7.5.
Executable size increased by a factor of 19. Function call time increased by a
factor of 25 (from non virtual). It may seem really really bad (aside for the
function call time)... but, the classes were nearly empty. In the first two
cases (increase in memory and compilation time) we should consider the
increase per class/method/property, not the ratio on the previous measure,
because the penalty only depends on the number of classes/methods/properties.
So I can say that with 40 classes and 5x40 methods (3 + 1 getter and 1 setter
per class) I got a penalty of: 3.18 seconds on compilation time. 2.17 Mega
bytes on the executable size. I think that in a more realistic project the
ratios would be much less. At least I am optimistic.

------
cbsmith
You might want to look at Boost.Hana.

