Hi Dhiraj, On Tue, Jan 23, 2024 at 05:59:06PM -0600, Dhiraj Holden <dhiraj.holden@xxxxxxxxx> wrote: > I have a question about the OpenCL implementation of VLOOKUP as given in > sc/source/core/opencl/op_spreadsheet.cxx. Right now, both the unsorted and > sorted vlookup both do a linear search to find the right value. I am > wondering if it would be better to do a binary search for sorted vlookup. I > could take care of that now that I've wrapped my head around this > implementation. Just a general suggestion: make sure that you profile your calculation cost with callgrind or perf and only optimize this if you see it as a hotspot. Also, you might want to consider what the normal (on CPU) calculation for VLOOKUP does: that is the default, so it typically makes sense to improve the opencl VLOOKUP if the CPU one already does something similar, to avoid mismatches and additional complexity. Regards, Miklos