Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright 2012 The Chromium Authors. All rights reserved. | 1 # Copyright 2012 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 """Runs Octane 2.0 javascript benchmark. | 5 """Runs Octane 2.0 javascript benchmark. |
| 6 | 6 |
| 7 Octane 2.0 is a modern benchmark that measures a JavaScript engine's performance | 7 Octane 2.0 is a modern benchmark that measures a JavaScript engine's performance |
| 8 by running a suite of tests representative of today's complex and demanding web | 8 by running a suite of tests representative of today's complex and demanding web |
| 9 applications. Octane's goal is to measure the performance of JavaScript code | 9 applications. Octane's goal is to measure the performance of JavaScript code |
| 10 found in large, real-world web applications. | 10 found in large, real-world web applications. |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 73 super(_OctaneMeasurement, self).__init__() | 73 super(_OctaneMeasurement, self).__init__() |
| 74 self._power_metric = None | 74 self._power_metric = None |
| 75 | 75 |
| 76 def CustomizeBrowserOptions(self, options): | 76 def CustomizeBrowserOptions(self, options): |
| 77 power.PowerMetric.CustomizeBrowserOptions(options) | 77 power.PowerMetric.CustomizeBrowserOptions(options) |
| 78 | 78 |
| 79 def WillStartBrowser(self, platform): | 79 def WillStartBrowser(self, platform): |
| 80 self._power_metric = power.PowerMetric(platform) | 80 self._power_metric = power.PowerMetric(platform) |
| 81 | 81 |
| 82 def WillNavigateToPage(self, page, tab): | 82 def WillNavigateToPage(self, page, tab): |
| 83 memory_stats = tab.browser.memory_stats | 83 total_memory = tab.browser.platform.GetSystemTotalPhysicalMemory() |
| 84 if ('SystemTotalPhysicalMemory' in memory_stats and | 84 if total_memory is not None and total_memory < 1 * _GB: |
|
nednguyen
2016/09/02 16:15:52
Actually what do we do with this variable?
perezju
2016/09/03 10:05:43
That seems to be it. Just skip the "zlib" test in
nednguyen
2016/09/03 11:43:05
I see. Let's just keep this as-is to unblock your
| |
| 85 memory_stats['SystemTotalPhysicalMemory'] < 1 * _GB): | |
| 86 skipBenchmarks = '"zlib"' | 85 skipBenchmarks = '"zlib"' |
| 87 else: | 86 else: |
| 88 skipBenchmarks = '' | 87 skipBenchmarks = '' |
| 89 page.script_to_evaluate_on_commit = """ | 88 page.script_to_evaluate_on_commit = """ |
| 90 var __results = []; | 89 var __results = []; |
| 91 var __real_log = window.console.log; | 90 var __real_log = window.console.log; |
| 92 window.console.log = function(msg) { | 91 window.console.log = function(msg) { |
| 93 __results.push(msg); | 92 __results.push(msg); |
| 94 __real_log.apply(this, [msg]); | 93 __real_log.apply(this, [msg]); |
| 95 } | 94 } |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 145 | 144 |
| 146 def CreateStorySet(self, options): | 145 def CreateStorySet(self, options): |
| 147 ps = story.StorySet( | 146 ps = story.StorySet( |
| 148 archive_data_file='../page_sets/data/octane.json', | 147 archive_data_file='../page_sets/data/octane.json', |
| 149 base_dir=os.path.dirname(os.path.abspath(__file__)), | 148 base_dir=os.path.dirname(os.path.abspath(__file__)), |
| 150 cloud_storage_bucket=story.PUBLIC_BUCKET) | 149 cloud_storage_bucket=story.PUBLIC_BUCKET) |
| 151 ps.AddStory(page_module.Page( | 150 ps.AddStory(page_module.Page( |
| 152 'http://chromium.github.io/octane/index.html?auto=1', | 151 'http://chromium.github.io/octane/index.html?auto=1', |
| 153 ps, ps.base_dir, make_javascript_deterministic=False)) | 152 ps, ps.base_dir, make_javascript_deterministic=False)) |
| 154 return ps | 153 return ps |
| OLD | NEW |