2potatocakes/pdf-reader — comment on commit 4fd1bcfa34d41cce2332c0e0c24d8b68c9fe276d
File: lib/pdf/reader/font.rb line 65
By 2potatocakes:

No probs, sorry I'd been meaning to ask you about this but was distracted with that other newline problem. I was just playing with trying to isolate where the bottlenecks are in terms of performance. While benchmarking I noticed that a very large chunk of the holdup seemed to come from having to convert every chunk of text individually to UTF-8.
The force_encoding method is rubbish and shouldn't be used but I did see a performance increase of nearly 40% in terms of total time to read larger PDF's when doing the above so I thought it worth noting.