Skip to content

Implement DIFF, DIFF1, ANDOR and ONE for BITOP #13898

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
May 20, 2025

Conversation

minchopaskal
Copy link
Collaborator

@minchopaskal minchopaskal commented Mar 28, 2025

This PR adds 4 new operators to the BITOP command - DIFF, DIFF1, ANDOR and ONE. They enable redis clients to atomically do non-trivial logical operations that are useful for checking membership of a bitmap against a group of bitmaps.

  • DIFF
    BITOP DIFF dest srckey1 srckey2 [key...]

    Description
    DIFF(X, A1, A2, ..., AN) = X ∧ ¬(A1A2...AN), i.e the set bits of X that are not set in any of A1, A2, , AN

    NOTE
    Command expects at least 2 source keys.

  • DIFF1
    BITOP DIFF1 dest srckey1 srckey2 [key...]

    Description
    DIFF1(X, A1, A2, ..., AN) = ¬X ∧ (A1A2...AN), i.e the bits set in one or more of A1, A2, , AN that are not set in X

    NOTE
    Command expects at least 2 source keys.

  • ANDOR
    BITOP ANDOR dest srckey1 srckey2 [key...]

    Description
    ANDOR(X, A1, A2, ..., AN) = X ∧ (A1A2...AN), i.e the set bits of X that are also set in A1, A2, , AN

    NOTE
    Command expects at least 2 source keys.

  • ONE
    BITOP ONE dest key [key...]

    Description
    ONE(A1, A2, ..., AN) = X, where
    if X[i] is the i-th bit of X then X[i] = 1 if and only if there is m such that A_m[i] = 1 and An[i] = 0 for all n != m, i.e bit X[i] is set only if it set in exactly one of A1, A2, ..., AN

Return value
As in all other BITOP operators return value for all the new ones is the number bytes of the longest key.

EDIT:
Besides adding the new commands couple more changes were made:

  • Added AVX2 path for more optimized computation of the BITOP operations (including the new ones)
  • Removed the hard limit of max 16 source keys for the fast path to be used - now no matter the number of keys we can enter the fast path given keys are long enough.

@CLAassistant
Copy link

CLAassistant commented Mar 28, 2025

CLA assistant check
All committers have signed the CLA.

@tezc tezc self-requested a review March 28, 2025 15:36
@sundb
Copy link
Collaborator

sundb commented Apr 1, 2025

@minchopaskal should we consider using SIMD to optimize these new commands?

@minchopaskal
Copy link
Collaborator Author

@minchopaskal should we consider using SIMD to optimize these new commands?

@sundb thank you for the suggestion. Actually, I though about that too but it seems the code is written in such way so that the compiler specifically can generate SIMD code. I checked the disassembly of arm64 and x86 which both generate simd instructions. The new commands have implementations for the optimized path.
Maybe if performance become an issue we could look into hand-written SIMD, what do you think?

@sundb
Copy link
Collaborator

sundb commented Apr 1, 2025

@minchopaskal In #13558, we found that even in the case of support SIMD, the compiler will not generate the corresponding code, maybe we can try to take a command to verify it.

@minchopaskal
Copy link
Collaborator Author

@sundb

Added hand-written SIMD optimization (via AVX2 instruction set - 256bit register) for the BITOP operations including the new ops.

Benchmarks

This commit actually includes two optimizations:

  • In the old code the fast path was for some reason limited to 16 source keys, meaning any command containing more than that would needlessly be computed via the slow-path (byte by byte). The compiler actually generates SIMD instructions for the fast-path, albeit they are SSE (128-bit register). So one of the optimizations here was to remove that limitation. A small benchmark shows no performance change for the 16 keys case:
==================================================================================================
Type         Ops/sec     Avg. Latency     p50 Latency     p99 Latency   p99.9 Latency       KB/sec
===============================================and================================================
Key Size: 32B | Key Count: 16 | Kb/s Change: -0.74%
and-old      70369.98         2.84272         2.78300         5.53500        27.64700     27075.95
and-new      70387.83         2.84409         2.78300         5.50300        27.64700     26876.60
--------------------------------------------------------------------------------------------------
Key Size: 1KB | Key Count: 16 | Kb/s Change: +0.67%
and-old      64193.80         3.11139         2.91100         4.73500        26.11100     24887.64
and-new      65116.61         3.07074         2.87900         4.67100        25.59900     25054.63
--------------------------------------------------------------------------------------------------
Key Size: 10KB | Key Count: 16 | Kb/s Change: +0.28%
and-old      36774.40         5.43406         5.37500         8.25500        29.69500     14293.18
and-new      36971.43         5.40152         5.37500         7.93500        29.95100     14333.65
--------------------------------------------------------------------------------------------------

===============================================not================================================
Key Size: 32B | Key Count: 16 | Kb/s Change: -0.23%
not-old      71630.54         2.77681         2.55900         7.19900        29.69500     31198.46
not-new      71953.26         2.76820         2.52700         7.51900        29.43900     31128.22
--------------------------------------------------------------------------------------------------
Key Size: 1KB | Key Count: 16 | Kb/s Change: +0.99%
not-old      71203.79         2.81134         2.57500         7.42300        29.31100     31082.12
not-new      72396.41         2.77040         2.52700         7.35900        30.59100     31390.63
--------------------------------------------------------------------------------------------------
Key Size: 10KB | Key Count: 16 | Kb/s Change: +1.78%
not-old      71823.49         2.78497         2.55900         7.29500        29.43900     31352.64
not-new      73262.70         2.77885         2.54300         7.32700        30.59100     31909.34
--------------------------------------------------------------------------------------------------

Repro

machine: AWS m5.large instance (non-dedicated)
old: d551272
new: 9fc4992 (redis-server needs to be run with env BITOP_DISABLE_AVX=1)
bench_script: https://github.com/minchopaskal/bench_script

  • The next optimization was to have a faster-path - a function to compute the BITOP command via AVX2 instructions. This is guarded by a runtime check. Next follows a benchmark with different key sizes and key counts. The OR/XOR ops were skipped as they should have roughly the same performance as AND (having the same amount of instructions), same for DIFF1/ANDOR respectively for DIFF.
    NOTE More benchmarks are currently in progress - specifically for keycounts of 2, 5, 64 and keysizes of 1MB and 10MB
