Skip to content

Add benchmark coverage for LSET (list element replacement path) #422

Description

@fcostaoliveira

The list group covers RPUSH/LPUSH/LPOP/RPOP/LRANGE/LLEN/LINDEX/LINSERT/LREM/LPOS/LMOVE/RPOPLPUSH today, but there is no benchmark exercising LSET. Grepping the spec directory:

$ grep -rliE '\blset\b' redis_benchmarks_specification/test-suites/
(no results)

LSET is the canonical "in-place element replacement" command on a list, and its implementation in t_list.c:lsetCommand runs an encoding-conversion call on every invocation (listpack ↔ quicklist), so its per-op cost is non-trivial and a regression in that path is currently invisible to the suite.

Suggested coverage, in increasing scope:

  1. Mid-sized listpack, LSET in place — replace at index 0 with a same-sized small value. Covers the "no encoding change" hot path on listpack.
  2. Listpack growing into quicklist on LSET — replace a small element with a value above list-max-listpack-size (default −2, so ~8 KiB), forcing a one-shot conversion. Covers the GROWING branch.
  3. Quicklist LSET with potential shrink — pre-load a quicklist (large value or many elements), then LSET-in a small value to exercise the SHRINKING branch in listTypeTryConversion.

A natural shape for (1) would mirror the existing memtier_benchmark-1key-list-100-elements-lrange-all-elements-pipeline-10-style spec but use --command "LSET __key__ __key__ __data__" instead of LRANGE. Suite-wide, three specs at typical priorities should be enough to land LSET in the regular CE-Performance run.

Happy to follow up with the YAML if helpful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions