Closed matthiasdiener closed 1 year ago
Wait... this change reduces compile time by 80%?
Wait... this change reduces compile time by 80%?
No, it reduces the number of calls to sorted
by 80% (7.5 million to 1 Million). Overall compile time is improved by ~5%.
Sounds good. Every little bit helps! :slightly_smiling_face:
(And thanks!)
One additional item is that, in many situations, there won't be a **kwargs
component to deal with, and @optimize_mapper
could specialize that away. For expensive mappers, this may be a good idea.
sorted()
is currently the function with the highest impact on compile performance in a mirgecom-y3prediction rhs compile on M1 (i.e., it is the top entry in cProfile when sorting bytottime
, just above islpy's casting wrapper). This PR reduces the number of calls tosorted
by 80%.Other options might be:
frozenset
hash(immutables.Map(...))
frozendict