Download presentation
Presentation is loading. Please wait.
Published byVictor Terry Modified over 9 years ago
1
SDD/DFS Jonas M. Larsen VLT 2 nd Generation Instrumentation Pipelines, 19 Apr 2007 - 1 Jonas M. Larsen Memory debugging Recipe profiling
2
SDD/DFS Jonas M. Larsen VLT 2 nd Generation Instrumentation Pipelines, 19 Apr 2007 - 2 Memory debugging valgrind > valgrind a.out
3
SDD/DFS Jonas M. Larsen VLT 2 nd Generation Instrumentation Pipelines, 19 Apr 2007 - 3 Memory debugging valgrind Memory errors sometimes make programs crash. Other times they don't! Use a memory debugger regularly (valgrind, gdb,...)
4
SDD/DFS Jonas M. Larsen VLT 2 nd Generation Instrumentation Pipelines, 19 Apr 2007 - 4 Profiling Reasons to optimize The pipeline must process at about the same speed as observations are performed Trade-off: Science quality vs. execution speed Reasons not to optimize “slow” can be “fast enough” Trade-off: CPU cycles vs. human brain cycles Trade-off: Design vs. speed Measure before you optimize!
5
SDD/DFS Jonas M. Larsen VLT 2 nd Generation Instrumentation Pipelines, 19 Apr 2007 - 5 Profiling profile_build > profile_build -qfitssrc=~/qfits-6.2.0 -cplsrc=~/cpl-3.1.0 - esorexsrc=~/esorex-3.6.1 -iiinstrumentsrc=~/xshp -builddir=~/BUILD - iiinstrumentlib=xsh xsh_mbias > ~/BUILD/bin/esorex xsh_mbias xsh_mbias.sof > gprof ~/BUILD/bin/esorex > gcov my_source_file.c
6
SDD/DFS Jonas M. Larsen VLT 2 nd Generation Instrumentation Pipelines, 19 Apr 2007 - 6 Profiling GCC gprof GCC gprof
7
SDD/DFS Jonas M. Larsen VLT 2 nd Generation Instrumentation Pipelines, 19 Apr 2007 - 7 Profiling GCC gcov Use profiling tools (gprof, gcov, Shark,...) GCC gcov
8
SDD/DFS Jonas M. Larsen VLT 2 nd Generation Instrumentation Pipelines, 19 Apr 2007 - 8 Profiling Asymptotic time complexity Example: Looping through a FITS header O(n^3) O(n^2) O(n)
9
SDD/DFS Jonas M. Larsen VLT 2 nd Generation Instrumentation Pipelines, 19 Apr 2007 - 9 Profiling Constant factor optimization Measure before you optimize!
10
SDD/DFS Jonas M. Larsen VLT 2 nd Generation Instrumentation Pipelines, 19 Apr 2007 - 10 Profiling If n is large, be careful about... Reference: http://www.eso.org/~jmlarsen/pipeline
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.