{"id":4391,"date":"2016-05-02T19:40:00","date_gmt":"2016-05-03T01:40:00","guid":{"rendered":"http:\/\/www.realtimerendering.com\/blog\/?p=4391"},"modified":"2016-05-02T19:40:00","modified_gmt":"2016-05-03T01:40:00","slug":"benchmarking-tweets","status":"publish","type":"post","link":"https:\/\/www.realtimerendering.com\/blog\/benchmarking-tweets\/","title":{"rendered":"Benchmarking tweets"},"content":{"rendered":"<p>I asked what others did for benchmarking in <a href=\"http:\/\/www.realtimerendering.com\/blog\/dont-be-mean\/\">my last post<\/a>. Here are the replies on Twitter in a semi-coherent edited form. If I missed any replies, I blame Twitter, whose interface is a magical maze.<\/p>\n<p>First there were some FPS vs. SPF comments:<\/p>\n<p>Richard Mitton: If you&#8217;re not measuring in milliseconds then you&#8217;re doing it wrong.<\/p>\n<p>Christer Ericson: Yes, ms, not FPS. FPS is not a linear unit for the artists (or anyone).<\/p>\n<p>Marc Olano: FPS isn&#8217;t linear. Usual definition of median averages middle 2 for even samples = also wrong. Use ms.<\/p>\n<p>Morgan McGuire notes: FPS *is* a good measure if what you care about is interaction or visual smoothness. SPF is good for computational efficiency.<\/p>\n<p>I replied to Richard &amp; Christer: I&#8217;m interested in your reaction to the use of median vs. mean. FPS vs. SPF irrelevant for relative performance.<\/p>\n<p>I also changed the original post to talk about milliseconds instead of frames, to avoid this facet of the discussion.<\/p>\n<p>Christer Ericson: It&#8217;s important to catch the spikes, so in the context you&#8217;re talking about I would do max. Or mean+variance. Also, don&#8217;t think I&#8217;ve ever, for profiling reasons, looked at any average. You always look at a specific frame.<\/p>\n<p>Timothy Lottes: I&#8217;m personally only interested in worst case ms\/frame.<\/p>\n<p>Cass Everitt: Agree with those that concentrate on worst times.<\/p>\n<p>Eric Haines: Right, it depends what you&#8217;re looking for, e.g. don&#8217;t drop below 60 FPS. I&#8217;m mostly warning against using mean.<\/p>\n<p>I added a note to the original post about tracking the max, which makes sense if you&#8217;re trying to guarantee a frame rate.<\/p>\n<p>Tobias Berghoff, who benchmarks consoles:<\/p>\n<p>I use min\/max\/med the most. Averages really only come into play when I need more digits. I spend significant amount of time below the 0.5% mark when wearing my platform tuning hat. I don&#8217;t miss trying to get sensible numbers out of PC h\/w. But this also comes into play when measuring very short processes. When something only takes a couple of microseconds, you often end up oscillating between states that make the distribution multi-modal. Median won&#8217;t catch small shifts.<\/p>\n<p>cupe: Stacked color-coded graph of nested timings (or a subtree of it). Usually unfiltered for analysis, avg for comparisons. Hierarchy is on the left, tooltip displays e.g. &#8220;scene\/fluid\/poisson&#8221;, click to restrict. Horizontal lines are milliseconds, orange line is 16.6 ms.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4392\" src=\"http:\/\/www.realtimerendering.com\/blog\/wp-content\/uploads\/2016\/05\/cupe1.jpg\" alt=\"cupe1\" width=\"1023\" height=\"412\" srcset=\"https:\/\/www.realtimerendering.com\/blog\/wp-content\/uploads\/2016\/05\/cupe1.jpg 1023w, https:\/\/www.realtimerendering.com\/blog\/wp-content\/uploads\/2016\/05\/cupe1-300x121.jpg 300w, https:\/\/www.realtimerendering.com\/blog\/wp-content\/uploads\/2016\/05\/cupe1-768x309.jpg 768w, https:\/\/www.realtimerendering.com\/blog\/wp-content\/uploads\/2016\/05\/cupe1-500x201.jpg 500w\" sizes=\"auto, (max-width: 1023px) 100vw, 1023px\" \/><\/p>\n<p>E.g. click the big violet bar to see only post (and zoom in to stretch 4ms to screen):<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4393\" src=\"http:\/\/www.realtimerendering.com\/blog\/wp-content\/uploads\/2016\/05\/cupe2.jpg\" alt=\"cupe2\" width=\"1024\" height=\"407\" srcset=\"https:\/\/www.realtimerendering.com\/blog\/wp-content\/uploads\/2016\/05\/cupe2.jpg 1024w, https:\/\/www.realtimerendering.com\/blog\/wp-content\/uploads\/2016\/05\/cupe2-300x119.jpg 300w, https:\/\/www.realtimerendering.com\/blog\/wp-content\/uploads\/2016\/05\/cupe2-768x305.jpg 768w, https:\/\/www.realtimerendering.com\/blog\/wp-content\/uploads\/2016\/05\/cupe2-500x199.jpg 500w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<p>Javdev: We use a profiler, <a href=\"https:\/\/en.wikipedia.org\/wiki\/Adobe_Scout\">Adobe Scout<\/a>, select multiple frames &amp; see which code is most expensive &amp; iterate it to prevent frame drops.<\/p>\n<p>Bj\u00f6rn Blissing: One option is to plot a histogram over the captured data. Reveals if your max\/min are outliers or more common occurrences.<\/p>\n<p>Michael Marcin: Try always running circular etwtrace and when frame time dips save and examine the trace.<\/p>\n<p>Mikkel Gjoel: We filter in viewer. Options for all mentioned, and vsync (as that is what we are shipping).<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4395\" src=\"http:\/\/www.realtimerendering.com\/blog\/wp-content\/uploads\/2016\/05\/Gjoel.jpg\" alt=\"Gjoel\" width=\"452\" height=\"346\" srcset=\"https:\/\/www.realtimerendering.com\/blog\/wp-content\/uploads\/2016\/05\/Gjoel.jpg 452w, https:\/\/www.realtimerendering.com\/blog\/wp-content\/uploads\/2016\/05\/Gjoel-300x230.jpg 300w, https:\/\/www.realtimerendering.com\/blog\/wp-content\/uploads\/2016\/05\/Gjoel-392x300.jpg 392w\" sizes=\"auto, (max-width: 452px) 100vw, 452px\" \/><\/p>\n<p>Fabian Giesen: General order statistics (percentiles etc.) are good. Just a plot of frame durations over frame # is helpful, too! And simply recording all frame durations over a few seconds, sorting them and plotting that is quite handy, too. That gives you all the percentiles (and median etc.) and gives you a feel for the shape of the distribution, which matters. (I&#8217;m not very happy with single-value summaries; they lose too much information.)<\/p>\n<p>Jaume Sanchez Elias: I like Chrome FPS meter: current, min, max; over time; frequency graph for each framerate<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4394\" src=\"http:\/\/www.realtimerendering.com\/blog\/wp-content\/uploads\/2016\/05\/Elias.jpg\" alt=\"Elias\" width=\"1024\" height=\"680\" srcset=\"https:\/\/www.realtimerendering.com\/blog\/wp-content\/uploads\/2016\/05\/Elias.jpg 1024w, https:\/\/www.realtimerendering.com\/blog\/wp-content\/uploads\/2016\/05\/Elias-300x199.jpg 300w, https:\/\/www.realtimerendering.com\/blog\/wp-content\/uploads\/2016\/05\/Elias-768x510.jpg 768w, https:\/\/www.realtimerendering.com\/blog\/wp-content\/uploads\/2016\/05\/Elias-452x300.jpg 452w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<p>Krzysztof Narkowicz: Min, max, avg and std dev. Percentiles and med would make a nice addition, but it&#8217;s a hassle to compute them.<\/p>\n<p>Anton the Mighty: I always use the standard deviation or standard error and indicated what value n sample size is. Most gfx benchs=bad. It&#8217;s usually worth also eyeballing actual data in detail because repeating patterns show either cycles or error in timers. Most recently there was something a friend had with the power manager in windows causing a cycling load on the cpu. I also visually check out timing for cpu+gpu functions across frames with apitrace etc. pretty neat.<\/p>\n<p>All for now &#8211; feel free to email\u00a0or tweet me with anything you want to add.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I asked what others did for benchmarking in my last post. Here are the replies on Twitter in a semi-coherent edited form. If I missed any replies, I blame Twitter, whose interface is a magical maze. First there were some FPS vs. SPF comments: Richard Mitton: If you&#8217;re not measuring in milliseconds then you&#8217;re doing [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[48],"tags":[172,208],"class_list":["post-4391","post","type-post","status-publish","format-standard","hentry","category-reports","tag-benchmarking","tag-fps"],"_links":{"self":[{"href":"https:\/\/www.realtimerendering.com\/blog\/wp-json\/wp\/v2\/posts\/4391","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.realtimerendering.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.realtimerendering.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.realtimerendering.com\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.realtimerendering.com\/blog\/wp-json\/wp\/v2\/comments?post=4391"}],"version-history":[{"count":1,"href":"https:\/\/www.realtimerendering.com\/blog\/wp-json\/wp\/v2\/posts\/4391\/revisions"}],"predecessor-version":[{"id":4396,"href":"https:\/\/www.realtimerendering.com\/blog\/wp-json\/wp\/v2\/posts\/4391\/revisions\/4396"}],"wp:attachment":[{"href":"https:\/\/www.realtimerendering.com\/blog\/wp-json\/wp\/v2\/media?parent=4391"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.realtimerendering.com\/blog\/wp-json\/wp\/v2\/categories?post=4391"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.realtimerendering.com\/blog\/wp-json\/wp\/v2\/tags?post=4391"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}