==================================================================================================
Type         Ops/sec     Avg. Latency     p50 Latency     p99 Latency   p99.9 Latency       KB/sec
===============================================and================================================
Key Size: 32B | Key Count: 16 | Kb/s Change: 0.49%
and-sse      70387.83         2.84409         2.78300         5.50300        27.64700     26876.60
and-avx      70193.22         2.83733         2.78300         5.59900        27.13500     27007.94
--------------------------------------------------------------------------------------------------
Key Size: 32B | Key Count: 35 | Kb/s Change: 0.12%
and-sse      58192.50         3.43708         3.19900         5.18300        26.75100     46088.01
and-avx      58260.16         3.42779         3.19900         5.18300        26.87900     46141.59
--------------------------------------------------------------------------------------------------
Key Size: 32B | Key Count: 101 | Kb/s Change: 0.53%
and-sse      36541.69         5.46911         5.27900         8.19100        30.46300     80291.81
and-avx      36671.93         5.44666         5.24700         8.19100        30.33500     80721.22
--------------------------------------------------------------------------------------------------
Key Size: 1KB | Key Count: 16 | Kb/s Change: 3.93%
and-sse      65116.61         3.07074         2.87900         4.67100        25.59900     25054.63
and-avx      67331.58         2.97168         2.79900         4.57500        25.72700     26038.38
--------------------------------------------------------------------------------------------------
Key Size: 1KB | Key Count: 35 | Kb/s Change: 7.47%
and-sse      50265.81         3.97693         3.69500         5.91900        27.39100     39859.21
and-avx      54218.84         3.68609         3.40700         5.50300        26.75100     42835.00
--------------------------------------------------------------------------------------------------
Key Size: 1KB | Key Count: 101 | Kb/s Change: 14.02%
and-sse      27595.85         7.22707         7.13500        15.42300        33.53500     60851.01
and-avx      31463.75         6.35734         6.20700        12.03100        31.61500     69380.02
--------------------------------------------------------------------------------------------------
Key Size: 10KB | Key Count: 16 | Kb/s Change: 34.55%
and-sse      36971.43         5.40152         5.37500         7.93500        29.95100     14333.65
and-avx      50124.50         3.99364         3.71100         5.88700        27.64700     19286.18
--------------------------------------------------------------------------------------------------
Key Size: 10KB | Key Count: 35 | Kb/s Change: 56.88%
and-sse      19467.69        10.25459        10.81500        23.16700        37.88700     15494.30
and-avx      30654.04         6.49009         6.52700        12.35100        31.48700     24307.69
--------------------------------------------------------------------------------------------------
Key Size: 10KB | Key Count: 101 | Kb/s Change: 51.80%
and-sse       6502.76        30.93543        33.02300        56.57500        71.16700     14313.69
and-avx       9849.15        20.28068        21.37500        39.93500        53.75900     21727.75
--------------------------------------------------------------------------------------------------
Key Size: 50KB | Key Count: 16 | Kb/s Change: 120.30%
and-sse       8752.83        22.82167        25.59900        44.03100        57.85500      3376.34
and-avx      19234.07        10.38190        11.07100        23.29500        38.39900      7438.18
--------------------------------------------------------------------------------------------------
Key Size: 50KB | Key Count: 35 | Kb/s Change: 83.92%
and-sse       3839.78        51.99465        58.36700        86.01500       104.44700      3048.58
and-avx       7062.08        28.37415        31.48700        50.68700        64.51100      5606.91
--------------------------------------------------------------------------------------------------
Key Size: 50KB | Key Count: 101 | Kb/s Change: 71.21%
and-sse       1135.79       176.07966       191.48700       234.49500       260.09500      2503.41
and-avx       1945.45       103.15990       113.15100       141.31100       154.62300      4286.08
--------------------------------------------------------------------------------------------------

===============================================not================================================
Key Size: 32B | Key Count: 16 | Kb/s Change: 1.84%
not-sse      71953.26         2.76820         2.52700         7.51900        29.43900     31128.22
not-avx      72787.47         2.75363         2.52700         7.13500        29.43900     31702.36
--------------------------------------------------------------------------------------------------
Key Size: 32B | Key Count: 35 | Kb/s Change: 0.50%
not-sse      63892.82         3.11004         2.92700         7.48700        29.95100     53847.17
not-avx      64214.52         3.08232         2.91100         7.26300        31.99900     54118.29
--------------------------------------------------------------------------------------------------
Key Size: 32B | Key Count: 101 | Kb/s Change: -0.69%
not-sse      48242.66         4.14489         4.12700         7.26300        31.99900    108451.76
not-avx      47825.03         4.27749         4.25500         7.45500        31.48700    107699.72
--------------------------------------------------------------------------------------------------
Key Size: 1KB | Key Count: 16 | Kb/s Change: 1.00%
not-sse      72396.41         2.77040         2.52700         7.35900        30.59100     31390.63
not-avx      72795.32         2.76288         2.54300         7.16700        30.59100     31705.77
--------------------------------------------------------------------------------------------------
Key Size: 1KB | Key Count: 35 | Kb/s Change: 5.49%
not-sse      61533.91         3.23348         2.99100         8.25500        34.30300     51799.05
not-avx      65138.74         3.07684         2.91100         7.16700        30.59100     54642.76
--------------------------------------------------------------------------------------------------
Key Size: 1KB | Key Count: 101 | Kb/s Change: -0.30%
not-sse      46746.26         4.30785         4.28700         7.67900        31.87100    105361.69
not-avx      46607.80         4.29269         4.28700         7.51900        32.63900    105049.61
--------------------------------------------------------------------------------------------------
Key Size: 10KB | Key Count: 16 | Kb/s Change: -3.35%
not-sse      73262.70         2.77885         2.54300         7.32700        30.59100     31909.34
not-avx      71291.32         2.79406         2.55900         7.39100        31.35900     30841.85
--------------------------------------------------------------------------------------------------
Key Size: 10KB | Key Count: 35 | Kb/s Change: 0.77%
not-sse      64523.57         3.09342         2.92700         7.35900        32.38300     54441.77
not-avx      65248.87         3.05533         2.87900         7.13500        30.59100     54862.57
--------------------------------------------------------------------------------------------------
Key Size: 10KB | Key Count: 101 | Kb/s Change: -2.49%
not-sse      47780.43         4.18042         4.15900         7.39100        33.02300    107459.30
not-avx      46491.41         4.29091         4.28700         7.61500        34.04700    104787.28
--------------------------------------------------------------------------------------------------
Key Size: 50KB | Key Count: 16 | Kb/s Change: 0.61%
not-sse      71403.56         2.79085         2.55900         7.35900        30.59100     30960.14
not-avx      71679.42         2.78756         2.54300         7.55100        31.10300     31149.75
--------------------------------------------------------------------------------------------------
Key Size: 50KB | Key Count: 35 | Kb/s Change: 0.65%
not-sse      64869.64         3.09264         2.91100         7.35900        29.43900     54607.06
not-avx      65292.84         3.04994         2.87900         7.26300        31.10300     54963.31
--------------------------------------------------------------------------------------------------
Key Size: 50KB | Key Count: 101 | Kb/s Change: -1.99%
not-sse      47481.38         4.28413         4.25500         7.45500        31.74300    106925.84
not-avx      46556.53         4.30004         4.28700         7.51900        34.30300    104797.65
--------------------------------------------------------------------------------------------------

