[PATCH] D24991: Inline hot functions in libcxx shared_ptr implementation.

Kevin Hu via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 12 15:17:54 PDT 2016


hxy9243 added a comment.

Thanks for pointing out. It's true that it may cause ABI breakage. It would be nice to keep compatibility while getting the performance benefits from inlining.

I've tested the patch with google-benchmark/util_smartptr_libcxx shipped with libcxx on x86_64 server, and attached the results as following:

  BASE libcxx r283113:
  $   taskset -c 23 ./util_smartptr.libcxx.out
  Run on (24 X 1200 MHz CPU s)
  2016-10-12 13:52:03
  ***WARNING*** CPU scaling is enabled, the benchmark real time measurements may be noisy and will incur extra overhead.
  Benchmark                          Time           CPU Iterations
  ----------------------------------------------------------------
  BM_SharedPtrCreateDestroy         54 ns         54 ns   12388755
  BM_SharedPtrIncDecRef             37 ns         37 ns   19021739
  BM_WeakPtrIncDecRef               38 ns         38 ns   18421053
   
  
  
  libcxx with patch:
  $   taskset -c 23 ./util_smartptr.libcxx.out
  Run on (24 X 1200 MHz CPU s)
  2016-10-12 13:48:38
  ***WARNING*** CPU scaling is enabled, the benchmark real time measurements may be noisy and will incur extra overhead.
  Benchmark                          Time           CPU Iterations
  ----------------------------------------------------------------
  BM_SharedPtrCreateDestroy         44 ns         44 ns   14730639
  BM_SharedPtrIncDecRef             18 ns         18 ns   38888889
  BM_WeakPtrIncDecRef               30 ns         30 ns   23648649


Repository:
  rL LLVM

https://reviews.llvm.org/D24991





More information about the cfe-commits mailing list