It was $200 an hour for a total of 8 hours. They had a team of 5 working for six months on it and they planed to spend another six months on it.
The UI had options to check some categories and exclude others, this was mapped to sql with a nested query IN (…) and not in (…). I noticed that there were less than 64 categories and always will be so I figured pack the category membership into a 64bit ints and use bitwise operations. The UI query generation would map to use bitmasks instead. They didn’t even let me implement it, just agreed that it would work and took it from there. I think they were quite embarrassed by it. It ended up being 10K faster.
The UI had options to check some categories and exclude others, this was mapped to sql with a nested query IN (…) and not in (…). I noticed that there were less than 64 categories and always will be so I figured pack the category membership into a 64bit ints and use bitwise operations. The UI query generation would map to use bitmasks instead. They didn’t even let me implement it, just agreed that it would work and took it from there. I think they were quite embarrassed by it. It ended up being 10K faster.