Uploaded image for project: 'WiredTiger'
  1. WiredTiger
  2. WT-12776

Investigate performance improvements from using always_inline function attribute

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Storage Engines
    • StorEng - Defined Pipeline

      The "inline" keyword nowadays is advisory and is ignored by all compilers. They choose whether to inline functions based on their internal heuristics. We use this keyword solely for its side effect - suppressing warnings about unused static functions.

      We sometimes split big functions into several pieces for better code arrangement / clarity / readability. Some function calls happen in a critical code path. We need to make sure that such functions do get inlined by the compiler.

      I ran a test where I changed the "WT_INLINE" macro to "inline __attribute__((always_inline))" and got 15% improvement on a wtperf workload (evict-btree-stress-multi.wtperf with cache_size=15G).

      This ticket is to investigate if direct indications for inlining some (or many) functions get us better performance in complex workloads like sys-perf.

            Assignee:
            backlog-server-storage-engines [DO NOT USE] Backlog - Storage Engines Team
            Reporter:
            y.ershov@mongodb.com Yury Ershov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: