Unreviewed, rolling out r234750.
authortsavell@apple.com <tsavell@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 10 Aug 2018 16:26:13 +0000 (16:26 +0000)
committertsavell@apple.com <tsavell@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 10 Aug 2018 16:26:13 +0000 (16:26 +0000)
Caused 185 perf test failures.

Reverted changeset:

"Add ability to ignore process prewarming for launch time
benchmark"
https://bugs.webkit.org/show_bug.cgi?id=188462
https://trac.webkit.org/changeset/234750

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234757 268f45cc-cd09-0410-ab3c-d52691b4dbfc

PerformanceTests/ChangeLog
PerformanceTests/LaunchTime/launch_time.py
PerformanceTests/LaunchTime/new_tab.py
PerformanceTests/LaunchTime/startup.py

index ccfd11b..37ea1c4 100644 (file)
@@ -1,3 +1,16 @@
+2018-08-10  Truitt Savell  <tsavell@apple.com>
+
+        Unreviewed, rolling out r234750.
+
+        Caused 185 perf test failures.
+
+        Reverted changeset:
+
+        "Add ability to ignore process prewarming for launch time
+        benchmark"
+        https://bugs.webkit.org/show_bug.cgi?id=188462
+        https://trac.webkit.org/changeset/234750
+
 2018-08-09  Ben Richards  <benton_richards@apple.com>
 
         Add ability to ignore process prewarming for launch time benchmark
