mozilla/pdf.js — pull request #2973 by brendandahl (2013-03-19 23:05:13+00:00)
Title: Convert all indexed colorspace values at once.

Use a temporary array to convert indexed color space buffers. This avoids calling the base.getRGBBuffer functions a gazillion times. Uses more memory but is much faster.

For example in issue1133.pdf I see the color space conversion go from 100ms to 8ms.