Skip to content
This repository has been archived by the owner on Nov 19, 2022. It is now read-only.

Commit

Permalink
Add png perf tests
Browse files Browse the repository at this point in the history
  • Loading branch information
shravanrn committed Apr 1, 2019
1 parent 3067f2b commit ae3f57f
Show file tree
Hide file tree
Showing 23 changed files with 116 additions and 5 deletions.
4 changes: 3 additions & 1 deletion image/decoders/nsPNGDecoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,7 @@ nsPNGDecoder::nsPNGDecoder(RasterImage* aImage, RasterImage* aImageExtra)
, PngSbxActivated(false)
#endif
{
mImageString = getImageURIString(aImage != nullptr? aImage : aImageExtra);
#if defined(NACL_SANDBOX_USE_NEW_CPP_API) || defined(WASM_SANDBOX_USE_NEW_CPP_API) || defined(PS_SANDBOX_USE_NEW_CPP_API)
std::string hostString = getHostStringFromImage(aImage != nullptr? aImage : aImageExtra);
rlbox_sbx_shared = pngSandboxManager.createSandbox(hostString);
Expand Down Expand Up @@ -2617,7 +2618,8 @@ nsPNGDecoder::FinishInternal()
if(!PngMaybeTooSmall)
{
auto diff = PngBench.JustFinish();
printf("Capture_Time:PNG_destroy,%llu,%llu|\n", invPng, diff);
std::string tag = "PNG_destroy(" + mImageString + ")";
printf("Capture_Time:%s,%llu,%llu|\n", tag.c_str(), invPng, diff);
invPng++;
}

Expand Down
4 changes: 3 additions & 1 deletion image/decoders/nsPNGDecoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ inline std::string getImageURIString(RasterImage* aImage)
if(imageURI == nullptr) { return ""; }

nsCString spec;
nsresult rv = imageURI->GetSpec(spec);
imageURI->GetSpec(spec);
std::string ret = spec.get();
return ret;
}
Expand Down Expand Up @@ -361,6 +361,8 @@ class nsPNGDecoder : public Decoder
size_t mLastChunkLength;

public:
std::string mImageString;

#if defined(NACL_SANDBOX_USE_NEW_CPP_API) || defined(WASM_SANDBOX_USE_NEW_CPP_API) || defined(PS_SANDBOX_USE_NEW_CPP_API)
// RLBoxSandbox<TRLSandboxP>* rlbox_png = nullptr;
// std::once_flag rlbox_png_init;
Expand Down
4 changes: 2 additions & 2 deletions testing/talos/talos.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,13 @@
"pagesets_name": "tp5n.zip"
},
"jpeg_tests": {
"tests": ["jpeg_perf", "jpeg_page_render", "jpeg_page_render_25", "jpeg_page_render_50"]
"tests": ["jpeg_page_render", "png_page_render", "jpeg_page_render", "jpeg_page_render_25", "jpeg_page_render_50"]
},
"zlib_test": {
"tests": ["zlib_page_render"]
},
"rlbox_test": {
"tests": ["jpeg_page_render", "png_page_render", "zlib_page_render"]
"tests": [ "jpeg_perf", "png_perf", "zlib_page_render"]
},
"rlbox_scaling": {
"tests": ["jpeg_scaling_1", "jpeg_scaling_1_1", "jpeg_scaling_1_2", "jpeg_scaling_1_3", "jpeg_scaling_1_4", "jpeg_scaling_1_5", "jpeg_scaling_1_6", "jpeg_scaling_2", "jpeg_scaling_3", "jpeg_scaling_4", "jpeg_scaling_5", "jpeg_scaling_6", "jpeg_scaling_7"]
Expand Down
19 changes: 18 additions & 1 deletion testing/talos/talos/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -791,7 +791,24 @@ class jpeg_perf(PageloaderTest):
tpmanifest = '${talos}/tests/jpeg_perf/tests.manifest'
tpcycles = 1
tploadnocache = True
tppagecycles = 1000
tppagecycles = 4000
tpmozafterpaint = True
gecko_profile_interval = 1
gecko_profile_entries = 10000000
filters = filter.ignore_first.prepare(5) + filter.median.prepare()
unit = 'ms'
timeout = 720000


@register_test()
class png_perf(PageloaderTest):
"""
Test the time taken to render png images of different quality
"""
tpmanifest = '${talos}/tests/png_perf/tests.manifest'
tpcycles = 1
tploadnocache = True
tppagecycles = 4000
tpmozafterpaint = True
gecko_profile_interval = 1
gecko_profile_entries = 10000000
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!DOCTYPE html>
<html>
<head>
<title>Test image page</title>
</head>
<body>
<img src='../generated_pngs/artificial_rgb8bit_best_1920.png' alt='Test'>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!DOCTYPE html>
<html>
<head>
<title>Test image page</title>
</head>
<body>
<img src='../generated_pngs/artificial_rgb8bit_best_240.png' alt='Test'>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!DOCTYPE html>
<html>
<head>
<title>Test image page</title>
</head>
<body>
<img src='../generated_pngs/artificial_rgb8bit_best_480.png' alt='Test'>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!DOCTYPE html>
<html>
<head>
<title>Test image page</title>
</head>
<body>
<img src='../generated_pngs/artificial_rgb8bit_default_1920.png' alt='Test'>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!DOCTYPE html>
<html>
<head>
<title>Test image page</title>
</head>
<body>
<img src='../generated_pngs/artificial_rgb8bit_default_240.png' alt='Test'>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!DOCTYPE html>
<html>
<head>
<title>Test image page</title>
</head>
<body>
<img src='../generated_pngs/artificial_rgb8bit_default_480.png' alt='Test'>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!DOCTYPE html>
<html>
<head>
<title>Test image page</title>
</head>
<body>
<img src='../generated_pngs/artificial_rgb8bit_none_1920.png' alt='Test'>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!DOCTYPE html>
<html>
<head>
<title>Test image page</title>
</head>
<body>
<img src='../generated_pngs/artificial_rgb8bit_none_240.png' alt='Test'>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!DOCTYPE html>
<html>
<head>
<title>Test image page</title>
</head>
<body>
<img src='../generated_pngs/artificial_rgb8bit_none_480.png' alt='Test'>
</body>
</html>
9 changes: 9 additions & 0 deletions testing/talos/talos/tests/png_perf/tests.manifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
http://localhost/tests/png_perf/generated_pngs_html/artificial_rgb8bit_best_1920.html
http://localhost/tests/png_perf/generated_pngs_html/artificial_rgb8bit_best_240.html
http://localhost/tests/png_perf/generated_pngs_html/artificial_rgb8bit_best_480.html
http://localhost/tests/png_perf/generated_pngs_html/artificial_rgb8bit_default_1920.html
http://localhost/tests/png_perf/generated_pngs_html/artificial_rgb8bit_default_240.html
http://localhost/tests/png_perf/generated_pngs_html/artificial_rgb8bit_default_480.html
http://localhost/tests/png_perf/generated_pngs_html/artificial_rgb8bit_none_1920.html
http://localhost/tests/png_perf/generated_pngs_html/artificial_rgb8bit_none_240.html
http://localhost/tests/png_perf/generated_pngs_html/artificial_rgb8bit_none_480.html

0 comments on commit ae3f57f

Please sign in to comment.