Using units is a good means for rapidly developing code, since it provides some error control.
Hovewer, using Mathamatica functions containing units appears to be copmutationally inefficient.
Example: I have a function:
LambdaSpeed[t_] := Quantity[10, "Nanometers"]/t
It gives some dimensional output for dimensional input, which I would like to plot in units of $c$:
Plot[LambdaSpeed[Quantity[t, "Seconds"]]/
Quantity[1, "SpeedOfLight"], {t, 0, 10}] // Timing
Effectively, plotting a hyperbola in chosen units takes 6.3 seconds on my machine.
The problem is that Mathematica applies the same costly operation of unit conversion many times.
In developing I sometimes end up developing code in dimensional form and then redefining the same functions, assuming a chosen unit system.
Question: Is there a way to use functions containing units in high-performance calculations?
I would imagine this would require defining automatic rules, which would call an interpreter for each given unit conversion just once and the rest would be evaluated directly without interpreter.