Changeset 185425 in webkit
- Timestamp:
- Jun 10, 2015, 11:44:50 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 12 edited
-
PerformanceTests/ChangeLog (modified) (1 diff)
-
PerformanceTests/JetStream/Octane2/base.js (modified) (5 diffs)
-
PerformanceTests/JetStream/Octane2/mandreel.js (modified) (5 diffs)
-
PerformanceTests/JetStream/Octane2/splay.js (modified) (5 diffs)
-
PerformanceTests/JetStream/Reference.js (modified) (1 diff)
-
PerformanceTests/JetStream/create.rb (modified) (2 diffs)
-
Source/JavaScriptCore/bytecode/CodeBlock.h (modified) (1 diff)
-
Source/JavaScriptCore/bytecode/DFGExitProfile.cpp (modified) (1 diff)
-
Source/JavaScriptCore/bytecode/DFGExitProfile.h (modified) (1 diff)
-
Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp (modified) (1 diff)
-
Source/JavaScriptCore/runtime/Options.h (modified) (1 diff)
-
Tools/Scripts/run-jsc-benchmarks (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/PerformanceTests/ChangeLog
r185162 r185425 1 2015-06-08 Filip Pizlo <fpizlo@apple.com> 2 3 JetStream should have a more rational story for jitter-oriented latency tests 4 https://bugs.webkit.org/show_bug.cgi?id=145762 5 6 Reviewed by Geoffrey Garen. 7 8 JetStream has some latency tests that are meant to measure jitter. Prior to this change, they 9 did this by computing the RMS. But the RMS is a pretty bad metric. The thing that it rewards 10 isn't really the thing that you'd want your browser to do. These RMS-based tests involve taking 11 the geomean of the RMS of some samples and the sample average. The lower the geomean, the better 12 (in the JetStream harness we then invert the scores so that higher is better, but let's ignore 13 that for this discussion and assume that lower is better). Here's an example of how this can go 14 bad. A browser that always computes a task in some horribly long time (say, 1000ms) but never 15 varies that time will perform better than a browser that usually computes the task super quickly 16 (say, 10ms) and sometimes just a little bit less quickly (say, 15ms). The former browser will 17 have an RMS of 0 and an average of 1000. The latter will have a RMS somewhere around 3.5 and an 18 average of 12.5 (assuming equal probability of 10ms and 15ms). The geomean of (0, 1000) is 0. 19 The geomean of (3.5, 12.5) is 6.6. Lower is better, so the former browser scores higher - even 20 though it's obviously never better to have a browser always complete a task in 1000ms when a 21 different browser can do it in 15ms in the worst case. 22 23 JetStream should not have this pathology. The right way of avoiding it is to replace RMS with 24 some other metric of how bad things get. A good metric is the average of the worst percentile. 25 The worst 1% or the worst 5% would be good things to average. This will catch cases where the VM 26 jittered due to JIT or GC, but it never have the pathology that we end up giving the better score 27 to a VM whose best case is worst than another VM's worst case. 28 29 For now, this change uses the highest samples above the 95% percentile. I'm not yet sure if that 30 is the best thing - it might include too many scores that are around the best-case performance - 31 but it's certainly better than RMS and it might be good enough to keep. But because of that 32 uncertainty, I'm setting the version to be "1.1-alpha1" to indicate that we aren't ready to 33 release this yet. 34 35 * JetStream/Octane2/base.js: 36 (.this.Setup.setup.setup): 37 (.this.TearDown.tearDown.tearDown): 38 (BenchmarkSuite.GeometricMeanTime): 39 (BenchmarkSuite.AverageAbovePercentile): 40 (BenchmarkSuite.GeometricMeanLatency): 41 (BenchmarkSuite.prototype.NotifyStep): 42 (BenchmarkSuite.prototype.RunSingleBenchmark): 43 * JetStream/Octane2/mandreel.js: 44 (setupMandreel): 45 (updateMandreelStats): 46 (startMandreelTimer): 47 (latencyMandreel): 48 (tearDownMandreel): 49 (RMSMandreel): Deleted. 50 * JetStream/Octane2/splay.js: 51 (GenerateKey): 52 (SplayUpdateStats): 53 (InsertNewNode): 54 (SplayTearDown): 55 (SplayRMS): Deleted. 56 * JetStream/create.rb: 57 1 58 2015-06-03 Zalan Bujtas <zalan@apple.com> 2 59 -
trunk/PerformanceTests/JetStream/Octane2/base.js
r183091 r185425 1 1 // Copyright 2013 the V8 project authors. All rights reserved. 2 // Copyright (C) 2015 Apple Inc. All rights reserved. 2 3 // Redistribution and use in source and binary forms, with or without 3 4 // modification, are permitted provided that the following conditions are … … 47 48 // running the benchmark, but the running time of these functions will 48 49 // not be accounted for in the benchmark score. 49 function Benchmark(name, doWarmup, doDeterministic, run, setup, tearDown, rmsResult, minIterations) {50 function Benchmark(name, doWarmup, doDeterministic, run, setup, tearDown, latencyResult, minIterations) { 50 51 this.name = name; 51 52 this.doWarmup = doWarmup; … … 54 55 this.Setup = setup ? setup : function() { }; 55 56 this.TearDown = tearDown ? tearDown : function() { }; 56 this. rmsResult = rmsResult ? rmsResult : null;57 this.latencyResult = latencyResult ? latencyResult : null; 57 58 this.minIterations = minIterations ? minIterations : 32; 58 59 } … … 190 191 191 192 192 // Computes the geometric mean of a set of rms measurements. 193 // Computes the average of the worst samples. For example, if percentile is 99, this will report the 194 // average of the worst 1% of the samples. 195 BenchmarkSuite.AverageAbovePercentile = function(numbers, percentile) { 196 // Don't change the original array. 197 numbers = numbers.slice(); 198 199 // Sort in ascending order. 200 numbers.sort(function(a, b) { return a - b; }); 201 202 // Now the elements we want are at the end. Keep removing them until the array size shrinks too much. 203 // Examples assuming percentile = 99: 204 // 205 // - numbers.length starts at 100: we will remove just the worst entry and then not remove anymore, 206 // since then numbers.length / originalLength = 0.99. 207 // 208 // - numbers.length starts at 1000: we will remove the ten worst. 209 // 210 // - numbers.length starts at 10: we will remove just the worst. 211 var numbersWeWant = []; 212 var originalLength = numbers.length; 213 while (numbers.length / originalLength > percentile / 100) 214 numbersWeWant.push(numbers.pop()); 215 216 var sum = 0; 217 for (var i = 0; i < numbersWeWant.length; ++i) 218 sum += numbersWeWant[i]; 219 220 var result = sum / numbersWeWant.length; 221 222 // Do a sanity check. 223 if (numbers.length && result < numbers[numbers.length - 1]) { 224 throw "Sanity check fail: the worst case result is " + result + 225 " but we didn't take into account " + numbers; 226 } 227 228 return result; 229 } 230 231 232 // Computes the geometric mean of a set of latency measurements. 193 233 BenchmarkSuite.GeometricMeanLatency = function(measurements) { 194 234 var log = 0; … … 294 334 if (data.runs < benchmark.minIterations) return data; 295 335 var usec = (data.elapsed * 1000) / data.runs; 296 var rms = (benchmark.rmsResult != null) ? benchmark.rmsResult() : 0; 297 this.NotifyStep(new BenchmarkResult(benchmark, usec, rms)); 336 var latencySamples = (benchmark.latencyResult != null) ? benchmark.latencyResult() : [0]; 337 var percentile = 95; 338 var latency = BenchmarkSuite.AverageAbovePercentile(latencySamples, percentile) * 1000; 339 this.NotifyStep(new BenchmarkResult(benchmark, usec, latency)); 298 340 return null; 299 341 } -
trunk/PerformanceTests/JetStream/Octane2/mandreel.js
r183091 r185425 1 1 // Portions copyright 2012 Google, Inc. 2 2 // Copyright 2012 Onan Games. All rights reserved. 3 // Copyright (C) 2015 Apple Inc. All rights reserved. 3 4 // Redistribution and use in source and binary forms, with or without 4 5 // modification, are permitted provided that the following conditions are … … 34 35 setupMandreel, 35 36 tearDownMandreel, 36 RMSMandreel,37 latencyMandreel, 37 38 4)]); 38 39 39 var mandreelSumSquaredPauses = 0; 40 var mandreelSamples = 0; 40 var mandreelPauseTimes = []; 41 41 var mandreelSampleTimeStart = 0.0; 42 42 … … 81 81 var pause = time - mandreelSampleTimeStart; 82 82 mandreelSampleTimeStart = time; 83 mandreelSumSquaredPauses += (pause * pause); 84 mandreelSamples++; 83 mandreelPauseTimes.push(pause); 85 84 } 86 85 … … 89 88 } 90 89 91 function RMSMandreel() {92 return Math.round(Math.sqrt(mandreelSumSquaredPauses / mandreelSamples) * 100);90 function latencyMandreel() { 91 return mandreelPauseTimes; 93 92 } 94 93 … … 109 108 heapDouble = null; 110 109 mandreelAppUsePackAsyncTexture = null; 111 mandreelSumSquaredPauses = 0; 112 mandreelSamples = 0; 110 mandreelPauseTimes = []; 113 111 } 114 112 -
trunk/PerformanceTests/JetStream/Octane2/splay.js
r183091 r185425 1 1 // Copyright 2009 the V8 project authors. All rights reserved. 2 // Copyright (C) 2015 Apple Inc. All rights reserved. 2 3 // Redistribution and use in source and binary forms, with or without 3 4 // modification, are permitted provided that the following conditions are … … 36 37 var Splay = new BenchmarkSuite('Splay', [81491, 2739514], [ 37 38 new Benchmark("Splay", true, false, 38 SplayRun, SplaySetup, SplayTearDown, Splay RMS)39 SplayRun, SplaySetup, SplayTearDown, SplayLatency) 39 40 ]); 40 41 … … 69 70 } 70 71 71 var splaySamples = 0; 72 var splaySumOfSquaredPauses = 0; 73 74 function SplayRMS() { 75 return Math.round(Math.sqrt(splaySumOfSquaredPauses / splaySamples) * 10000); 72 var splaySamples = []; 73 74 function SplayLatency() { 75 return splaySamples; 76 76 } 77 77 … … 79 79 var pause = time - splaySampleTimeStart; 80 80 splaySampleTimeStart = time; 81 splaySamples++; 82 splaySumOfSquaredPauses += pause * pause; 81 splaySamples.push(pause); 83 82 } 84 83 … … 120 119 splayTree = null; 121 120 122 splaySamples = 0; 123 splaySumOfSquaredPauses = 0; 121 splaySamples = []; 124 122 125 123 // Verify that the splay tree has the right size. -
trunk/PerformanceTests/JetStream/Reference.js
r183091 r185425 55 55 "regexp-2010": 61.82352941176467, 56 56 "splay": 0.9286376274328075, 57 "splay-latency": 3 2.399999999999984,57 "splay-latency": 3.524855736311738, 58 58 "navier-stokes": 9.653846153846146, 59 59 "pdfjs": 88.4166666666666, 60 60 "mandreel": 157.14285714285708, 61 "mandreel-latency": 0.5129999999999998,61 "mandreel-latency": 1.4940079129942474, 62 62 "gbemu": 135.9999999999998, 63 63 "code-first-load": 2.3249465349251905, -
trunk/PerformanceTests/JetStream/create.rb
r183091 r185425 1 1 #!/usr/bin/env ruby 2 2 3 # Copyright (C) 2014 Apple Inc. All rights reserved.3 # Copyright (C) 2014, 2015 Apple Inc. All rights reserved. 4 4 # 5 5 # Redistribution and use in source and binary forms, with or without … … 27 27 require "shellwords" 28 28 29 VERSION = "1. 0.1"29 VERSION = "1.1-alpha1" 30 30 DIRECTORY_NAME = "JetStream-#{VERSION}" 31 31 -
trunk/Source/JavaScriptCore/bytecode/CodeBlock.h
r185382 r185425 538 538 return hasExitSite(locker, site); 539 539 } 540 541 size_t numberOfExitSites() const 542 { 543 ConcurrentJITLocker locker(m_lock); 544 return m_exitProfile.size(); 545 } 540 546 541 547 DFG::ExitProfile& exitProfile() { return m_exitProfile; } -
trunk/Source/JavaScriptCore/bytecode/DFGExitProfile.cpp
r176533 r185425 45 45 return true; 46 46 } 47 48 // Don't add it if it's already there. This is O(n), but that's OK, because we 49 // know that the total number of places where code exits tends to not be large, 50 // and this code is only used when recompilation is triggered. 51 for (unsigned i = 0; i < m_frequentExitSites->size(); ++i) { 52 if (m_frequentExitSites->at(i) == site) 53 return false; 54 } 55 47 48 // Always add even if it's a duplicate. The side-effect of doing this is it gives us a 49 // complete count of the number of times we've exited here. 56 50 m_frequentExitSites->append(site); 57 51 return true; -
trunk/Source/JavaScriptCore/bytecode/DFGExitProfile.h
r176553 r185425 180 180 } 181 181 182 size_t size() const 183 { 184 if (!m_frequentExitSites) 185 return 0; 186 return m_frequentExitSites->size(); 187 } 188 182 189 private: 183 190 friend class QueryableExitProfile; -
trunk/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
r185409 r185425 1274 1274 1275 1275 // It might be possible to inline. 1276 return codeBlock->instructionCount() ;1276 return codeBlock->instructionCount() * pow(1 + codeBlock->numberOfExitSites(), Options::exitSitePowerForInlineCost()); 1277 1277 } 1278 1278 -
trunk/Source/JavaScriptCore/runtime/Options.h
r184354 r185425 205 205 v(unsigned, maximumOptimizationCandidateInstructionCount, 100000, nullptr) \ 206 206 \ 207 v(unsigned, maximumFunctionForCallInlineCandidateInstructionCount, 180, nullptr) \208 v(unsigned, maximumFunctionForClosureCallInlineCandidateInstructionCount, 1 00, nullptr) \209 v(unsigned, maximumFunctionForConstructInlineCandidateInstructionCount, 1 00, nullptr) \207 v(unsigned, maximumFunctionForCallInlineCandidateInstructionCount, 250, nullptr) \ 208 v(unsigned, maximumFunctionForClosureCallInlineCandidateInstructionCount, 180, nullptr) \ 209 v(unsigned, maximumFunctionForConstructInlineCandidateInstructionCount, 180, nullptr) \ 210 210 \ 211 211 v(unsigned, maximumFTLCandidateInstructionCount, 20000, nullptr) \ 212 \ 213 v(double, exitSitePowerForInlineCost, 0.5, nullptr) \ 212 214 \ 213 215 /* Depth of inline stack, so 1 = no inlining, 2 = one level, etc. */ \ -
trunk/Tools/Scripts/run-jsc-benchmarks
r183787 r185425 2844 2844 ARGV.each { 2845 2845 | vm | 2846 if vm =~ /([a-zA-Z0-9_ ]+):/2846 if vm =~ /([a-zA-Z0-9_ .]+):/ 2847 2847 name = $1 2848 2848 nameKind = :given … … 2853 2853 end 2854 2854 envs = [] 2855 while vm =~ /([a-zA-Z0-9_]+)=([a-zA-Z0-9_: ]+):/2855 while vm =~ /([a-zA-Z0-9_]+)=([a-zA-Z0-9_:.]+):/ 2856 2856 envs << [$1, $2] 2857 2857 vm = $~.post_match
Note:
See TracChangeset
for help on using the changeset viewer.