[all-commits] [llvm/llvm-project] e89993: [Coverage] Speed up function record iteration (#12...

Mike Hommey via All-commits all-commits at lists.llvm.org
Thu Jan 16 22:56:33 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e8999309f16a248cb14ac09bc1f256cbf202f475
      https://github.com/llvm/llvm-project/commit/e8999309f16a248cb14ac09bc1f256cbf202f475
  Author: Mike Hommey <mh at glandium.org>
  Date:   2025-01-17 (Fri, 17 Jan 2025)

  Changed paths:
    M llvm/include/llvm/ProfileData/Coverage/CoverageMapping.h
    M llvm/lib/ProfileData/Coverage/CoverageMapping.cpp

  Log Message:
  -----------
  [Coverage] Speed up function record iteration (#122050)

When iterating over function records, filtered by file name, currently,
the iteration goes over all the function records, repeatedly for each
source file, essentially giving quadratic behavior.

413647d730972eac9675f695c2ea63fb393a5531 sped up some cases by keeping
track of the indices of the function records corresponding to each file
name. This change expands the use of that map to FunctionRecordIterator.

On a test case with Firefox's libxul.so and a 2.5MB profile, this brings
down the runtime of `llvm-cov export $lib --instr-profile $prof -t lcov`
from 12 minutes with 90% spent in skipOtherFiles to 19 seconds with no
samples in skipOtherFiles at all under a sampling profiler (with a
sampling interval of 1ms).

Fixes #62079



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list