===============================================diff===============================================
Key Size: 32B | Key Count: 16 | Kb/s Change: 0.69%
diff-sse      70548.19         2.83800         2.78300         5.37500        27.13500     27075.62
diff-avx      70496.24         2.83134         2.78300         5.59900        27.00700     27262.22
--------------------------------------------------------------------------------------------------
Key Size: 32B | Key Count: 35 | Kb/s Change: 1.27%
diff-sse      57720.34         3.46024         3.23100         5.24700        26.87900     45826.80
diff-avx      58455.00         3.42289         3.18300         5.18300        27.00700     46410.08
--------------------------------------------------------------------------------------------------
Key Size: 32B | Key Count: 101 | Kb/s Change: 3.80%
diff-sse      36353.32         5.49779         5.27900         8.44700        30.46300     79948.91
diff-avx      37669.12         5.31110         5.11900         7.93500        29.82300     82989.77
--------------------------------------------------------------------------------------------------
Key Size: 1KB | Key Count: 16 | Kb/s Change: 3.88%
diff-sse      64278.03         3.10428         2.89500         4.70300        25.98300     24857.52
diff-avx      66438.33         3.00776         2.83100         4.60700        26.11100     25822.71
--------------------------------------------------------------------------------------------------
Key Size: 1KB | Key Count: 35 | Kb/s Change: 7.38%
diff-sse      49238.36         4.05279         3.77500         5.98300        27.64700     39140.65
diff-avx      53068.52         3.76783         3.48700         5.63100        27.26300     42029.86
--------------------------------------------------------------------------------------------------
Key Size: 1KB | Key Count: 101 | Kb/s Change: 11.22%
diff-sse      27216.19         7.34354         7.26300        15.74300        33.53500     60066.98
diff-avx      30269.93         6.60551         6.46300        13.31100        32.51100     66806.68
--------------------------------------------------------------------------------------------------
Key Size: 10KB | Key Count: 16 | Kb/s Change: 33.31%
diff-sse      36456.27         5.47794         5.43900         8.03100        29.82300     14205.13
diff-avx      48967.07         4.07945         3.80700         5.98300        27.64700     18936.48
--------------------------------------------------------------------------------------------------
Key Size: 10KB | Key Count: 35 | Kb/s Change: 53.49%
diff-sse      19508.55        10.34083        10.94300        23.55100        38.14300     15564.93
diff-avx      30054.50         6.64666         6.71900        13.11900        31.74300     23890.98
--------------------------------------------------------------------------------------------------
Key Size: 10KB | Key Count: 101 | Kb/s Change: 51.86%
diff-sse       6450.05        31.03209        33.02300        56.83100        71.16700     14210.26
diff-avx       9773.60        20.52574        21.63100        40.19100        53.75900     21580.19
--------------------------------------------------------------------------------------------------
Key Size: 50KB | Key Count: 16 | Kb/s Change: 115.29%
diff-sse       8804.65        22.75742        25.59900        43.77500        57.34300      3413.52
diff-avx      18907.73        10.55792        11.26300        23.80700        39.16700      7348.90
--------------------------------------------------------------------------------------------------
Key Size: 50KB | Key Count: 35 | Kb/s Change: 80.33%
diff-sse       3883.73        51.59281        57.85500        84.99100       103.42300      3091.05
diff-avx       7003.52        28.56112        31.87100        51.19900        64.76700      5574.09
--------------------------------------------------------------------------------------------------
Key Size: 50KB | Key Count: 101 | Kb/s Change: 70.04%
diff-sse       1134.93       176.45675       192.51100       235.51900       262.14300      2503.71
diff-avx       1930.71       103.70039       114.68700       142.33500       154.62300      4257.37
--------------------------------------------------------------------------------------------------

===============================================one================================================
Key Size: 32B | Key Count: 16 | Kb/s Change: 0.97%
one-sse      70444.99         2.83806         2.78300         5.47100        26.62300     26898.43
one-avx      70589.98         2.82571         2.78300         5.47100        26.62300     27160.60
--------------------------------------------------------------------------------------------------
Key Size: 32B | Key Count: 35 | Kb/s Change: 0.98%
one-sse      57605.01         3.44909         3.21500         5.21500        26.87900     45622.72
one-avx      58170.67         3.43234         3.19900         5.21500        27.13500     46070.72
--------------------------------------------------------------------------------------------------
Key Size: 32B | Key Count: 101 | Kb/s Change: 2.18%
one-sse      35857.05         5.57616         5.37500         8.70300        30.33500     78787.46
one-avx      36572.35         5.46083         5.24700         8.19100        30.46300     80502.02
--------------------------------------------------------------------------------------------------
Key Size: 1KB | Key Count: 16 | Kb/s Change: 9.70%
one-sse      60675.57         3.29465         3.05500         4.92700        26.36700     23345.87
one-avx      66223.32         3.01574         2.83100         4.57500        25.85500     25609.80
--------------------------------------------------------------------------------------------------
Key Size: 1KB | Key Count: 35 | Kb/s Change: 16.96%
one-sse      45389.32         4.43897         4.22300         6.49500        28.54300     35992.31
one-avx      53285.05         3.75387         3.48700         5.59900        27.00700     42097.27
--------------------------------------------------------------------------------------------------
Key Size: 1KB | Key Count: 101 | Kb/s Change: 32.03%
one-sse      22562.12         8.85785         8.89500        20.35100        36.09500     49751.24
one-avx      29788.10         6.73381         6.59100        13.82300        33.02300     65685.08
--------------------------------------------------------------------------------------------------
Key Size: 10KB | Key Count: 16 | Kb/s Change: 80.44%
one-sse      25856.61         7.75498         8.09500        17.02300        33.79100     10024.49
one-avx      47011.03         4.24812         3.98300         6.20700        28.03100     18088.23
--------------------------------------------------------------------------------------------------
Key Size: 10KB | Key Count: 35 | Kb/s Change: 134.07%
one-sse      12522.46        15.95310        17.27900        33.53500        47.35900      9966.60
one-avx      29419.75         6.80751         6.87900        13.82300        32.38300     23328.94
--------------------------------------------------------------------------------------------------
Key Size: 10KB | Key Count: 101 | Kb/s Change: 144.82%
one-sse       3868.40        51.73798        55.29500        84.47900        96.25500      8515.02
one-avx       9449.50        21.15084        22.27100        41.72700        55.55100     20846.11
--------------------------------------------------------------------------------------------------
Key Size: 50KB | Key Count: 16 | Kb/s Change: 214.35%
one-sse       5588.73        35.84317        40.70300        63.74300        78.84700      2155.81
one-avx      17523.71        11.39751        12.35100        25.47100        39.67900      6776.75
--------------------------------------------------------------------------------------------------
Key Size: 50KB | Key Count: 35 | Kb/s Change: 167.33%
one-sse       2568.79        78.00155        88.06300       117.24700       133.11900      2039.48
one-avx       6867.05        29.14662        32.63900        52.99100        67.07100      5452.06
--------------------------------------------------------------------------------------------------
Key Size: 50KB | Key Count: 101 | Kb/s Change: 153.65%
one-sse        728.67       274.93407       296.95900       364.54300       430.07900      1606.06
one-avx       1849.08       108.06780       118.78300       149.50300       162.81500      4073.75
--------------------------------------------------------------------------------------------------

