|
|
|
|
|
by RyanJK5
14 days ago
|
|
I don't have any numbers, but it is pretty slow. You can try making some edits in Compiler Explorer to see for yourself (though that of course has some impact from network requests). One reason is that, like you said, the feature is still new. Additionally I made pretty liberal use of the std::ranges library in my implementation which has notoriously bad compile times. That could be an area to improve upon. Another may be a bit more structural. If you want to call myObj.foo() via reflection, you have to linearly search members_of(myObj) for the one named "foo", and then call that. Actual compilers I assume use some kind of hash table. The hand-waving solution is "put it in a PCH", but I am hoping to put some more effort into optimizing build time here in the future. |
|
Compiler Explorer is not good for measuring anything in general, because there is also the issue of containers being allocated for specific languages, and compiler toolchains, and how many people are using it on a given moment.