#Large NTTP tips (&tricks)?

1 messages · Page 1 of 1 (latest)

willow jasper
#

I'm working on a lib that makes use of rather large NTTPs

the great thing about them is:
no more messing around variadic templates, parameter packs, fold, recursion etc.
just calculate as usual - but in constexpr/consteval context

I'm looking for tips of how to handle them in a more graceful way
The issues are

  1. compile times.
    somehow the compiler seems really slow in processing these, although there is not a huge total number of them
    with a typical NTTP size of 256 bytes it seems ok for now, but if I make it larger the compile time seems to increase linear in their size
    also not sure what happens if there are more of them as in simple test cases

  2. error messages or inspection with debugger or intellisense etc.
    type names are just too large for comfort
    (for types one might use aliases, but the nttps are obv not types)

spark abyssBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.

quick egret
#

Can you send some code for exactly what you are doing with the templates? An example of one that you see slows down compile times by a lot.

#

That said naturally if you rely on more compile time processing then that will increase compile times linearly

willow jasper
#

Yeah, maybe I should make a "minimal reproducible example" - but it's hard
I was hoping that people did similar stuff and know some things...

I'm not really doing much actual calculations - probably less than a microsecond if it was runtime.
really no idea what takes the compiler so long and how it scales
I also don't instantiate a lot of these types

someone hinted somewhere that "symbol tables" might be huge - no idea what that's about

willow jasper
#

apparently few ppl recognize the power of nttps