index 53a5a3b..c637103 100644 (file)
@@ -41,20 +41,28 @@ class DefaultLaunchTimeHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
         </html>
         '''
 
-    def on_receive_stop_signal(self, data):
+    def get_blank_page(self):
+        return '''<!DOCTYPE html>
+        <html>
+          <head>
+            <title>Launch Time Benchmark</title>
+            <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+          </head>
+        </html>'''
+
+    def on_receive_stop_time(self, time):
         pass
 
     def do_HEAD(self):
         self.send_response(200)
-        self.send_header('Content-type', 'text/html')
+        self.send_header('Content-type', 'text/hetml')
         self.end_headers()
 
     def do_GET(self):
         self.send_response(200)
         self.send_header('Content-type', 'text/html')
         self.end_headers()
-        if not self.path.startswith('/blank'):
-            self.wfile.write(self.get_test_page())
+        self.wfile.write(self.get_blank_page() if self.path == '/blank' else self.get_test_page())
         self.wfile.close()
 
     def do_POST(self):
@@ -65,7 +73,9 @@ class DefaultLaunchTimeHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
         self.wfile.close()
 
         data_string = self.rfile.read(int(self.headers['Content-Length']))
-        self.on_receive_stop_signal(data_string)
+        time = float(data_string)
+
+        self.on_receive_stop_time(time)
 
     def log_message(self, format, *args):
         pass
@@ -167,8 +177,7 @@ class LaunchTimeBenchmark:
     def _standard_deviation(self, results, mean=None):
         if mean is None:
             mean = sum(results) / float(len(results))
-        divisor = float(len(results) - 1) if len(results) > 1 else float(len(results))
-        variance = sum((x - mean) ** 2 for x in results) / divisor
+        variance = sum((x - mean) ** 2 for x in results) / float(len(results) - 1)
         return sqrt(variance)
 
     def _compute_results(self, results):
@@ -188,13 +197,9 @@ class LaunchTimeBenchmark:
         for i in range(self.iteration_groups):
             yield self.wait_time_low + increment_per_group * i
 
-    def open_tab(self, blank=False):
-        if blank:
-            call(['open', '-a', self._browser_bundle_path,
-                'http://localhost:{}/blank/{}'.format(self._port, self._open_count)])
-        else:
-            call(['open', '-a', self._browser_bundle_path,
-                'http://localhost:{}/{}'.format(self._port, self._open_count)])
+    def open_tab(self):
+        call(['open', '-a', self._browser_bundle_path,
+            'http://localhost:{}/{}'.format(self._port, self._open_count)])
         self._open_count += 1
 
     def launch_browser(self):
@@ -268,8 +273,8 @@ class LaunchTimeBenchmark:
                         results_by_iteration_number[i].append(result_in_ms)
                     except KeyboardInterrupt:
                         raise KeyboardInterrupt
-                    except Exception as error:
-                        self._exit_due_to_exception('(Test {} failed) {}: {}\n'.format(i + 1 if self._verbose else i, type(error).__name__, error))
+                    except:
+                        self._exit_due_to_exception('(Test {} failed)\n'.format(i + 1 if self._verbose else i))
                 if not self._verbose:
                     print ''
 
index d5c5d19..f385ed0 100755 (executable)
@@ -36,22 +36,16 @@ class NewTabBenchmark(LaunchTimeBenchmark):
         self.start_time = None
         self.stop_time = None
         self.stop_signal_was_received = Event()
-        self.allow_prewarm = True
 
     def run_iteration(self):
-        tabs_to_open = 1 if self.allow_prewarm else 2
-        self.stop_time = None
-        for _ in range(tabs_to_open - 1):
-            self.open_tab(blank=True)
         self.start_time = time.time() * 1000
         self.open_tab()
         while self.stop_time is None:
             self.stop_signal_was_received.wait()
         result = self.stop_time - self.start_time
+        self.stop_time = None
         self.stop_signal_was_received.clear()
-        for _ in range(tabs_to_open):
-            self.close_tab()
-
+        self.close_tab()
         return result
 
     def group_init(self):
@@ -62,16 +56,12 @@ class NewTabBenchmark(LaunchTimeBenchmark):
             help='number of groups of iterations to run (default: {})'.format(self.iteration_groups))
         self.argument_parser.add_argument('-w', '--wait-time', type=self._parse_wait_time,
             help='wait time to use between iterations or range to scan (format is "N" or "N:M" where N < M, default: {}:{})'.format(self.wait_time_low, self.wait_time_high))
-        self.argument_parser.add_argument('--no-prewarm', action='store_true',
-            help='attempt to ignore process prewarming (will most likely raise standard deviation)')
 
     def did_parse_arguments(self, args):
         if args.groups:
             self.iteration_groups = args.groups
         if args.wait_time:
             self.wait_time_low, self.wait_time_high = args.wait_time
-        if args.no_prewarm:
-            self.allow_prewarm = False
 
     @staticmethod
     def ResponseHandler(new_tab_benchmark):
@@ -84,8 +74,8 @@ class NewTabBenchmark(LaunchTimeBenchmark):
                     <meta http-equiv="Content-Type" content="text/html" />
                     <script>
                         function sendDone() {
-                            const time = performance.timing.navigationStart
-                            const request = new XMLHttpRequest();
+                            var time = performance.timing.navigationStart
+                            var request = new XMLHttpRequest();
                             request.open("POST", "done", false);
                             request.setRequestHeader('Content-Type', 'application/json');
                             request.send(JSON.stringify(time));
@@ -99,8 +89,8 @@ class NewTabBenchmark(LaunchTimeBenchmark):
                 </html>
                 '''
 
-            def on_receive_stop_signal(self, data):
-                new_tab_benchmark.stop_time = float(data)
+            def on_receive_stop_time(self, stop_time):
+                new_tab_benchmark.stop_time = stop_time
                 new_tab_benchmark.stop_signal_was_received.set()
 
         return Handler
index 39a6fc3..f36cdaf 100755 (executable)
@@ -50,8 +50,8 @@ class StartupBenchmark(LaunchTimeBenchmark):
                 </html>
                 '''
 
-            def on_receive_stop_signal(self, data):
-                startup_benchmark.stop_time = float(data)
+            def on_receive_stop_time(self, stop_time):
+                startup_benchmark.stop_time = stop_time
                 startup_benchmark.stop_signal_was_received.set()
 
         return Handler