• source navigation  • diff markup  • identifier search  • freetext search  • 

Sources/json-c/bench/README.bench.md

  1 
  2 Benchmark tests for json-c
  3 
  4 General strategy:
  5 -------------------
  6 
  7 * Identify "after" commit hash
  8     * Use provided directory
  9     * Use provided commit hash
 10     * Local changes in current working directory
 11     * ${cur_branch}
 12 * Identify "before" commit hash, in order of preference
 13     * Use provided directory
 14     * Use provided commit hash
 15     * Use origin/${cur_branch}, if different from ${after_commit}
 16     * Use previous release
 17 
 18 * If not using existing dir, clone to src-${after_commit}
 19     * or, checkout appropriate commit in existing src-${after_commit}
 20 * Create build & install dirs for ${after_commit}
 21 * Build & install ${after_commit}
 22 * Compile benchmark programs against install-${after_commit}
 23 
 24 * If not using existing dir, clone to src-${before_commit}
 25     * or, checkout appropriate commit in existing src-${before_commit}
 26 * Create build & install dirs for ${before_commit}
 27 * Build & install ${before_commit}
 28 * Compile benchmark programs against install-${before_commit}
 29 
 30 * Run benchmark in each location
 31 * Compare results
 32 
 33 heaptrack memory profiler
 34 ---------------------------
 35 
 36 https://milianw.de/blog/heaptrack-a-heap-memory-profiler-for-linux.html
 37 
 38 
 39 ```
 40 yum install libdwarf-devel elfutils boost-devel libunwind-devel
 41 
 42 git clone git://anongit.kde.org/heaptrack
 43 cd heaptrack
 44 mkdir build
 45 cd build
 46 cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo \
 47         -DCMAKE_INSTALL_PREFIX=$HOME/heaptrack-install ..
 48 make install
 49 ```
 50 
 51 
 52 Issues
 53 --------
 54 
 55 * jc-bench.sh is incomplete.
 56 
 57 * valgrind massif misreports "extra-heap" bytes?
 58 
 59     "json_parse -n canada.json" shows 38640 KB maxrss.
 60 
 61     Using valgrind --tool=massif, a large amount of memory is listed as
 62      wasted "extra-heap" bytes.  (~5.6MB)
 63 
 64     ```
 65     valgrind --tool=massif --massif-out-file=massif.out ./json_parse -n ~/canada.json
 66     ms_print massif.out
 67     ```
 68 
 69 
 70     Using heaptrack, and analyzing the histogram, only shows ~2.6MB
 71     ```
 72     heaptrack ./json_parse -n canada.json
 73     heaptrack --analyze heaptrack*gz -H histgram.out
 74     awk ' { s=$1; count=$2; ru=(int((s+ 15) / 16)) * 16; wasted = ((ru-s)*count); print s, count, ru-s, wasted; total=total+wasted} END { print "Total: ", total }' histogram.out
 75     ```
 76 
 77  With the (unreleased) arraylist trimming changes, maxrss reported by
 78   getrusage() goes down, but massif claims *more* total usage, and a HUGE 
 79   extra-heap amount (50% of total).
 80 

This page was automatically generated by LXR 0.3.1.  •  OpenWrt