Repro

machine: AWS m5.large instance (non-dedicated)
commit: 9fc4992
sse: $ BITOP_DISABLE_AVX=1 redis-server
avx: $ redis-server
benchmark script: as-above

Notes

One can see that AVX shows no benefit over SSE for the BITOP NOT operation (even some pessimization in certain cases) - I attribute that to the fact that there are a lot of loads/stores(unaligned for that matter) compared to only 1 logic instruction.

Another observation is the decrease of improvement when command is run with more keys - this happens for keys of big size. As we add more keys - there are more load instruction and I conjure they degrade the performance. Still - we gain a lot of speed over the compiler generated SSE.

Final note - both source keys and destination memory are unaligned. SIMD load instructions are more effective when load/store operation is done over memory aligned to the size of the SIMD register. We can't possibly benefit from aligning source keys as it would incur too much copies, but aligned load instructions were tested nevertheless and showed no significant difference.

@github-project-automation github-project-automation bot moved this to Needs triage in Redis Triage Apr 12, 2025
@minchopaskal
Copy link
Collaborator Author

Some more benchmarks.. I tried to run them with memtier_benchmark -n10000 but for 1Mb and 10Mb cases they ran too long, so 10Mb case was run only for 10 minutes each

Some of the tests were the same as in above comment - 32bytes-16keys, 50Kb-16keys . This new benchmark show better results for them - I attribute that to the noise introduced by the fact tests were ran on non-dedicated AWS machines.

Generally results look very good, besides 10mb case for small number of keys.. Speeds there are generally slow so I'm sure if the ~12% degradation is really meaningful. Sadly the AVX2 code couldn't optimize these cases I presume because of all the unaligned loads.

