Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
  • This project
    • Loading...
  • Sign in / Register
B
benchmark
  • Project
    • Overview
    • Details
    • Activity
    • Cycle Analytics
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
  • Issues 0
    • Issues 0
    • List
    • Board
    • Labels
    • Milestones
  • Merge Requests 0
    • Merge Requests 0
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Charts
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Chen Yisong
  • benchmark
  • Repository

Switch branch/tag
  • benchmark
  • src
  • statistics.h
Find file
BlameHistoryPermalink
  • Roman Lebedev's avatar
    Drop Stat1, refactor statistics to be user-providable, add median. (#428) · a271c36a
    Roman Lebedev authored Aug 24, 2017
    * Drop Stat1, refactor statistics to be user-providable, add median.
    
    My main goal was to add median statistic. Since Stat1
    calculated the stats incrementally, and did not store
    the values themselves, it is was not possible. Thus,
    i have replaced Stat1 with simple std::vector<double>,
    containing all the values.
    
    Then, i have refactored current mean/stdev to be a
    function that is provided with values vector, and
    returns the statistic. While there, it seemed to make
    sense to deduplicate the code by storing all the
    statistics functions in a map, and then simply iterate
    over it. And the interface to add new statistics is
    intentionally exposed, so they may be added easily.
    
    The notable change is that Iterations are no longer
    displayed as 0 for stdev. Is could be changed, but
    i'm not sure how to nicely fit that into the API.
    
    Similarly, this dance about sometimes (for some fields,
    for some statistics) dividing by run.iterations, and
    then multiplying the calculated stastic back is also
    dropped, and if you do the math, i fail to see why
    it was needed there in the first place.
    
    Since that was the only use of stat.h, it is removed.
    
    * complexity.h: attempt to fix MSVC build
    
    * Update README.md
    
    * Store statistics to compute in a vector, ensures ordering.
    
    * Add a bit more tests for repetitions.
    
    * Partially address review notes.
    
    * Fix gcc build: drop extra ';'
    
    clang, why didn't you warn me?
    
    * Address review comments.
    
    * double() -> 0.0
    * early return
    a271c36a
statistics.h 1.33 KB
EditWeb IDE
×

Replace statistics.h

Attach a file by drag & drop or click to upload


Cancel
A new branch will be created in your fork and a new merge request will be started.