LNCD

Table of Contents

  • LNCD Home
  • Administration
  • Notebooks
  • Journal Club Presentations
  • Publications
  • Current Projects
  • Completed Projects
  • Current Grants
  • Datasets by Project
  • Brain ROIs and Measures
  • ️Tools And Methods
  • Big Data
  • RA Homepage
  • Undergrad Resources
  • Recent Changes
  • Maintenance
  • Site Map
  • Random Page
LNCD
Admin » Usage Profiling and benchmarking

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
tools:usage_profiling [2026/06/01 15:24] – created willtools:usage_profiling [2026/06/01 15:34] (current) – [Shell] will
Line 1: Line 1:
 ====== Usage Profiling and benchmarking ====== ====== Usage Profiling and benchmarking ======
 +===== Shell =====
  
 ''/usr/bin/time'' ((**NB.** not bash built-in ''time'', need explicit path)) can report total run time ("clock on the wall") and memory (''RSS'' = Resident Set Size)  ''/usr/bin/time'' ((**NB.** not bash built-in ''time'', need explicit path)) can report total run time ("clock on the wall") and memory (''RSS'' = Resident Set Size) 
Line 7: Line 8:
 #        Maximum resident set size (kbytes): 1053908 #        Maximum resident set size (kbytes): 1053908
 </code> </code>
 +
 +==== Super Computer Slurm ====
  
 When run with [[:tools:slurm]], eg. [[:tools:psc]] When run with [[:tools:slurm]], eg. [[:tools:psc]]
Line 13: Line 16:
 </code> </code>
  
 +==== hyperfine ====
  
 For smaller jobs, ''hyperfine'' runs many time for a more rigorous estimate. For smaller jobs, ''hyperfine'' runs many time for a more rigorous estimate.
 <code> <code>
 hyperfine 'sleep .5' 'sleep .55' hyperfine 'sleep .5' 'sleep .55'
 +</code> 
 +<code>
 Benchmark 1: sleep .5 Benchmark 1: sleep .5
   Time (mean ± σ):     502.3 ms ±   0.6 ms    [User: 1.6 ms, System: 0.8 ms]   Time (mean ± σ):     502.3 ms ±   0.6 ms    [User: 1.6 ms, System: 0.8 ms]
Line 31: Line 36:
 </code> </code>
  
 +===== R =====
 +[[:tools:R]] can use ''microbenchmark''
 +<code>
 +microbenchmark::microbenchmark(sqrt100 = sqrt(runif(100)))
 +
 +#Unit: microseconds
 +#    expr   min    lq    mean median    uq    max neval
 +# sqrt100 5.769 5.911 6.82513  6.071 6.445 46.451   100
 +</code>
 +
 +===== python =====
 +<code python>
 +import timeit
 +timeit.timeit('numpy.sqrt(numpy.random.uniform(size=100))',
 +              setup='import numpy')
 +# 3.9988546459935606
 +</code>