[Webkit-unassigned] [Bug 59670] New: [Performance] [Chromium] Remove unnecessary memory copies in JPEGImageDecoder::outputScanlines()

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Apr 27 20:41:41 PDT 2011


https://bugs.webkit.org/show_bug.cgi?id=59670

           Summary: [Performance] [Chromium] Remove unnecessary memory
                    copies in JPEGImageDecoder::outputScanlines()
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: InChromiumBugs
          Severity: Normal
          Priority: P2
         Component: Images
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: hbono at chromium.org


Greetings,

JPEGImageDecoder::outputScanlines() copies row pixels returned by jpeg_read_scanlines() calls from a vector to a ImageFrame because libjpeg cannot output RGBA pixels used by WebKit. It improves the performance of decoding JPEG data to remove these copies when using libjpeg-turbo because it can output RGBA pixels used by WebKit. (It improves the rendering performance of JPEG images by >30%, especially huge ones as written in the following test results.)

1. Before removing memory copies

Before removing memory copies, it takes ~50s for our page_cycler_tests to render test images in <http://www.imagecompression.info/test_images/>.

Note: Google Test filter = PageCyclerTest.JPEGFile
[==========] Running 1 test from 1 test case.
[----------] Global test environment set-up.
[----------] 1 test from PageCyclerTest
[ RUN      ] PageCyclerTest.JPEGFile
*RESULT vm_size_final_b: vm_size_f_b= 417281 bytes
*RESULT vm_rss_final_b: vm_rss_f_b= 15 bytes
*RESULT vm_size_final_r: vm_size_f_r= 417281 bytes
*RESULT vm_rss_final_r: vm_rss_f_r= 15 bytes
*RESULT vm_size_final_t: vm_size_f_t= 834562 bytes
*RESULT vm_rss_final_t: vm_rss_f_t= 30 bytes
RESULT processes: proc_= 2
RESULT read_op_b: r_op_b= 0
RESULT write_op_b: w_op_b= 0
RESULT other_op_b: o_op_b= 0
*RESULT total_op_b: IO_op_b= 0
RESULT read_byte_b: r_b= 0 kb
RESULT write_byte_b: w_b= 0 kb
RESULT other_byte_b: o_b= 0 kb
*RESULT total_byte_b: IO_b= 0 kb
RESULT read_op_r: r_op_r= 0
RESULT write_op_r: w_op_r= 0
RESULT other_op_r: o_op_r= 0
*RESULT total_op_r: IO_op_r= 0
RESULT read_byte_r: r_r= 0 kb
RESULT write_byte_r: w_r= 0 kb
RESULT other_byte_r: o_r= 0 kb
*RESULT total_byte_r: IO_r= 0 kb
RESULT commit_charge: cc= 78680 kb
Pages: [artificial,big_building,big_tree,bridge,cathedral,deer,fireworks,flower_foveon,hdr,leaves_iso_1600,leaves_iso_200,nightshot_iso_100,nightshot_iso_1600,spider_web]
*RESULT times: t= [110,27,43,38,11,12,11,9,10,15,53,12,13,11,10,23,43,39,11,12,10,10,10,14,13,12,13,10,10,23,43,37,10,12,10,9,11,14,14,12,13,11,9,23,44,38,12,12,10,9,11,15,12,12,13,13,11,23,44,39,11,12,10,9,10,14,14,12,13,14,10,22,43,38,11,13,10,9,10,14,139,403,13,11,11,23,44,38,11,12,10,9,11,14,13,15,12,11,9,23,44,39,12,12,10,9,10,14,13,11,12,11,11,23,43,38,12,12,10,9,10,14,14,11,13,11,11,22,43,38,11,12,10,9,10,14,13,12,12,12] ms
[       OK ] PageCyclerTest.JPEGFile (49039 ms)
[----------] 1 test from PageCyclerTest (49040 ms total)

[----------] Global test environment tear-down
[==========] 1 test from 1 test case ran. (49040 ms total)
[  PASSED  ] 1 test.
  YOU HAVE 15 FLAKY TESTS

2. After removing memory copies

After removing memory copies, it takes ~30s for our page_cycler_tests to render the same test images.

Note: Google Test filter = PageCyclerTest.JPEGFile
[==========] Running 1 test from 1 test case.
[----------] Global test environment set-up.
[----------] 1 test from PageCyclerTest
[ RUN      ] PageCyclerTest.JPEGFile
*RESULT vm_size_final_b: vm_size_f_b= 416961 bytes
*RESULT vm_rss_final_b: vm_rss_f_b= 15 bytes
*RESULT vm_size_final_r: vm_size_f_r= 416961 bytes
*RESULT vm_rss_final_r: vm_rss_f_r= 15 bytes
*RESULT vm_size_final_t: vm_size_f_t= 833922 bytes
*RESULT vm_rss_final_t: vm_rss_f_t= 30 bytes
RESULT processes: proc_= 2
RESULT read_op_b: r_op_b= 0
RESULT write_op_b: w_op_b= 0
RESULT other_op_b: o_op_b= 0
*RESULT total_op_b: IO_op_b= 0
RESULT read_byte_b: r_b= 0 kb
RESULT write_byte_b: w_b= 0 kb
RESULT other_byte_b: o_b= 0 kb
*RESULT total_byte_b: IO_b= 0 kb
RESULT read_op_r: r_op_r= 0
RESULT write_op_r: w_op_r= 0
RESULT other_op_r: o_op_r= 0
*RESULT total_op_r: IO_op_r= 0
RESULT read_byte_r: r_r= 0 kb
RESULT write_byte_r: w_r= 0 kb
RESULT other_byte_r: o_r= 0 kb
*RESULT total_byte_r: IO_r= 0 kb
RESULT commit_charge: cc= 78116 kb
Pages: [artificial,big_building,big_tree,bridge,cathedral,deer,fireworks,flower_foveon,hdr,leaves_iso_1600,leaves_iso_200,nightshot_iso_100,nightshot_iso_1600,spider_web]
*RESULT times: t= [55,26,19,13,11,12,10,9,10,14,13,12,12,11,10,23,19,13,11,12,12,13,142,14,12,12,12,12,10,23,47,13,11,12,10,9,10,14,41,16,12,10,10,24,45,14,11,12,10,9,10,14,12,12,12,11,10,24,47,14,11,12,10,9,10,14,13,12,13,11,10,23,44,13,11,13,11,9,10,14,12,12,13,11,10,23,45,14,11,12,10,9,11,14,13,12,13,11,10,24,44,14,11,13,10,10,11,14,13,11,12,18,52,23,44,14,12,14,10,10,11,14,12,12,17,11,11,22,45,14,12,13,10,9,10,14,13,11,13,11] ms
[       OK ] PageCyclerTest.JPEGFile (30283 ms)
[----------] 1 test from PageCyclerTest (30283 ms total)

[----------] Global test environment tear-down
[==========] 1 test from 1 test case ran. (30283 ms total)
[  PASSED  ] 1 test.
  YOU HAVE 15 FLAKY TESTS

Regards,

Hironori Bono

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list