==================================================================================================
Type         Ops/sec     Avg. Latency     p50 Latency     p99 Latency   p99.9 Latency       KB/sec
===============================================and================================================
Key Size: 32B | Key Count: 2 | Kb/s Change: 8.95%
and-sse      80906.43         2.47096         2.36700         5.37500        28.03100      6794.88
and-avx      88148.63         2.27910         2.15900         5.18300        26.87900      7403.11
--------------------------------------------------------------------------------------------------
Key Size: 32B | Key Count: 5 | Kb/s Change: 7.14%
and-sse      78032.19         2.56212         2.51100         5.50300        29.05500     11506.70
and-avx      84163.89         2.37250         2.30300         5.21500        28.54300     12328.69
--------------------------------------------------------------------------------------------------
Key Size: 32B | Key Count: 16 | Kb/s Change: 7.54%
and-sse      70582.56         2.83465         2.76700         5.05500        26.62300     27226.67
and-avx      76097.10         2.62818         2.55900         4.25500        25.47100     29279.55
--------------------------------------------------------------------------------------------------
Key Size: 32B | Key Count: 64 | Kb/s Change: 5.60%
and-sse      45965.71         4.34680         4.07900         6.81500        28.28700     64863.72
and-avx      48573.35         4.11856         3.90300         6.07900        27.13500     68496.01
--------------------------------------------------------------------------------------------------
Key Size: 1KB | Key Count: 2 | Kb/s Change: 8.57%
and-sse      78602.80         2.54046         2.41500         5.53500        29.31100      6754.93
and-avx      85336.41         2.33367         2.23900         5.11900        28.92700      7333.60
--------------------------------------------------------------------------------------------------
Key Size: 1KB | Key Count: 5 | Kb/s Change: 6.01%
and-sse      75388.61         2.64546         2.65500         5.21500        28.41500     11337.74
and-avx      81508.01         2.45193         2.43100         5.18300        26.62300     12019.25
--------------------------------------------------------------------------------------------------
Key Size: 1KB | Key Count: 16 | Kb/s Change: 11.80%
and-sse      62964.06         3.17240         2.97500         4.95900        26.49500     24349.38
and-avx      70392.36         2.83778         2.65500         4.31900        25.21500     27222.04
--------------------------------------------------------------------------------------------------
Key Size: 1KB | Key Count: 64 | Kb/s Change: 17.17%
and-sse      37000.91         5.48815         5.34300         8.12700        30.46300     51996.40
and-avx      42993.79         4.72597         4.57500         6.84700        28.67100     60921.87
--------------------------------------------------------------------------------------------------
Key Size: 50KB | Key Count: 2 | Kb/s Change: 28.65%
and-sse      45125.54         4.42361         4.07900         6.78300        28.79900      3922.04
and-avx      59386.37         3.36832         3.10300         4.89500        25.34300      5045.52
--------------------------------------------------------------------------------------------------
Key Size: 50KB | Key Count: 5 | Kb/s Change: 69.20%
and-sse      28051.72         7.21744         7.23100        15.35900        33.27900      4218.72
and-avx      47157.07         4.23265         4.07900         6.04700        27.13500      7138.03
--------------------------------------------------------------------------------------------------
Key Size: 50KB | Key Count: 16 | Kb/s Change: 131.46%
and-sse       8804.24        22.70903        25.59900        43.77500        57.34300      3387.57
and-avx      20275.65         9.81520        10.49500        21.75900        36.60700      7840.97
--------------------------------------------------------------------------------------------------
Key Size: 50KB | Key Count: 64 | Kb/s Change: 66.71%
and-sse       1895.37       105.50811       116.73500       149.50300       164.86300      2672.77
and-avx       3153.30        63.46911        69.11900        92.67100       103.93500      4455.88
--------------------------------------------------------------------------------------------------
Key Size: 1MB | Key Count: 2 | Kb/s Change: 10.31%
and-sse       4061.81        49.28745        58.62300        82.94300       101.37500       360.96
and-avx       4480.40        44.66502        51.19900        74.75100        91.13500       398.16
--------------------------------------------------------------------------------------------------
Key Size: 1MB | Key Count: 5 | Kb/s Change: 40.12%
and-sse       2006.84        99.69922       117.75900       152.57500       167.93500       307.69
and-avx       2848.39        70.26619        80.89500       106.49500       121.34300       431.15
--------------------------------------------------------------------------------------------------
Key Size: 1MB | Key Count: 16 | Kb/s Change: 112.59%
and-sse        453.36       441.05613       450.55900       610.30300       708.60700       175.76
and-avx        963.77       207.79373       234.49500       286.71900       331.77500       373.65
--------------------------------------------------------------------------------------------------
Key Size: 1MB | Key Count: 64 | Kb/s Change: 26.31%
and-sse         60.23      3319.90356      3260.41500      3653.63100      3751.93500        85.29
and-avx         75.98      2632.77930      2605.05500      3112.95900      3194.87900       107.73
--------------------------------------------------------------------------------------------------
Key Size: 10MB | Key Count: 2 | Kb/s Change: -12.94%
and-sse        123.90      1614.36122      1613.82300      1908.73500      2047.99900        11.13
and-avx        111.54      1793.66085      1802.23900      1998.84700      2056.19100         9.69
--------------------------------------------------------------------------------------------------
Key Size: 10MB | Key Count: 5 | Kb/s Change: -3.11%
and-sse         87.59      2283.59368      2310.14300      2457.59900      2539.51900        13.51
and-avx         84.87      2357.13760      2375.67900      2539.51900      2621.43900        13.09
--------------------------------------------------------------------------------------------------
Key Size: 10MB | Key Count: 16 | Kb/s Change: 38.52%
and-sse         32.64      6126.57437      6193.15100      6619.13500      6782.97500        12.72
and-avx         45.33      4411.99786      4456.44700      5013.50300      5111.80700        17.62
--------------------------------------------------------------------------------------------------
Key Size: 10MB | Key Count: 64 | Kb/s Change: 13.59%
and-sse          5.41     37420.87877     38273.02300     39845.88700     39845.88700         7.65
and-avx          6.14     32617.96784     32899.07100     33816.57500     34340.86300         8.69
--------------------------------------------------------------------------------------------------

===============================================not================================================
Key Size: 32B | Key Count: 2 | Kb/s Change: 9.85%
not-sse      79107.24         2.51783         2.30300         7.10300        28.92700     10660.94
not-avx      86898.55         2.33847         2.14300         6.65500        27.39100     11710.94
--------------------------------------------------------------------------------------------------
Key Size: 32B | Key Count: 5 | Kb/s Change: 7.91%
not-sse      77098.83         2.58923         2.36700         7.23100        29.69500     15284.24
not-avx      83610.46         2.37750         2.17500         6.65500        28.41500     16493.47
--------------------------------------------------------------------------------------------------
Key Size: 32B | Key Count: 16 | Kb/s Change: 7.87%
not-sse      72126.71         2.76624         2.54300         7.19900        29.56700     31485.00
not-avx      77974.49         2.55085         2.33500         6.65500        29.05500     33961.55
--------------------------------------------------------------------------------------------------
Key Size: 32B | Key Count: 64 | Kb/s Change: 5.25%
not-sse      55088.96         3.59969         3.58300         7.19900        31.10300     80535.32
not-avx      58022.40         3.43329         3.40700         6.91100        30.20700     84767.10
--------------------------------------------------------------------------------------------------
Key Size: 1KB | Key Count: 2 | Kb/s Change: 5.53%
not-sse      79976.37         2.56120         2.33500         7.19900        30.59100     10778.06
not-avx      84397.98         2.35904         2.15900         6.65500        28.15900     11373.95
--------------------------------------------------------------------------------------------------
Key Size: 1KB | Key Count: 5 | Kb/s Change: 6.41%
not-sse      76025.54         2.61687         2.38300         7.29500        31.35900     15145.71
not-avx      82105.24         2.43494         2.22300         6.68700        29.82300     16116.36
--------------------------------------------------------------------------------------------------
Key Size: 1KB | Key Count: 16 | Kb/s Change: 6.44%
not-sse      71572.25         2.77714         2.55900         7.16700        30.97500     31173.07
not-avx      76179.71         2.60757         2.38300         6.84700        29.05500     33179.83
--------------------------------------------------------------------------------------------------
Key Size: 1KB | Key Count: 64 | Kb/s Change: 9.08%
not-sse      53681.83         3.71269         3.67900         7.32700        32.38300     78058.84
not-avx      58086.45         3.43235         3.40700         6.84700        31.10300     85144.29
--------------------------------------------------------------------------------------------------
Key Size: 50KB | Key Count: 2 | Kb/s Change: 22.30%
not-sse      69074.21         2.89530         2.67100         7.96700        33.02300      9308.83
not-avx      85720.54         2.32767         2.14300         6.43100        28.15900     11384.76
--------------------------------------------------------------------------------------------------
Key Size: 50KB | Key Count: 5 | Kb/s Change: 21.76%
not-sse      68858.29         2.90162         2.65500         7.99900        33.27900     13650.62
not-avx      83433.37         2.38906         2.19100         6.68700        27.51900     16621.49
--------------------------------------------------------------------------------------------------
Key Size: 50KB | Key Count: 16 | Kb/s Change: 8.06%
not-sse      72351.14         2.75893         2.52700         7.23100        29.56700     31300.35
not-avx      77829.29         2.55293         2.33500         6.59100        28.41500     33822.30
--------------------------------------------------------------------------------------------------
Key Size: 50KB | Key Count: 64 | Kb/s Change: 3.60%
not-sse      55227.71         3.62423         3.61500         7.23100        31.87100     80522.43
not-avx      57103.92         3.51173         3.48700         7.07100        31.87100     83425.26
--------------------------------------------------------------------------------------------------
Key Size: 1MB | Key Count: 2 | Kb/s Change: 7.18%
not-sse      76458.72         2.59673         2.36700         7.39100        31.48700     10304.01
not-avx      81950.48         2.43004         2.22300         6.81500        28.92700     11044.11
--------------------------------------------------------------------------------------------------
Key Size: 1MB | Key Count: 5 | Kb/s Change: 5.15%
not-sse      76054.79         2.61782         2.39900         7.29500        30.33500     15151.54
not-avx      80765.76         2.46629         2.27100         6.78300        29.18300     15932.31
--------------------------------------------------------------------------------------------------
Key Size: 1MB | Key Count: 16 | Kb/s Change: 7.04%
not-sse      70331.99         2.82518         2.57500         7.64700        31.48700     30495.51
not-avx      75284.54         2.66464         2.44700         6.87900        29.82300     32642.91
--------------------------------------------------------------------------------------------------
Key Size: 1MB | Key Count: 64 | Kb/s Change: 3.38%
not-sse      55492.43         3.59713         3.58300         7.03900        31.99900     81125.16
not-avx      57292.43         3.47558         3.45500         6.75100        32.25500     83868.51
--------------------------------------------------------------------------------------------------
Key Size: 10MB | Key Count: 2 | Kb/s Change: -2.69%
not-sse      81376.18         2.43526         2.22300         6.87900        29.05500     10966.71
not-avx      80945.09         2.45337         2.27100         6.71900        29.82300     10671.47
--------------------------------------------------------------------------------------------------
Key Size: 10MB | Key Count: 5 | Kb/s Change: 3.71%
not-sse      77757.44         2.55656         2.33500         7.07100        30.20700     15490.74
not-avx      80644.19         2.45966         2.25500         6.75100        29.56700     16065.83
--------------------------------------------------------------------------------------------------
Key Size: 10MB | Key Count: 16 | Kb/s Change: 3.97%
not-sse      71313.70         2.75470         2.52700         7.16700        29.31100     30990.82
not-avx      74309.48         2.68439         2.46300         6.87900        30.97500     32220.13
--------------------------------------------------------------------------------------------------
Key Size: 10MB | Key Count: 64 | Kb/s Change: 4.03%
not-sse      54473.34         3.66585         3.63100         7.45500        32.25500     79422.55
not-avx      56517.59         3.53304         3.50300         7.19900        32.38300     82623.86
--------------------------------------------------------------------------------------------------

