trace_processor: add fast path for filtering single row
trace_processor: add fast path for filtering single row

This CL adds a fast path for filtering a single row; instead of doing a
full table scan and intersecting, we can just lookup the row and filter
it directly.

Old:
------------------------------------------------------------------------------
Benchmark                                       Time           CPU Iterations
------------------------------------------------------------------------------
BM_TableFilterIdAndOtherParent/1024          2340 ns       2340 ns     301737
BM_TableFilterIdAndOtherParent/4096          8187 ns       8187 ns      84799
BM_TableFilterIdAndOtherParent/32768        63260 ns      63261 ns      11056
BM_TableFilterIdAndOtherParent/262144      504210 ns     504077 ns       1000
BM_TableFilterIdAndOtherParent/2097152    4027249 ns    4026426 ns        174

New:
------------------------------------------------------------------------------
Benchmark                                       Time           CPU Iterations
------------------------------------------------------------------------------
BM_TableFilterIdAndOtherParent/1024           215 ns        215 ns    3202587
BM_TableFilterIdAndOtherParent/4096           213 ns        213 ns    3296748
BM_TableFilterIdAndOtherParent/32768          230 ns        230 ns    3270187
BM_TableFilterIdAndOtherParent/262144         215 ns        215 ns    3293794
BM_TableFilterIdAndOtherParent/2097152        217 ns        217 ns    3235218

Analysis:
As we no longer do a full table scan, we've changed the algorithm from O(n) to
O(1) while also reducing the overhead even for small tables.

Change-Id: I644c47fc5fac54f1944792633e2995b697007c20

google/perfetto,google/perfetto,google/perfetto,google/perfetto,google/perfetto,google/perfetto,google/perfetto,google/perfetto