in reply to Re: Help with PDF module [comparison]
in thread Help with PDF module
Here's a quick comparison of PDF-related modules
Wait, I don't see any beyond (incomplete) enumeration, looks like you forgot to append results. Oh, then, here they are (some of them for a start), and using simple test file generated with code you kindly provided:
use strict; use warnings; use PDF::API2; use CAM::PDF; use Benchmark 'cmpthese'; my $fn = 'test.pdf'; my $str = do { local ( @ARGV, $/ ) = $fn; <> }; cmpthese -1, { 'PDF::API2' => sub { PDF::API2-> from_string( $str )-> page_count }, 'CAM::PDF' => sub { CAM::PDF-> new( $str )-> numPages }, 'CAM::PDF+' => sub { my $d = CAM::PDF-> new( $str ); $d-> cacheObjects; $d-> numPages }, }; __END__ Rate PDF::API2 CAM::PDF+ CAM::PDF PDF::API2 163/s -- -74% -95% CAM::PDF+ 614/s 277% -- -83% CAM::PDF 3586/s 2106% 484% --
The 'plussed' entry (kind of "parse everything") is for those who may have (reasonable) doubts if perhaps one module (guess which) makes harder effort to extract a lot more info initially, to provide a user with richer environment to inspect things more cosily (or something like that); but in fact, they (nonplussed) seem both to extract approximately same amount of info on open. It's just one parser (guess which) is very poor indeed.
|
|---|