User avatar
mikronauts
Posts: 2705
Joined: Sat Jan 05, 2013 7:28 pm
Contact: Website

Raspberry Pi 2: Linaro(ARMv7) vs Raspbian(ARMv6) Benchmarks!

Fri Feb 13, 2015 5:42 am

Since the release a lot of people (myself included) have been wondering if recompiling Raspbian for ARMv7 would significantly speed it up.

Linero is compiled for ARMv7 … Raspbian is compiled for ARMv6… which is faster?

I re-ran the benchmarks I used for my recent Raspberry Pi 2 Model B Review on Linaro… you read the results for yourself in my latest article:

Raspberry Pi 2: Raspbian vs. Linero (ARMv6 vs ARMv7)
http://www.mikronauts.com/raspberry-pi/ ... -vs-armv7/
http://Mikronauts.com - home of EZasPi, RoboPi, Pi Rtc Dio and Pi Jumper @Mikronauts on Twitter
Advanced Robotics, I/O expansion and prototyping boards for the Raspberry Pi

Mennims
Posts: 105
Joined: Sun May 19, 2013 9:37 am

Re: Raspberry Pi 2: Linaro(ARMv7) vs Raspbian(ARMv6) Benchma

Fri Feb 13, 2015 5:51 am

Nice review! Surprised to see I'm the first and so far the only one to like your page. You just saved me from wasting time. Lot's of it. Thank you!

mimi123
Posts: 583
Joined: Thu Aug 22, 2013 3:32 pm

Re: Raspberry Pi 2: Linaro(ARMv7) vs Raspbian(ARMv6) Benchma

Fri Feb 13, 2015 7:27 am

The memory benchmarks suggests that libcofi_rpi is not enabled( from github.com/simonjhall/, installed as default in Raspbian since ages.)

User avatar
ric96
Posts: 1253
Joined: Sun Mar 17, 2013 6:03 am
Location: NOIDA, India
Contact: Website

Re: Raspberry Pi 2: Linaro(ARMv7) vs Raspbian(ARMv6) Benchma

Fri Feb 13, 2015 7:37 am

Wow unexpected!!
Armv6 code is performing better than v7
My apologies for shameless YouTube Plugs...
youtube.com/sahajsarup
twitter @sahajsarup
skype srics1996
e-mail: [email protected]
Blog: http://www.geektillithertz.com/wordpress
Web: http://www.geektillithertz.com

EtonMess
Posts: 51
Joined: Thu Jan 29, 2015 1:32 pm

Re: Raspberry Pi 2: Linaro(ARMv7) vs Raspbian(ARMv6) Benchma

Fri Feb 13, 2015 8:01 am

I guess three years of optimisations in Raspbian really do demonstrate that code comes before iron when pursuing performance and efficiency together. It also seems to have proven the idea that by placing people in a resource constrained environment, people will find ways of making things work better, rather than just being lazy and letting the CPU clock speed, any number of hardware tricks take care of performance for you.

When I heard about this Linaro distribution yesterday, there were early reports of it being much quicker than Raspbian. Was that the perceived user interface fluency? It made me wonder if this could put the RP Foundation into a dilemma, and the community into a fork by diverting some of the community away from the established, stable and supported distribution on which most of the projects are based. I know there as always been room for several OSes on Raspberry Pi, but there has always been a clamour for Ubuntu etc., and if another distribution were to become more popular than the established, what then?
.G6FIR

evaskp
Posts: 6
Joined: Thu Feb 12, 2015 12:48 pm
Location: Sweden
Contact: Website

Re: Raspberry Pi 2: Linaro(ARMv7) vs Raspbian(ARMv6) Benchma

Fri Feb 13, 2015 8:53 am

Although Linaro is a bit slower, so I still use it. Then we'll see what comes in the future.
Linaro has no optimization yet, so I think that it is doing very well.

/Krister

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 22653
Joined: Sat Jul 30, 2011 7:41 pm

Re: Raspberry Pi 2: Linaro(ARMv7) vs Raspbian(ARMv6) Benchma

