[PATCH] D140841: [DWARFLinkerNext] Add StringPool class.

Alexey Lapshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 9 03:01:23 PST 2023


avl added a comment.

In D140841#4026757 <https://reviews.llvm.org/D140841#4026757>, @JDevlieghere wrote:

> I'm definitely curious to hear how the two compare in terms of performance. I suppose it shouldn't be too hard to build ConstString on top of this if it turns out to be faster.

@JDevlieghere here is the result of performance comparison. All runs insert 100000000 strings produced from corresponding integer. Also ConcurrentHashTable pool measured with setting initial size. lldb pool does not have this feature.

  -------------------------------------------------------------------
                |      lldb-pool      |   ConcurrentHashTable pool  |
  -------------------------------------------------------------------
                |                     |                             |
    threads 1   | time:     22sec     | time:       19.7sec         |
                | mem:       5G       |  mem:        6.7G           |
                |                     |                             |
  -------------------------------------------------------------------
                |                     |                             |
    threads 16  | time:     4.2sec    | time:        3.5sec         |
                | mem:       5G       |  mem:        6.7G           |
                |                     |                             |
  -------------------------------------------------------------------
                |                     |                             |
   initial-size |                     |                             |
     100000000  |                     | time:       10.5sec         |
                |                     |  mem:        6.0G           |
    threads 1   |                     |                             |
                |                     |                             |
  -------------------------------------------------------------------
                |                     |                             |
   initial-size |                     |                             |
     100000000  |                     | time:        2.1sec         |
                |                     |  mem:        6.0G           |
    threads 16  |                     |                             |
                |                     |                             |
  -------------------------------------------------------------------

ConcurrentHashTable works faster, though it requires more memory.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D140841/new/

https://reviews.llvm.org/D140841



More information about the llvm-commits mailing list