lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Sat, Nov 06, 2010 at 09:04:40PM +0100, Marcin Jurczuk wrote:

> II'm trying to port some code from python to lua on "embeded" device
> (only 64MB RAM, 400 MHz MIPS32 CPU). One of its functions is to
> calculate md5 sum from first 10MB of file.
> The issue is that lua version is at least 10 times slower than python
> version. It is looks like this is somehow relate to how lua io:read
> reads file.
> If I reduce read size to 1MB - lua is faster and result is the same -
> but 10MB read in lua is nightnmare :(

Surely if you only have 64MB of RAM, you want to avoid reading 10MB into
memory /anyway/ ?  Load it in 512kB chunks and hash incrementally.

B.