Fri Feb 13, 2015 9:32 am

mimi123 wrote:The memory benchmarks suggests that libcofi_rpi is not enabled( from github.com/simonjhall/, installed as default in Raspbian since ages.)
Is that the Armv6 assembler optimised memxxx library? That's targeted at Armv6 specifically, I wonder if there is an equivalent NEON optimised version that can be used?
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

mimi123
Posts: 583
Joined: Thu Aug 22, 2013 3:32 pm

Re: Raspberry Pi 2: Linaro(ARMv7) vs Raspbian(ARMv6) Benchma

Fri Feb 13, 2015 11:31 am

The exact cause after analysis is that Linaro uses the powersave governor, which caps the CPU at 600MHz.
Try adding "force_turbo=1" to config.txt or change the governor to something else.

plugwash
Forum Moderator
Forum Moderator
Posts: 3414
Joined: Wed Dec 28, 2011 11:45 pm

Re: Raspberry Pi 2: Linaro(ARMv7) vs Raspbian(ARMv6) Benchma

Fri Feb 13, 2015 1:27 pm

More generally these benchmarks are worthless because there are way too many other differences between the images which dwarf the change you were trying to measure.

A fair test would be a bare (with no raspberry pi foundation packages) raspbian system VS a bare debian armhf system.

User avatar
mikronauts
Posts: 2705
Joined: Sat Jan 05, 2013 7:28 pm
Contact: Website

Re: Raspberry Pi 2: Linaro(ARMv7) vs Raspbian(ARMv6) Benchma

Fri Feb 13, 2015 2:47 pm

Mennims - thank you, and you are welcome :)

mimi123 - there is always room for more optimization!

ric96 - not too surprising, code optimized for years vs. new port.

EtonMess - optimization helps :) and I am sure Linaro will get faster.

evaskp - I agree, Linaro will get faster.

jamesh - Good question. I am sure NEON optimized mem*() and str*() would help both Raspbian and Linaro.

mimi123 - benchmarks show that it was running at 900Mhz, and lscpu confirms that.

plugwash:

I agree that micro benchmarks are generally useless, except when they fit your applications profile to a "T".

Having said that, these benchmarks address the ARMv7 compile vs. ARMv6 compile question at least as far as currenly available Debian (Raspbian) and Ubuntu (Linaro) are concerned.

As Linaro is freshly hatched, it will benefit more from further optimization than Raspbian.

That however does not invalidate the fairness of the comparison between the two current images... basically "a bird in hand is worth more than two in the bush".

Regarding bare metal - I managed to find the time to write & report on these results, however I do not have the time to go to bare metal, and optimize for ARMv7.
http://Mikronauts.com - home of EZasPi, RoboPi, Pi Rtc Dio and Pi Jumper @Mikronauts on Twitter
Advanced Robotics, I/O expansion and prototyping boards for the Raspberry Pi

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5702
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: Raspberry Pi 2: Linaro(ARMv7) vs Raspbian(ARMv6) Benchma

Fri Feb 13, 2015 3:32 pm

plugwash wrote:More generally these benchmarks are worthless because there are way too many other differences between the images which dwarf the change you were trying to measure.

A fair test would be a bare (with no raspberry pi foundation packages) raspbian system VS a bare debian armhf system.
I've done that and the tests for things which don't use neon were identical.

User avatar
mikronauts
Posts: 2705
Joined: Sat Jan 05, 2013 7:28 pm
Contact: Website

Re: Raspberry Pi 2: Linaro(ARMv7) vs Raspbian(ARMv6) Benchma

Fri Feb 13, 2015 7:49 pm

I would have expected the potential for dual issue to have at least a bit of a boost, and SysBench 0.4.12 CPU test showed about a 15% increase - could it be using NEON?
ShiftPlusOne wrote:
plugwash wrote:More generally these benchmarks are worthless because there are way too many other differences between the images which dwarf the change you were trying to measure.

