prawnpdf/prawn — pull request #395 by alexdowad (2012-08-26 23:12:52+00:00)
Title: More performance improvements... with a (subversive?) ulterior motive

These optimizations were prompted by the thought that for a library which is widely used in the Ruby community, it sure would be nice to support more popular Ruby implementations. The message on "Supported Ruby Versions" in README.md, while written in a polite and friendly tone, sends a very clear message that "if you use anything but MRI, you're on your own". I feel that it should be possible to do better than that.

It seems to me that if it was possible to run the specs against all popular implementations every time a change was made, without taking up more of the maintainers' time, giving official sanction to more implementations would be an easy decision. As README.md points out, Prawn *is* pure Ruby, so the vast majority of changes should work "as is" on all implementations anyways.

To that end, I made a couple optimizations which speed up running the specs greatly. Also, I submitted a patch to the pdf-reader gem, which also makes a big difference. Since most developers are working on multi-core machines these days, I also added a script to the Rakefile which forks off a different process to run the specs against each implementation, so as to utilize all the available CPUs.

The net result (once a new version of pdf-reader is released) should be to make testing against 6 implementations take just a few seconds more than testing against 1 implementation did previously.