===============================================diff===============================================
Key Size: 32B | Key Count: 2 | Kb/s Change: 8.65%
diff-sse      80907.44         2.47076         2.36700         5.37500        29.56700      6952.98
diff-avx      87909.81         2.26510         2.15900         5.18300        27.13500      7554.75
--------------------------------------------------------------------------------------------------
Key Size: 32B | Key Count: 5 | Kb/s Change: 7.75%
diff-sse      77877.60         2.55517         2.49500         5.50300        29.43900     11636.01
diff-avx      84466.09         2.36048         2.28700         5.18300        26.62300     12537.94
--------------------------------------------------------------------------------------------------
Key Size: 32B | Key Count: 16 | Kb/s Change: 6.78%
diff-sse      70430.73         2.83577         2.76700         5.11900        26.75100     27305.67
diff-avx      75398.00         2.64711         2.57500         4.54300        24.70300     29157.82
--------------------------------------------------------------------------------------------------
Key Size: 32B | Key Count: 64 | Kb/s Change: 4.26%
diff-sse      45914.14         4.34861         4.07900         7.42300        28.41500     64880.63
diff-avx      47904.46         4.16897         3.95100         6.14300        27.64700     67646.33
--------------------------------------------------------------------------------------------------
Key Size: 1KB | Key Count: 2 | Kb/s Change: 7.70%
diff-sse      79081.13         2.52983         2.41500         5.47100        28.67100      6950.49
diff-avx      85170.56         2.35189         2.23900         5.18300        28.15900      7485.69
--------------------------------------------------------------------------------------------------
Key Size: 1KB | Key Count: 5 | Kb/s Change: 5.29%
diff-sse      75180.44         2.65963         2.68700         5.34300        29.43900     11453.27
diff-avx      80706.35         2.46640         2.46300         5.11900        27.39100     12058.66
--------------------------------------------------------------------------------------------------
Key Size: 1KB | Key Count: 16 | Kb/s Change: 8.52%
diff-sse      64093.49         3.11737         2.91100         4.70300        26.49500     24911.34
diff-avx      69553.69         2.87282         2.68700         4.35100        24.70300     27033.56
--------------------------------------------------------------------------------------------------
Key Size: 1KB | Key Count: 64 | Kb/s Change: 17.97%
diff-sse      35437.70         5.63932         5.50300         9.02300        30.71900     49868.87
diff-avx      41459.94         4.81017         4.63900         6.97500        28.67100     58829.39
--------------------------------------------------------------------------------------------------
Key Size: 50KB | Key Count: 2 | Kb/s Change: 32.88%
diff-sse      43090.41         4.63899         4.28700         7.07100        28.92700      3829.32
diff-avx      58545.70         3.40921         3.15100         4.95900        25.34300      5088.44
--------------------------------------------------------------------------------------------------
Key Size: 50KB | Key Count: 5 | Kb/s Change: 67.22%
diff-sse      27614.10         7.24419         7.35900        15.48700        33.02300      4206.84
diff-avx      45882.01         4.35332         4.25500         6.17500        27.13500      7034.64
--------------------------------------------------------------------------------------------------
Key Size: 50KB | Key Count: 16 | Kb/s Change: 134.21%
diff-sse       8775.30        22.78484        25.72700        44.03100        57.08700      3393.57
diff-avx      20449.56         9.77241        10.43100        21.63100        36.60700      7948.17
--------------------------------------------------------------------------------------------------
Key Size: 50KB | Key Count: 64 | Kb/s Change: 69.39%
diff-sse       1838.20       109.07980       122.36700       157.69500       172.03100      2595.74
diff-avx       3107.32        64.26005        70.65500        94.71900       106.49500      4396.97
--------------------------------------------------------------------------------------------------
Key Size: 1MB | Key Count: 2 | Kb/s Change: 11.67%
diff-sse       4033.96        49.55554        58.87900        81.91900        99.83900       366.37
diff-avx       4504.66        44.38901        50.94300        73.21500        90.62300       409.11
--------------------------------------------------------------------------------------------------
Key Size: 1MB | Key Count: 5 | Kb/s Change: 41.11%
diff-sse       1995.25       100.48312       118.78300       153.59900       168.95900       309.81
diff-avx       2851.25        70.23851        80.89500       105.47100       120.83100       437.16
--------------------------------------------------------------------------------------------------
Key Size: 1MB | Key Count: 16 | Kb/s Change: 111.27%
diff-sse        453.06       441.75977       450.55900       606.20700       692.22300       176.53
diff-avx        957.14       209.01068       235.51900       284.67100       319.48700       372.95
--------------------------------------------------------------------------------------------------
Key Size: 1MB | Key Count: 64 | Kb/s Change: 24.79%
diff-sse         59.71      3349.52287      3391.48700      3719.16700      3833.85500        84.67
diff-avx         74.42      2687.76778      2637.82300      3211.26300      3276.79900       105.66
--------------------------------------------------------------------------------------------------
Key Size: 10MB | Key Count: 2 | Kb/s Change: -11.87%
diff-sse        123.82      1615.57377      1630.20700      1736.70300      1802.23900        11.37
diff-avx        112.73      1775.13005      1785.85500      1998.84700      2031.61500        10.02
--------------------------------------------------------------------------------------------------
Key Size: 10MB | Key Count: 5 | Kb/s Change: 0.00%
diff-sse         86.39      2315.31256      2342.91100      2490.36700      2588.67100        13.50
diff-avx         86.43      2314.18766      2342.91100      2473.98300      2555.90300        13.50
--------------------------------------------------------------------------------------------------
Key Size: 10MB | Key Count: 16 | Kb/s Change: 39.01%
diff-sse         32.53      6148.19340      6193.15100      6651.90300      6848.51100        12.74
diff-avx         45.33      4411.66135      4456.44700      5013.50300      5144.57500        17.71
--------------------------------------------------------------------------------------------------
Key Size: 10MB | Key Count: 64 | Kb/s Change: 16.38%
diff-sse          5.27     37962.40208     38010.87900     39845.88700     39845.88700         7.45
diff-avx          6.11     32738.07991     32899.07100     34078.71900     34078.71900         8.67
--------------------------------------------------------------------------------------------------

