Skip to content

Instantly share code, notes, and snippets.

@alloy
Forked from wvanbergen/Decoding speed
Created October 5, 2010 11:49
Show Gist options
  • Select an option

  • Save alloy/611422 to your computer and use it in GitHub Desktop.

Select an option

Save alloy/611422 to your computer and use it in GitHub Desktop.
On MacRuby 0.7
=== Pure ruby
---------------------------------------------
ChunkyPNG (0.10.2) decoding benchmark (n=20)
---------------------------------------------
Rehearsal ---------------------------------------------------------
PNG - no filtering 2.290000 0.630000 2.920000 ( 1.643999)
PNG - UP filtering 4.470000 0.740000 5.210000 ( 2.775279)
PNG - PAETH filtering 6.210000 0.680000 6.890000 ( 3.806639)
From RGBA pixelstream 0.130000 0.020000 0.150000 ( 0.075240)
From RGB pixelstream 0.840000 0.110000 0.950000 ( 0.480836)
----------------------------------------------- total: 16.120000sec
user system total real
PNG - no filtering 2.060000 0.580000 2.640000 ( 1.383468)
PNG - UP filtering 4.470000 0.670000 5.140000 ( 2.680396)
PNG - PAETH filtering 6.380000 0.690000 7.070000 ( 3.822787)
From RGBA pixelstream 0.120000 0.030000 0.150000 ( 0.077414)
From RGB pixelstream 0.780000 0.110000 0.890000 ( 0.461180)
=== With C extension
---------------------------------------------
ChunkyPNG (0.10.2) decoding benchmark (n=20)
---------------------------------------------
Rehearsal ---------------------------------------------------------
PNG - no filtering 0.370000 0.040000 0.410000 ( 0.295025)
PNG - UP filtering 0.180000 0.030000 0.210000 ( 0.113724)
PNG - PAETH filtering 0.230000 0.030000 0.260000 ( 0.142660)
From RGBA pixelstream 0.120000 0.020000 0.140000 ( 0.083102)
From RGB pixelstream 0.820000 0.130000 0.950000 ( 0.500033)
------------------------------------------------ total: 1.970000sec
user system total real
PNG - no filtering 0.220000 0.040000 0.260000 ( 0.135205)
PNG - UP filtering 0.210000 0.040000 0.250000 ( 0.129290)
PNG - PAETH filtering 0.240000 0.050000 0.290000 ( 0.152059)
From RGBA pixelstream 0.110000 0.020000 0.130000 ( 0.069366)
From RGB pixelstream 0.800000 0.120000 0.920000 ( 0.486966)
=== Pure ruby
---------------------------------------------
ChunkyPNG (0.10.2) encoding benchmark (n=20)
---------------------------------------------
Rehearsal --------------------------------------------------------
Autodetect (indexed) 5.320000 0.040000 5.360000 ( 5.247669)
:no_compression 4.890000 0.040000 4.930000 ( 4.818030)
:fast_rgba 14.860000 4.380000 19.240000 ( 10.178074)
:fast_rgb 0.740000 0.190000 0.930000 ( 0.544641)
:good_compression 4.660000 0.040000 4.700000 ( 4.600270)
:best_compression 5.350000 0.030000 5.380000 ( 5.291988)
:rgb 1.680000 0.190000 1.870000 ( 1.480303)
:rgba 15.880000 4.380000 20.260000 ( 11.293425)
:indexed 4.980000 0.040000 5.020000 ( 4.919241)
:interlaced 4.990000 0.030000 5.020000 ( 4.925570)
to RGBA pixelstream 23.800000 7.000000 30.800000 ( 16.223304)
to RGB pixelstream 0.920000 0.220000 1.140000 ( 0.692565)
--------------------------------------------- total: 104.650000sec
user system total real
Autodetect (indexed) 4.970000 0.030000 5.000000 ( 4.916744)
:no_compression 4.890000 0.040000 4.930000 ( 4.813459)
:fast_rgba 14.340000 4.290000 18.630000 ( 9.847213)
:fast_rgb 0.680000 0.170000 0.850000 ( 0.495743)
:good_compression 4.650000 0.040000 4.690000 ( 4.578245)
:best_compression 5.340000 0.020000 5.360000 ( 5.285321)
:rgb 1.650000 0.160000 1.810000 ( 1.436764)
:rgba 15.990000 4.360000 20.350000 ( 11.329170)
:indexed 4.970000 0.030000 5.000000 ( 4.907982)
:interlaced 4.990000 0.030000 5.020000 ( 4.927617)
to RGBA pixelstream 22.210000 6.820000 29.030000 ( 15.294433)
to RGB pixelstream 0.880000 0.200000 1.080000 ( 0.640945)
=== With C extension
---------------------------------------------
ChunkyPNG (0.10.2) encoding benchmark (n=20)
---------------------------------------------
Rehearsal --------------------------------------------------------
Autodetect (indexed) 7.940000 0.060000 8.000000 ( 7.209322)
:no_compression 7.900000 0.070000 7.970000 ( 7.140036)
:fast_rgba 0.140000 0.010000 0.150000 ( 0.119234)
:fast_rgb 0.130000 0.010000 0.140000 ( 0.102456)
:good_compression 7.670000 0.060000 7.730000 ( 6.960176)
:best_compression 7.780000 0.070000 7.850000 ( 7.036048)
:rgb 0.130000 0.010000 0.140000 ( 0.116153)
:rgba 0.170000 0.010000 0.180000 ( 0.133739)
:indexed 7.900000 0.190000 8.090000 ( 7.247211)
:interlaced 8.580000 0.080000 8.660000 ( 7.545493)
to RGBA pixelstream 22.400000 6.780000 29.180000 ( 15.368710)
to RGB pixelstream 0.940000 0.230000 1.170000 ( 0.697992)
---------------------------------------------- total: 79.260000sec
user system total real
Autodetect (indexed) 8.580000 0.080000 8.660000 ( 7.551579)
:no_compression 8.360000 0.150000 8.510000 ( 7.452279)
:fast_rgba 0.160000 0.020000 0.180000 ( 0.122331)
:fast_rgb 0.110000 0.010000 0.120000 ( 0.094868)
:good_compression 8.540000 0.090000 8.630000 ( 7.527237)
:best_compression 8.580000 0.090000 8.670000 ( 7.550919)
:rgb 0.130000 0.010000 0.140000 ( 0.114504)
:rgba 0.170000 0.010000 0.180000 ( 0.129831)
:indexed 8.540000 0.080000 8.620000 ( 7.531188)
:interlaced 8.560000 0.090000 8.650000 ( 7.549622)
to RGBA pixelstream 22.660000 7.370000 30.030000 ( 15.809885)
to RGB pixelstream 0.910000 0.250000 1.160000 ( 0.689649)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment