This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Simplify / speed up _Index_tuple and _Build_index_tuple


Hi

This is about <functional>'s internal helpers _Index_tuple and _Build_index_tuple.

I noticed that _Build_index_tuple is very complex and does not reuse instantiations with lower numbers. To test, I instantiated it with _Num = { 400, 401, 402, ..., 419 }, which took 6.5s to compile on my machine. The improved version, which does reuse the instantiation of _Build_index_tuple/_Index_tuple for _Num=418 for _Num=419, etc. compiles in 0.3s - approx. 20x faster.

Of course the above test is an extreme case, but it's IMHO also easier to understand the new code. What do you think, worth it?

Without having checked the details, I'm away right now from my main machines, I'm pretty sure it's worth it: I knew for sure that somebody somewhere was implementing this stuff in a better way, but never got around studying the details. Nice that you did. I'll double check later today and likely commit at once.


Thanks!
Paolo


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]