Sunday, 27 May 2012

Samsung Galaxy S2 vs Ubuntu PC performance

Introduction


It seems that many people assume that 1.2 GHz dual core mobile ARM CPU should be almost as fast as a PC CPU running on a similar frequency. They're wrong.

ARM cores are indeed more power efficient per square mm of surface on a same production process than Intel x86 and AMD64 architecture processors. Most of the efficiency comes from a simpler and more space efficient instruction set, but that advantage typically benefits only front-end of the CPU, which is not the biggest spender of those precious miliwatts.

The other reasons why modern dual or quad core mobile phones can run on a fraction of power that notebook or desktop (PC) CPUs need:

  • less computation units on CPU die (less SIMD, ALU, etc units)
  • smaller cache than PC CPUs
  • power gating parts of CPU (but laptop and desktop CPUs also do this for a number of years)
  • significantly slower DRAM interface  than PC CPUs, using slower DDR RAM (LPDDR2)
RAM speed significantly impacts many parts of phone performance. Executing complex JavaScript, image or video processing, Web page rendering are just some of the tasks that significantly benefit from having more RAM bandwidth. 

Your ARM device having significantly less of RAM bandwidth is also a big reason why you will probably avoid developing software on your new shiny ASUS Transformer Prime tablet/laptop (though I would certainly try:) )

So how much slower is your Android cell phone RAM than your PC RAM?


Unfortunately, I couldn't find any RAM bench-marking software that would run both on a Linux PC and on a un-rooted android device. There is a nice port of NBench, but NBench is a bigger benchmark and it needs some time before it prints out the one thing we need, the memory index. Also, it doesn't output MB/sec number, which is kind of unfortunate, since it's a really clear metric. 

So I found the really simplistic mbw (apt-get install mbw), made it even more simple (removed memcpy tests and left only the dumb array assignment part), and made Android NDK version of it.


RAMbandwidth
Source here. Be sure to close any apps before running it on a PC or your phone. Default array size being copied is 20 MB (the app needs 40 MB to perform the test) to better support low memory devices. 

Here are some results (20MB array size, 20 repetitions avg, run "mbw -t1 20 -n 20", default settings on RAMbandwidth ):
~5400 MB/sec - Intel Xeon X3430, DDR3 memory, under moderate MySQL load( 2009)
~2200 MB/sec - Intel Core 2 E8200, PC 6400 DDR2 RAM, Desktop PC (2008).
~1100 MB/sec - Intel Core duo L2400, PC 5300 DDR2 RAM on a  Thinkpad X60S laptop (2006). 
and our mobile contenters 
~500 MB/sec - Samsung  Galaxy S2 (2011)
~250 MB/sec - HTC Desire (2010)
~120 MB/sec - Raspberry PI (2012, under X, fbdev 720p it falls to ~90 MB/sec) 
~55 MB/sec - HTC Magic (2009, had to use smaller 10MB array size because of limited RAM available) 


Samsung Galaxy S2 sometimes reports around 440 MB/sec, and sometimes 550 MB/sec. I guess it depends where kernel allocates the memory, maybe one of the memory banks shares the bus with the GPU, GSM CPU or some other greedy device. 

It should be easy to post some test results of your own hardware, so please share. 

EDIT: Check comments for some more results



21 comments:

  1. ~220 MB/sec on my HTC Desire
    ~160 MB/sec on Nook Color (sigh, explains some of performance difference...)

    ReplyDelete
  2. This comment has been removed by a blog administrator.

    ReplyDelete
  3. HTC One X ~ 280 MB/s

    ReplyDelete
  4. Fascinating idea, thanks for sharing the app. My devices:
    Haitech Noble i9220 - 380 MB/s
    Chinese Galaxy Note clone. Uses MTK6575 chipset, 512MB RAM, Android 4.0.3. Was playing music over bluetooth as I tested.

    EEE PC 701 - 260 MB/s
    Celeron processor at 600 mhz: it is effectively underclocked from its 'stock' 900mhz by lowering the FSB. This would go a long way to explaining it's poor score! RAM upgraded to 2GB, machine torrenting at the time of the test.

    ReplyDelete
  5. Samsung GT-I9300 (Galaxy S3): 780 MB/s

    ReplyDelete
  6. Galaxy S GT-i9000m: 325MB/s

    ReplyDelete
  7. 442MB/s Atrix 4g

    ReplyDelete
  8. Sony Ericsson Xperia Arc S: ~260 MB/s
    Asus Transformer Prime: ~230 MB/s

    The Prime figure is weird, it is probably running on the low-power, companion core. Prime is much more faster than Xperia.

    ReplyDelete
    Replies
    1. Yes, Prime figure seems weird. Maybe if you bump up tested RAM size a bit, it will move to another memory bank. Unfortunately I don't have a Prime on hand to test.

      Maybe it just allocates a lot of bandwidth to the GPU :)

      It would be interesting to try it on Ubuntu Linux there.

      Delete
  9. Galaxy Nexus - 480MB/s

    ReplyDelete
  10. This comment has been removed by a blog administrator.

    ReplyDelete
  11. Samsung Galaxy Note i717 - 350 MB/sec

    ReplyDelete
  12. Good to know about your blog i have read your article i am very impressed from your ideas i have share my business with you hope you will be visit keep update blog with my ideas.
    Thank you for post.

    Samsung Galaxy S3

    ReplyDelete
  13. Samsung S2 577 MB/sec.
    S3 ICS Rom.
    No apps running in background.

    ReplyDelete
  14. gamsung galaxy s3 stock rom- 750-810 MB/s

    ReplyDelete
  15. This comment has been removed by the author.

    ReplyDelete
  16. Samsung Galaxy S Advance
    JB 4.1 I9070XXLPY

    440 MB/s

    ReplyDelete
  17. Thanks so much for this post. This is awesome post I ever seen on internet.mobile phones

    ReplyDelete