2 ms·
I'm not saying that's your case, but this reminds me of a colleague of mine who was tasked with building a piece of code to calculate some metric related to the
by mmarq 5y ago
I'm not saying that's your case, but this reminds me of a colleague of mine who was tasked with building a piece of code to calculate some metric related to the adjacency of faulty parts in a production batch.
He initially wrote an R script, but was extremely slow, so he started rewriting it in C. When I got involved, I found he was calculating this metric with N nested loops, rather than transforming his problem in something that was supported by an existing library or built-in function.
Once he rearranged the problem as a matrix multiplication plus some statistical commands, the R script was faster than the C program and also more readable.