Skip to content

Improve DeltaTree update routine #5200

@SchrodingerZhu

Description

@SchrodingerZhu

Enhancement

On DeltaTree update routine (afterNodeUpdated), the call to getDelta() can be effectively translated by the compiler to SIMD memory scanning.

image

Since compiler has already decides that afterNodeUpdated is too large to be inlined, we can actually dispatch this function to multiple targets. Indeed, it enjoys different codegen for avx targets:

image

Experiments have shown that, it can provide up to 12% speed up at IDC environment:

2022-06-23T08:53:15+08:00
Running dbms/src/Storages/DeltaMerge/Benchmark/bench_deltatree
Run on (40 X 2394.97 MHz CPU s)
CPU Caches:
  L1 Data 32 KiB (x20)
  L1 Instruction 32 KiB (x20)
  L2 Unified 256 KiB (x20)
  L3 Unified 25600 KiB (x2)
Load Average: 8.91, 23.44, 19.41
------------------------------------------------------------------------------------------------
Benchmark                                                      Time             CPU   Iterations
------------------------------------------------------------------------------------------------
BM_deltatree_dispatch<true>/iterations:50/threads:40     1764554 ns     59946595 ns         2000
BM_deltatree_dispatch<false>/iterations:50/threads:40    1553962 ns     55583999 ns         2000

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/enhancementThe issue or PR belongs to an enhancement.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions