diff options
| author | Seiya Nuta <nuta@seiya.me> | 2019-07-25 06:38:27 +0000 | 
|---|---|---|
| committer | Seiya Nuta <nuta@seiya.me> | 2019-07-25 06:38:27 +0000 | 
| commit | d5177643f0e16264a5e09b85dcafb9069db4abf5 (patch) | |
| tree | 57a766d8a4868512b427322d651d9f58a0dcff9f /clang/test/CodeGenCXX/2009-03-17-dbg.cpp | |
| parent | 5b406d7058bfc50db291ef435d28843bb9d5c5f3 (diff) | |
| download | bcm5719-llvm-d5177643f0e16264a5e09b85dcafb9069db4abf5.tar.gz bcm5719-llvm-d5177643f0e16264a5e09b85dcafb9069db4abf5.zip | |
[llvm-objdump][NFC] Make the PrettyPrinter::printInst() output buffered
Summary:
Every time PrettyPrinter::printInst is called, stdout is flushed and it makes llvm-objdump slow. This patches adds a string
buffer to prevent stdout from being flushed.
Benchmark results (./llvm-objdump-master: without this patch,  ./bin/llvm-objcopy: with this patch):
  $ hyperfine --warmup 10 './llvm-objdump-master -d ./bin/llvm-objcopy' './bin/llvm-objdump -d ./bin/llvm-objcopy'
  Benchmark #1: ./llvm-objdump-master -d ./bin/llvm-objcopy
    Time (mean ± σ):      2.230 s ±  0.050 s    [User: 1.533 s, System: 0.682 s]
    Range (min … max):    2.115 s …  2.278 s    10 runs
  Benchmark #2: ./bin/llvm-objdump -d ./bin/llvm-objcopy
    Time (mean ± σ):     386.4 ms ±  13.0 ms    [User: 376.6 ms, System: 6.1 ms]
    Range (min … max):   366.1 ms … 407.0 ms    10 runs
  Summary
    './bin/llvm-objdump -d ./bin/llvm-objcopy' ran
      5.77 ± 0.23 times faster than './llvm-objdump-master -d ./bin/llvm-objcopy'
Reviewers: alexshap, Bigcheese, jhenderson, rupprecht, grimar, MaskRay
Reviewed By: jhenderson, MaskRay
Subscribers: dexonsmith, jhenderson, javed.absar, kristof.beyls, rupprecht, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D64969
llvm-svn: 366984
Diffstat (limited to 'clang/test/CodeGenCXX/2009-03-17-dbg.cpp')
0 files changed, 0 insertions, 0 deletions

