[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Poor md5 module performance
- From: Nilson <nilson.brazil@...>
- Date: Sun, 7 Nov 2010 22:46:02 -0200
On Sun, Nov 7, 2010 at 10:39 PM, Nilson <nilson.brazil@gmail.com> wrote:
> On Sun, Nov 7, 2010 at 7:44 PM, Marcin Jurczuk <mjurczuk@gmail.com> wrote:
>>> return fh and md5.sumhexa(io.open(fname,"rb"):read(10485760)) or nil
>>
>> Try using read("*a").
>>
>> This will read whole file - a those files have > 500MB usually.
>> I need only first 10MB to calculate checksum..
>>
>
> If I understood the implementation correctly, on each LUAL_BUFFERSIZE
> * LUA_MINSTACK/2 ( BUFSIZ x 10K in out of box configuration) bytes
> read, Lua concatenates the buffers (one for each fread) into a single
> buffer with (BUFSIZE x 10K) bytes.
>
I mean:
If I understood the implementation correctly, on each LUAL_BUFFERSIZE
* LUA_MINSTACK/2 ( BUFSIZ x 10 in out of box configuration) bytes
read, Lua concatenates the buffers (one for each fread) into a single
buffer with (BUFSIZE x 10) bytes.