===============================================one================================================
Key Size: 32B | Key Count: 2 | Kb/s Change: 8.98%
one-sse      80929.17         2.46566         2.36700         5.34300        29.82300      6796.79
one-avx      88195.69         2.26202         2.15900         5.21500        26.75100      7407.06
--------------------------------------------------------------------------------------------------
Key Size: 32B | Key Count: 5 | Kb/s Change: 7.76%
one-sse      77831.11         2.56659         2.51100         5.53500        28.28700     11477.05
one-avx      84426.43         2.36002         2.30300         5.15100        26.49500     12367.15
--------------------------------------------------------------------------------------------------
Key Size: 32B | Key Count: 16 | Kb/s Change: 7.64%
one-sse      70298.50         2.84904         2.76700         4.60700        26.75100     27117.10
one-avx      75861.22         2.65415         2.55900         4.22300        25.21500     29188.79
--------------------------------------------------------------------------------------------------
Key Size: 32B | Key Count: 64 | Kb/s Change: 5.79%
one-sse      45177.24         4.42994         4.19100         6.68700        28.54300     63751.08
one-avx      47827.53         4.18078         3.95100         6.14300        27.64700     67444.29
--------------------------------------------------------------------------------------------------
Key Size: 1KB | Key Count: 2 | Kb/s Change: 8.23%
one-sse      77997.32         2.55545         2.51100         5.50300        28.92700      6702.89
one-avx      84416.14         2.36085         2.25500         5.18300        27.00700      7254.51
--------------------------------------------------------------------------------------------------
Key Size: 1KB | Key Count: 5 | Kb/s Change: 8.50%
one-sse      73802.20         2.69269         2.68700         5.08700        27.77500     11099.16
one-avx      81666.60         2.44363         2.46300         4.89500        28.15900     12042.63
--------------------------------------------------------------------------------------------------
Key Size: 1KB | Key Count: 16 | Kb/s Change: 14.69%
one-sse      60338.63         3.31359         3.05500         4.95900        26.23900     23334.08
one-avx      69203.42         2.89049         2.70300         4.35100        25.08700     26762.26
--------------------------------------------------------------------------------------------------
Key Size: 1KB | Key Count: 64 | Kb/s Change: 49.42%
one-sse      27776.05         7.21193         7.00700        15.48700        33.79100     39032.94
one-avx      41158.37         4.84902         4.70300         6.97500        28.67100     58321.09
--------------------------------------------------------------------------------------------------
Key Size: 50KB | Key Count: 2 | Kb/s Change: 79.78%
one-sse      31997.16         6.24368         6.11100        11.71100        31.74300      2781.00
one-avx      58845.36         3.39457         3.13500         4.92700        25.34300      4999.56
--------------------------------------------------------------------------------------------------
Key Size: 50KB | Key Count: 5 | Kb/s Change: 164.27%
one-sse      16952.62        11.76868        12.67100        26.23900        40.95900      2549.52
one-avx      44511.34         4.49427         4.41500         6.36700        27.77500      6737.56
--------------------------------------------------------------------------------------------------
Key Size: 50KB | Key Count: 16 | Kb/s Change: 231.65%
one-sse       5593.25        35.78528        40.44700        63.48700        79.35900      2152.09
one-avx      18456.29        10.90667        11.71100        24.06300        38.65500      7137.39
--------------------------------------------------------------------------------------------------
Key Size: 50KB | Key Count: 64 | Kb/s Change: 159.71%
one-sse       1169.06       171.27199       190.46300       232.44700       260.09500      1648.56
one-avx       3029.90        66.26502        72.19100        99.83900       112.63900      4281.51
--------------------------------------------------------------------------------------------------
Key Size: 1MB | Key Count: 2 | Kb/s Change: 77.73%
one-sse       2508.19        79.75557        95.23100       122.36700       138.23900       222.90
one-avx       4457.84        45.02636        51.71100        74.23900        91.13500       396.16
--------------------------------------------------------------------------------------------------
Key Size: 1MB | Key Count: 5 | Kb/s Change: 156.68%
one-sse       1054.08       189.72828       216.06300       268.28700       299.00700       161.61
one-avx       2740.47        73.10304        84.47900       108.54300       123.39100       414.82
--------------------------------------------------------------------------------------------------
Key Size: 1MB | Key Count: 16 | Kb/s Change: 221.37%
one-sse        269.83       740.54894       745.47100      1023.99900      1171.45500       104.61
one-avx        867.15       231.03763       258.04700       315.39100       356.35100       336.19
--------------------------------------------------------------------------------------------------
Key Size: 1MB | Key Count: 64 | Kb/s Change: 87.29%
one-sse         35.78      5591.01976      5537.79100      6160.38300      6258.68700        50.66
one-avx         66.91      2988.75783      3014.65500      3260.41500      3342.33500        94.88
--------------------------------------------------------------------------------------------------
Key Size: 10MB | Key Count: 2 | Kb/s Change: -2.10%
one-sse        105.95      1887.98901      1892.35100      2392.06300      2490.36700         9.52
one-avx        107.29      1864.13716      1867.77500      2031.61500      2080.76700         9.32
--------------------------------------------------------------------------------------------------
Key Size: 10MB | Key Count: 5 | Kb/s Change: 38.18%
one-sse         61.10      3273.64276      3309.56700      3440.63900      3522.55900         9.43
one-avx         84.46      2368.37358      2392.06300      2555.90300      2654.20700        13.03
--------------------------------------------------------------------------------------------------
Key Size: 10MB | Key Count: 16 | Kb/s Change: 91.56%
one-sse         22.19      9011.70217      9109.50300      9633.79100      9830.39900         8.65
one-avx         42.62      4692.01279      4751.35900      5275.64700      5373.95100        16.57
--------------------------------------------------------------------------------------------------
Key Size: 10MB | Key Count: 64 | Kb/s Change: 92.89%
one-sse          3.09     64819.41801     64749.56700     70254.59100     70254.59100         4.36
one-avx          5.94     33712.70823     33816.57500     36700.15900     36700.15900         8.41
--------------------------------------------------------------------------------------------------

