[all-commits] [llvm/llvm-project] 182443: Cache memory buffer's name length

serge-sans-paille via All-commits all-commits at lists.llvm.org
Tue Nov 29 05:01:23 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1824432174b3166b40bce59477beb5821170748e
      https://github.com/llvm/llvm-project/commit/1824432174b3166b40bce59477beb5821170748e
  Author: serge-sans-paille <sguelton at mozilla.com>
  Date:   2022-11-29 (Tue, 29 Nov 2022)

  Changed paths:
    M llvm/lib/Support/MemoryBuffer.cpp

  Log Message:
  -----------
  Cache memory buffer's name length

This avoids repeated calls to strlen while we already know its value.

When preprocessing sqlite3.c, this gives a surprising 2% speedup.

Full benchmark available here: https://llvm-compile-time-tracker.com/compare.php?from=5279e6a7d677cdf4488883b77aacab911318100c&to=389601b0dbdf23cf25167ddfc49b3af5742ebd9a&stat=instructions:u

Differential Revision: https://reviews.llvm.org/D138555




More information about the All-commits mailing list