cjdb added a comment.

Looking at the output from Clang 14 <https://godbolt.org/z/5rjxa5nTT>, I'm 
observing that a binary with 178 function templates is 13% the size of the one 
with 89 function objects. When only one function object is used vs all 178 
function templates, the functions still win out, with the binary being 80% the 
size.

The AST also becomes substantially larger.

I ran `time clang++-13 -c file.cpp -std=c++20 -Oz -DNDEBUG` locally, a hundred 
times, and got the following results:

  # Function objects
  real mean:    0.07447
  real median:  0.074
  real stddev:  0.002267268191
        
  sys mean:     0.01664
  sys median:   0.016
  sys stddev:   0.005569614534
        
  user mean:    0.05785
  user median:  0.057
  user stddev:  0.005848896987

  # Function templates
  real mean:    0.06336
  real median:  0.063
  real stddev:  0.002076905235
        
  sys mean:     0.01701
  sys median:   0.017
  sys stddev:   0.005545942188
        
  user mean:    0.04645
  user median:  0.047
  user stddev:  0.005678908346


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D129951

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
  • [PATCH] D129951: ... Christopher Di Bella via Phabricator via cfe-commits
    • [PATCH] D129... Christopher Di Bella via Phabricator via cfe-commits
    • [PATCH] D129... Christopher Di Bella via Phabricator via cfe-commits
    • [PATCH] D129... Christopher Di Bella via Phabricator via cfe-commits
    • [PATCH] D129... Christopher Di Bella via Phabricator via cfe-commits
    • [PATCH] D129... Richard Smith - zygoloid via Phabricator via cfe-commits
    • [PATCH] D129... Christopher Di Bella via Phabricator via cfe-commits

Reply via email to