A fair test would be a bare (with no raspberry pi foundation packages) raspbian system VS a bare debian armhf system.
I've done that and the tests for things which don't use neon were identical.
http://Mikronauts.com - home of EZasPi, RoboPi, Pi Rtc Dio and Pi Jumper @Mikronauts on Twitter
Advanced Robotics, I/O expansion and prototyping boards for the Raspberry Pi

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 22653
Joined: Sat Jul 30, 2011 7:41 pm

Re: Raspberry Pi 2: Linaro(ARMv7) vs Raspbian(ARMv6) Benchma

Fri Feb 13, 2015 7:51 pm

mikronauts wrote:I would have expected the potential for dual issue to have at least a bit of a boost, and SysBench 0.4.12 CPU test showed about a 15% increase - could it be using NEON?
ShiftPlusOne wrote:
plugwash wrote:More generally these benchmarks are worthless because there are way too many other differences between the images which dwarf the change you were trying to measure.

A fair test would be a bare (with no raspberry pi foundation packages) raspbian system VS a bare debian armhf system.
I've done that and the tests for things which don't use neon were identical.
NEON would give > 15% I think.

What exactly are we comparing here?
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5702
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: Raspberry Pi 2: Linaro(ARMv7) vs Raspbian(ARMv6) Benchma

Fri Feb 13, 2015 7:56 pm

mikronauts wrote:I would have expected the potential for dual issue to have at least a bit of a boost, and SysBench 0.4.12 CPU test showed about a 15% increase - could it be using NEON?
ShiftPlusOne wrote:
plugwash wrote:More generally these benchmarks are worthless because there are way too many other differences between the images which dwarf the change you were trying to measure.

A fair test would be a bare (with no raspberry pi foundation packages) raspbian system VS a bare debian armhf system.
I've done that and the tests for things which don't use neon were identical.
No idea. I would like to play around with this linaro distro a bit to see what's really different. I saw no difference in sysbench results between raspbian and debian, so this is interesting.

User avatar
mikronauts
Posts: 2705
Joined: Sat Jan 05, 2013 7:28 pm
Contact: Website

Re: Raspberry Pi 2: Linaro(ARMv7) vs Raspbian(ARMv6) Benchma

Fri Feb 13, 2015 8:11 pm

SysBench 0.4.12 CPU test running on Raspbian vs. Linaro on the same Raspberry Pi 2 B

I suspect it is not NEON, but possibly the increase may be due to dual issue scheduling.

I wonder if gcc does more optimization (possibly due to ARMv7) under Linaro - this is supported by compiling Emacs taking roughly 20% longer under linaro, from the same source tarball, same configuration (--without-x).

I may play some more with gcc options this weekend, I left it installed on one of my Pi2B's.
jamesh wrote:
mikronauts wrote:I would have expected the potential for dual issue to have at least a bit of a boost, and SysBench 0.4.12 CPU test showed about a 15% increase - could it be using NEON?
NEON would give > 15% I think.

What exactly are we comparing here?
http://Mikronauts.com - home of EZasPi, RoboPi, Pi Rtc Dio and Pi Jumper @Mikronauts on Twitter
Advanced Robotics, I/O expansion and prototyping boards for the Raspberry Pi

User avatar
mikronauts
Posts: 2705
Joined: Sat Jan 05, 2013 7:28 pm
Contact: Website

Re: Raspberry Pi 2: Linaro(ARMv7) vs Raspbian(ARMv6) Benchma

Fri Feb 13, 2015 8:13 pm

Agreed, it is quite interesting. Best guess - gcc is compiled for ARMv7, and attempts dual issue optimizations with -O2 ... mind you, that is only a guess.
ShiftPlusOne wrote:
mikronauts wrote:I would have expected the potential for dual issue to have at least a bit of a boost, and SysBench 0.4.12 CPU test showed about a 15% increase - could it be using NEON?
]

No idea. I would like to play around with this linaro distro a bit to see what's really different. I saw no difference in sysbench results between raspbian and debian, so this is interesting.
http://Mikronauts.com - home of EZasPi, RoboPi, Pi Rtc Dio and Pi Jumper @Mikronauts on Twitter
Advanced Robotics, I/O expansion and prototyping boards for the Raspberry Pi

