See my other comments about static profiling of kernels. There are ways of improving the search that keep runtime at the heart of it.