Repro
As above comment.

@tezc
Copy link
Collaborator

tezc commented Apr 17, 2025

@minchopaskal I tried XOR, OR, AND on my local, 2 keys, each can be any size, 100kb, 1mb etc.

This is what I see performance wise:
BITOP_DISABLE_AVX=1 > redis unstable > BITOP_DISABLE_AVX=0

It feels like this PR changed something about how we loop and it helped with the performance even without AVX. Also, somehow AVX makes it slower on my local (I have i9-9880H).

Did you compare it with unstable branch even without AVX? Perhaps, you can even try it on your local

@minchopaskal
Copy link
Collaborator Author

@minchopaskal I tried XOR, OR, AND on my local, 2 keys, each can be any size, 100kb, 1mb etc.

This is what I see performance wise: BITOP_DISABLE_AVX=1 > redis unstable > BITOP_DISABLE_AVX=0

It feels like this PR changed something about how we loop and it helped with the performance even without AVX. Also, somehow AVX makes it slower on my local (I have i9-9880H).

Did you compare it with unstable branch even without AVX? Perhaps, you can even try it on your local

I did notice degradation with 2 keys, but only for large ones. Will try on local

@minchopaskal
Copy link
Collaborator Author

@tezc after we tested together and saw no actual degradation I redid the tests yet again on AWS JIC.
Ran 3 server - 1 unstable, 1 current branch with BITOP_DISABLE_AVX=1 on port 5002 and 1 on current branch on port 5003

Then for N=[32, 1000, 10000, 100000, 1000000, 10000000]

$ ./src/redis-cli flushall && \
./src/redis-cli -p 5002 flushall && \
./src/redis-cli -p 5003 flushall && \
./src/redis-cli debug populate 2 x N && \
./src/redis-cli -p 5002 debug populate 2 x N && \
./src/redis-cli -p 5003 debug populate 2 x N

$ memtier_benchmark --command="bitop and __key__ x:0 x:1" --hide-histogram --test-time 60 && \
memtier_benchmark --command="bitop and __key__ x:0 x:1" --hide-histogram --test-time 60 --port 5002 && \
memtier_benchmark --command="bitop and __key__ x:0 x:1" --hide-histogram --test-time 60 -- port 5003

There is no degradation between unstable and current branch with BITOP_DISABLE_AVX=1
There is also no degradation with AVX, although it shows no significant optimization for 2 keys either.

Basically, I feel confident this PR is ready @tezc @sundb

Copy link

snyk-io bot commented Apr 25, 2025

🎉 Snyk checks have passed. No issues have been found so far.

security/snyk check is complete. No issues have been found. (View Details)

license/snyk check is complete. No issues have been found. (View Details)

@sundb sundb removed this from Redis Triage May 13, 2025
@sundb sundb added this to Redis 8.2 May 13, 2025
@sundb sundb added release-notes indication that this issue needs to be mentioned in the release notes state:needs-doc-pr requires a PR to redis-doc repository labels May 17, 2025
@sundb sundb requested a review from Copilot May 19, 2025 06:11
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enhances the BITOP command by adding four new operators—DIFF, DIFF1, ANDOR, and ONE—to allow more expressive bitmap operations.

  • Introduces new evaluation logic in the bit manipulation loop for the new operators.
  • Updates the BITOP command configuration in JSON and command definitions to support the additional tokens.
  • Adjusts and expands test cases to validate the behavior of all BITOP operations.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
tests/unit/bitops.tcl Updated tests and simulation logic for the new BITOP operators.
src/commands/bitop.json Added definitions for the new operators in the commands JSON file.
src/commands.def Extended the BITOP command argument configuration to support more tokens.
Comments suppressed due to low confidence (1)

tests/unit/bitops.tcl:266

  • The key name 'no-such_key' is inconsistent with the rest of the tests that use 'no-such-key'. Consider renaming it to 'no-such-key' for consistency.
r bitop one   res7{t} no-such_key{t} a{t}

Copy link
Collaborator

@sundb sundb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-notes indication that this issue needs to be mentioned in the release notes state:needs-doc-pr requires a PR to redis-doc repository
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants