richardasaurus/mega.py — pull request #36 by gissehel (2013-05-05 18:53:21+00:00)
Title: Upload and download speed

I made some measures on two different processors.

> A) "Intel(R) Core(TM)2 Quad CPU Q8300 @ 2.50GHz" under linux
> B) "Intel(R) Atom(TM) CPU D425 @ 1.80GHz" undex linux

B is much slower than A.
They both are on a decent 100Mbits/s connection on internet (and 100Mbits/s can be reached on fast server at least in US and europe) so the main difference is the proc, and bandwidth is not a problem.
Usually, pure download is about the same speed on both servers, only heavy computations is slower on B)

I tried to download a 35MB file from mega using megacl that use mega.py to connect to mega ( on github in my repositories )

> Results:
> A ) Around 40s.
> B ) Around 5 minutes

My conclusions: This is not a download problem. Must be cryptographic part. PyCrypto is written in C, it should not explain that even A) is so slow.

I separated download, download + decrypt, download + decrypt + mac checking, download + mac checking.

> Results:
> A) download / download + decrypt: between 5 and 10s
> A) download + mac checking / download + decrypt + mac checking: around 40s
> B) download / download + decrypt: between 5 and 10s
> B) download + mac checking / download + decrypt + mac checking: around 5 minutes

so decrypting the file cost nothing, and mac checking is slow as hell.

So I worked on mac checking on a local file and here are my results:
> A) from **33s** to **0.7s**
> B) from **5minutes** to **5s**

I think it's a good improvement.