Files
scylladb/cql3
Avi Kivity 8d724835eb Merge 'select_statement: Calculate _restrictions->need_filtering() only once' from Jan Ciołek
Originally mentioned in: https://github.com/scylladb/scylla/pull/9481#issuecomment-982698208

Currently we call `_restrictions->need_filtering()` each time a prepared select is executed.
This is not super efficient - `need_filtering` has to scan through the whole AST and analyze it.

This PR calculates value of `_restrictions->need_filtering()` only once and then uses this precomputed value.
I ran `perf_simple_query` on my laptop throttled to 1GHz and it looks like this saves ~1000 instructions/op.

```bash
median 38459.09 tps ( 75.1 allocs/op,  12.1 tasks/op,   46099 insns/op)
median 38743.79 tps ( 75.1 allocs/op,  12.1 tasks/op,   46091 insns/op)
median 38489.52 tps ( 75.1 allocs/op,  12.1 tasks/op,   46097 insns/op)
median 38492.10 tps ( 75.1 allocs/op,  12.1 tasks/op,   46102 insns/op)
median 38478.65 tps ( 75.1 allocs/op,  12.1 tasks/op,   46098 insns/op)

median 38930.07 tps ( 75.1 allocs/op,  12.1 tasks/op,   44922 insns/op)
median 38777.52 tps ( 75.1 allocs/op,  12.1 tasks/op,   44904 insns/op)
median 39325.41 tps ( 75.1 allocs/op,  12.1 tasks/op,   44925 insns/op)
median 38640.51 tps ( 75.1 allocs/op,  12.1 tasks/op,   44907 insns/op)
median 39075.89 tps ( 75.1 allocs/op,  12.1 tasks/op,   44920 insns/op)

./build/release/test/perf/perf_simple_query --cpuset 1 -m 1G --random-seed 0 --task-quota-ms 10 --operations-per-shard 1000000
```

Closes #9727

* github.com:scylladb/scylla:
  select_statement: Use precomputed value of _restrictions->need_filtering()
  select_statement: Store whether restrictions need filtering in a variable
2021-12-05 13:38:51 +02:00
..
2021-11-04 15:56:45 +01:00
2021-11-04 15:56:45 +01:00
2021-11-04 15:56:45 +01:00
2021-11-04 15:56:45 +01:00
2021-11-04 15:56:45 +01:00
2021-11-04 15:56:45 +01:00
2021-11-04 15:56:45 +01:00
2021-11-04 15:56:45 +01:00
2021-11-04 15:56:45 +01:00
2021-11-04 15:56:45 +01:00
2021-11-04 15:56:45 +01:00
2021-11-04 15:56:45 +01:00
2021-11-04 15:56:45 +01:00
2021-11-04 15:56:45 +01:00
2021-11-04 15:56:45 +01:00
2021-11-04 15:56:45 +01:00
2021-11-04 15:56:45 +01:00
2021-11-04 15:56:45 +01:00
2021-11-04 15:56:45 +01:00
2021-11-04 15:56:45 +01:00