Heater
Posts: 12595
Joined: Tue Jul 17, 2012 3:02 pm

Re: Raspberry Pi 2: Linaro(ARMv7) vs Raspbian(ARMv6) Benchma

Fri Feb 13, 2015 8:23 pm

Don't be to enamoured with Linaro.

A couple of years back I was building a Pascal application on Linaro on an ISEE IGEPv2 board: https://www.isee.biz/products/igep-proc ... pv2-dm3730 the performance was terrible until I figured out I had to rebuild the Free Pascal compiler with the right options to take advantage of the particular ARM variant on there.
Last edited by Heater on Sat Feb 14, 2015 6:21 am, edited 1 time in total.

User avatar
mikronauts
Posts: 2705
Joined: Sat Jan 05, 2013 7:28 pm
Contact: Website

Re: Raspberry Pi 2: Linaro(ARMv7) vs Raspbian(ARMv6) Benchma

Fri Feb 13, 2015 8:47 pm

Thanks Heater, good to know.

Trying it out was a quick way for me to run some ARMv7 vs. ARMv6 tests.

Raspbian provides a snappier desktop experience, even though it is compiled for ARMv6, so I am likely to mostly run Raspbian :)
Heater wrote:Don't be to enamoured with Linaro.

A couple of years back I was building a Pascal application on Linaro on an ISEE IGEPv2 board: [/url]https://www.isee.biz/products/igep-proc ... pv2-dm3730[/url] the performance was terrible until I figured out I had to rebuild the Free Pascal compiler with the right options to take advantage of the particular ARM variant on there.
http://Mikronauts.com - home of EZasPi, RoboPi, Pi Rtc Dio and Pi Jumper @Mikronauts on Twitter
Advanced Robotics, I/O expansion and prototyping boards for the Raspberry Pi

ssvb
Posts: 112
Joined: Sat May 19, 2012 6:15 pm

Re: Raspberry Pi 2: Linaro(ARMv7) vs Raspbian(ARMv6) Benchma

Sat Feb 14, 2015 12:48 am

jamesh wrote:Is that the Armv6 assembler optimised memxxx library? That's targeted at Armv6 specifically, I wonder if there is an equivalent NEON optimised version that can be used?
This is more about finding optimal memory access pattern and prefetch tuning. NEON does not have much to offer for memcpy by itself. Sure, NEON has much wider 128-bit registers, however ARM instructions LDM/STM (load/store multiple) also can read/write a large chunk of memory at once with just a single instruction. Here is how different memory access methods perform on RPi2, compared to RPi1

Basically, Cortex-A7 now uses automatic hardware prefetching, which is very nice for general purpuse code written in C. All assembly based copy methods provide roughly ~1GB/s speed (which is a good thing, that's how a proper processor should behave). If trying to use the PLD instruction for software prefetch, it is important to hit the beginning of a cache line (incr vs. wrap benchmark numbers show it), just like libcofi_rpi does :)

Still some of the memcpy implementations might be faster than the others when working with the data in L1/L2 caches.

markatlnk
Posts: 41
Joined: Sun Feb 23, 2014 7:53 pm

Re: Raspberry Pi 2: Linaro(ARMv7) vs Raspbian(ARMv6) Benchma

Sat Feb 14, 2015 4:24 pm

What gcc flags would force the ARMv7 optimizations? I would expect the code not to run on the ARMv6 devices.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 22653
Joined: Sat Jul 30, 2011 7:41 pm

Re: Raspberry Pi 2: Linaro(ARMv7) vs Raspbian(ARMv6) Benchma

Sat Feb 14, 2015 4:42 pm

markatlnk wrote:What gcc flags would force the ARMv7 optimizations? I would expect the code not to run on the ARMv6 devices.
See here http://www.raspberrypi.org/forums/viewt ... 33&t=98354
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

Return to “General discussion”