3 ms·
> Cursor.getColumnIndex(String columnName) It's amazing how performance killing patterns transcend the operating environment. I remember profiling a loop-inte
by fatnoah 4y ago
> Cursor.getColumnIndex(String columnName)
It's amazing how performance killing patterns transcend the operating environment. I remember profiling a loop-intensive .NET app many years ago and noticed a massive number of framework-level calls to a getOrdinal(columnName) method to find the numeric index of a column from its name. That was triggered by a programmer calling row.GetColumnValue(columnName) method. Though it was fast, it was called millions upon millions of time. I realized a few orders of magnitude worth of performance improvement by manually getting the ordinals on the first iteration, caching them, and then using them for subsequent iterations.
I love performance profiling and improvement. It was almost never "roadmap" work, but something I just did.