well-typed / optics

Optics as an abstract interface
374 stars 24 forks source link

Experiment with less INLINE pragmas #137

Open arybczak opened 5 years ago

arybczak commented 5 years ago

We currently mark everything as INLINE. Some of these are needed for rewrite rules or optimizing away profunctor typeclasses, but excessive use of them is known to slow down compilation and unnecessarily increase executable size.

Case in point: https://mpickering.github.io/posts/2017-05-17-inlining-case-study.html

We should probably figure out which functions need to be marked as such and which aren't. We have reliable way of testing that thanks to inspection-testing.

arybczak commented 4 years ago

Preliminary testing shows that functions that consume optics and optics itself usually (unless they're really small) need to be marked as INLINE for optimizations to happen.

Looks like implementations of profunctor instances and other utilities that sit deeper don't need INLINE pragmas though.