mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-03-14 06:38:36 +00:00
speedometer: Add version 3.0 support
Port v3.0 of Speedometer from Webkit [1] repo and update tarballs. "version" field can be added to the workload agenda file to specify which version of Speedomer should be used. Size of v3.0 tarball is around 12 MB if the compression type is gzip. Thus, in order to reduce total size of the repo, compress Speedometer archives in LZMA format. 1. https://github.com/WebKit/WebKit/tree/main/Websites/browserbench.org/Speedometer3.0 Signed-off-by: Metin Kaya <metin.kaya@arm.com>
This commit is contained in:
parent
523fb3f659
commit
8598d1ba3c
@ -1,7 +1,10 @@
|
||||
The speedometer_archive.tgz file is a tarball containing the following archives from WebKit:
|
||||
|
||||
the PerformanceTests/Speedometer directory state taken from https://github.com/WebKit/webkit as of:
|
||||
2.0:
|
||||
commit 5f402692d5f3406527dc107b5d20cc47dac929e8 Tue Jul 14 14:06:17 2020 +0000
|
||||
3.0:
|
||||
commit 734c49b3d075dcc33f56becf3bde8aca5245b719 Mon Feb 24 09:00:53 2025 -0800
|
||||
|
||||
WebKit is open source software with portions licensed under the LGPL and BSD
|
||||
licenses available at https://webkit.org/licensing-webkit/
|
||||
|
@ -14,6 +14,8 @@
|
||||
#
|
||||
from collections import defaultdict
|
||||
from http.server import SimpleHTTPRequestHandler, HTTPServer
|
||||
from urllib.parse import urlencode
|
||||
import lzma
|
||||
import os
|
||||
import re
|
||||
import tarfile
|
||||
@ -34,7 +36,7 @@ class Speedometer(Workload):
|
||||
|
||||
name = "speedometer"
|
||||
description = """
|
||||
A workload to execute the speedometer 2.0 web based benchmark. Requires device to be rooted.
|
||||
A workload to execute the speedometer web based benchmark. Requires device to be rooted.
|
||||
This workload will only with Android 9+ devices if connected via TCP, or Android 5+ if
|
||||
connected via USB.
|
||||
|
||||
@ -52,14 +54,15 @@ class Speedometer(Workload):
|
||||
|
||||
1. Run 'git clone https://github.com/WebKit/webkit'
|
||||
|
||||
2. Copy PerformanceTests/Speedometer to a directory called document_root, renaming Speedometer to Speedometer2.0
|
||||
2. Copy PerformanceTests/Speedometer to a directory called document_root, renaming Speedometer
|
||||
to Speedometer<version>. For example, Speedometer2.0.
|
||||
|
||||
3. Modify document_root/Speedometer2.0/index.html:
|
||||
3. Modify document_root/Speedometer<version>/index.html:
|
||||
|
||||
3a. Remove the 'defer' attribute from the <script> tags within the <head> section.
|
||||
3a. (Skip for v3.0) Remove the 'defer' attribute from the <script> tags within the <head> section.
|
||||
3b. Add '<script>startTest();</script>' to the very end of the <body> section.
|
||||
|
||||
4. Modify document_root/Speedometer2.0/resources/main.js:
|
||||
4. Modify document_root/Speedometer<version>/resources/main.js (it's main.mjs for 3.0):
|
||||
|
||||
4a. Add the listed code after this line:
|
||||
|
||||
@ -79,7 +82,7 @@ class Speedometer(Workload):
|
||||
}
|
||||
}
|
||||
|
||||
5. Run 'tar -cpzf speedometer_archive.tgz document_root'
|
||||
5. Run 'tar -cpzf speedometer_archive-<version>.tar document_root; xz --format=lzma -9 -e speedometer_archive-<version>.tar'
|
||||
|
||||
6. Copy the tarball into the workloads/speedometer directory
|
||||
|
||||
@ -118,6 +121,15 @@ class Speedometer(Workload):
|
||||
The app package for the browser that will be launched.
|
||||
""",
|
||||
),
|
||||
Parameter(
|
||||
"version",
|
||||
allowed_values=["2.0", "3.0"],
|
||||
kind=str,
|
||||
default="2.0",
|
||||
description="""
|
||||
Speedometer version to run. Currently supports 2.0 and 3.0.
|
||||
""",
|
||||
),
|
||||
]
|
||||
|
||||
def __init__(self, target, **kwargs):
|
||||
@ -152,13 +164,16 @@ class Speedometer(Workload):
|
||||
Speedometer.document_root = os.path.join(self.temp_dir.name, "document_root")
|
||||
|
||||
# Host a copy of Speedometer locally
|
||||
tarball = context.get_resource(File(self, "speedometer_archive.tgz"))
|
||||
with tarfile.open(name=tarball) as handle:
|
||||
safe_extract(handle, self.temp_dir.name)
|
||||
tarball = context.get_resource(File(self, f"speedometer_archive-{self.version}.tar.lzma"))
|
||||
with lzma.open(tarball) as lzma_handle:
|
||||
with tarfile.open(fileobj=lzma_handle) as handle:
|
||||
safe_extract(handle, self.temp_dir.name)
|
||||
|
||||
self.archive_server.start(self.document_root)
|
||||
|
||||
Speedometer.speedometer_url = "http://localhost:{}/Speedometer2.0/index.html".format(
|
||||
self.archive_server.get_port()
|
||||
Speedometer.speedometer_url = "http://localhost:{}/Speedometer{}/index.html".format(
|
||||
self.archive_server.get_port(),
|
||||
self.version,
|
||||
)
|
||||
|
||||
def setup(self, context):
|
||||
@ -238,10 +253,14 @@ class Speedometer(Workload):
|
||||
# Generate a UUID to search for in the browser's local storage to find out
|
||||
# when the workload has ended.
|
||||
report_end_id = uuid.uuid4().hex
|
||||
url_with_unique_id = "{}?reportEndId={}".format(
|
||||
self.speedometer_url, report_end_id
|
||||
)
|
||||
|
||||
query_params = {"reportEndId": report_end_id}
|
||||
# Speedometer 3.0 does not start the test automatically, so we need to
|
||||
# pass the "startAutomatically=true" parameter.
|
||||
if self.version == "3.0":
|
||||
query_params["startAutomatically"] = "true"
|
||||
|
||||
url_with_unique_id = f"{self.speedometer_url}?{urlencode(query_params)}"
|
||||
browser_launch_cmd = "am start -a android.intent.action.VIEW -d '{}' {}".format(
|
||||
url_with_unique_id, self.chrome_package
|
||||
)
|
||||
|
BIN
wa/workloads/speedometer/speedometer_archive-2.0.tar.lzma
Normal file
BIN
wa/workloads/speedometer/speedometer_archive-2.0.tar.lzma
Normal file
Binary file not shown.
BIN
wa/workloads/speedometer/speedometer_archive-3.0.tar.lzma
Normal file
BIN
wa/workloads/speedometer/speedometer_archive-3.0.tar.lzma
Normal file
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user