On Thu, Dec 21, 2017 at 11:29:45AM +0100, zyx wrote:
> Looking into the code, into podofosign.cpp, the sign_with_signer() uses
> 65535 bytes large buffer as its starting size (it makes it smaller when it
> fails to allocated that memory). That makes approximately 480 read and write
> operations for a 30MB file. Try to set the uBufferLen default value to some
> larger number, maybe it'll help.

The time is not spend in the read loop, but inside PKCS7_final. So
changing the buffer size won't make any big difference, I think.

> Otherwise I have nothing better; it's kind of expected that compute a hash
> for 30MB of data takes some time, from my point of view. You can compare
> with a raw openssl call (parameters to sign a file using a certificate can
> be found on the Internet, it's like signing a message), whether it'll make
> any difference in case the buffer size change won't help.

openssl smime -binary is significantly faster, i.e. for a 200MB PDF I
have here, it needs less than 0.6s. I've cancelled podofosign after
2min. One obvious issue is that podofosign is not using the streaming
interface, but keeping all the data in memory at once. No other idea for
how to speed it up though. Hashing, even with SHA3, should take less
than 1s on this machine, so that's not the problem.

Joegr

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users

Reply via email to