[all-commits] [llvm/llvm-project] 69cb99: [DebugNames] Use hashes to quickly filter false po...

Felipe de Azevedo Piovezan via All-commits all-commits at lists.llvm.org
Tue Jan 30 09:44:54 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 69cb99f9cb2e8757ad2c09b87fc96d5bff73c490
      https://github.com/llvm/llvm-project/commit/69cb99f9cb2e8757ad2c09b87fc96d5bff73c490
  Author: Felipe de Azevedo Piovezan <fpiovezan at apple.com>
  Date:   2024-01-30 (Tue, 30 Jan 2024)

  Changed paths:
    M llvm/lib/DebugInfo/DWARF/DWARFAcceleratorTable.cpp

  Log Message:
  -----------
  [DebugNames] Use hashes to quickly filter false positives (#79755)

The current implementation of DebugNames is _only_ using hashes to
compute the bucket number. Once inside the bucket, it reverts back to
string comparisons, even though not all hashes inside a bucket are
identical.

This commit changes the behavior so that we check the hash before
comparing strings. Such check is so important that it speeds up a simple
benchmark by 20%. In other words, the following expression evaluation
time goes from 1100ms to 850ms.

```
bin/lldb \
		--batch \
		-o "b CodeGenFunction::GenerateCode" \
		-o run \
		-o "expr Fn" \
		-- \
		clang++ -c -g test.cpp -o /dev/null &> output
```

(Note, these numbers are considering the usage of IDX_parent)




More information about the All-commits mailing list