mozilla/pdf.js — pull request #3554 by fkaelberer (2013-08-07 22:58:46+00:00)
Title: Extract code to own method to speed up JPX decoding

This PR extracts ten lines of code to an own method, and thereby speeds up JPX image decoding on Firefox significantly (for whatever reason).

Chrome Nightly:
```
User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 Chrome/30.0.1588.0 Safari/537.36
-- Grouped By stat, browser, pdf --
stat | browser | pdf | Baseline(ms) | Current(ms) | +/- | % | Result(P<.05)
----------------------------------------------------------------------------------------------
Overall | chrome | S2-eq | 843 | 896 | -53 | -6.29 |
Overall | chrome | issue2790 | 6035 | 5877 | 158 | 2.62 |
Overall | chrome | issue3181 | 4670 | 4558 | 112 | 2.4 |
Page Request | chrome | S2-eq | 164 | 159 | 5 | 3.05 |
Page Request | chrome | issue2790 | 7 | 7 | 0 | 0.0 |
Page Request | chrome | issue3181 | 209 | 219 | -10 | -4.78 |
Rendering | chrome | S2-eq | 677 | 736 | -59 | -8.71 |
Rendering | chrome | issue2790 | 6027 | 5869 | 158 | 2.62 |
Rendering | chrome | issue3181 | 4459 | 4338 | 121 | 2.71 |
```

Firefox 24:
```
User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:24.0) Gecko/20130804 Firefox/24.0
-- Grouped By stat, browser, pdf --
stat | browser | pdf | Baseline(ms) | Current(ms) | +/- | % | Result(P<.05)
-----------------------------------------------------------------------------------------------
Overall | firefox | S2-eq | 2098 | 852 | 1246 | 59.39 |
Overall | firefox | issue2790 | 25487 | 10949 | 14538 | 57.04 |
Overall | firefox | issue3181 | 21759 | 12411 | 9348 | 42.96 |
Page Request | firefox | S2-eq | 173 | 189 | -16 | -9.25 |
Page Request | firefox | issue2790 | 18 | 14 | 4 | 22.22 |
Page Request | firefox | issue3181 | 158 | 159 | -1 | -0.63 |
Rendering | firefox | S2-eq | 1924 | 661 | 1263 | 65.64 |
Rendering | firefox | issue2790 | 25468 | 10935 | 14533 | 57.06 |
Rendering | firefox | issue3181 | 21600 | 12252 | 9348 | 43.28 |
```

Firefox Nightly:
```
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:26.0) Gecko/20100101 Firefox/26.0
-- Grouped By stat, browser, pdf --
stat | browser | pdf | Baseline(ms) | Current(ms) | +/- | % | Result(P<.05)
------------------------------------------------------------------------------------------------------
Overall | firefoxNightly | S2-eq | 2230 | 887 | 1343 | 60.22 |
Overall | firefoxNightly | issue2790 | 22007 | 6544 | 15463 | 70.26 |
Overall | firefoxNightly | issue3181 | 14886 | 5283 | 9603 | 64.51 |
Page Request | firefoxNightly | S2-eq | 195 | 190 | 5 | 2.56 |
Page Request | firefoxNightly | issue2790 | 12 | 15 | -3 | -25.0 |
Page Request | firefoxNightly | issue3181 | 158 | 159 | -1 | -0.63 |
Rendering | firefoxNightly | S2-eq | 2034 | 697 | 1337 | 65.73 |
Rendering | firefoxNightly | issue2790 | 21995 | 6529 | 15466 | 70.32 |
Rendering | firefoxNightly | issue3181 | 14727 | 5123 | 9604 | 65.21 |
```