3 ms·
> import java.util.Calendar; might be your first clue... > but a tight inner loop with a function call is begging for an inline. The loop body makes several
by jedbrown 17y ago
> import java.util.Calendar;
might be your first clue...
> but a tight inner loop with a function call is begging for an inline.
The loop body makes several other function calls, you would be very hard pressed to measure the difference. And if it was a C function in a larger project, you probably wouldn't want to inline it because that would slow your compile times and cause you to lose modularity (i.e. you'd have to rebuild all client code rather than just update the DSO when you optimize the distance function). This function does enough work that it doesn't deserve to be inlined.
- Retric 17y agoYep, sorry, I was not really paying attention and saw what I was expecting to see.