blob: 2d4b4fb301c09bb6cbb999e015111ea6b1e7d2c4 [file] [log] [blame] [view]
Andrew Gerrand5bc444d2014-12-10 11:35:11 +11001# Introduction
2
rakylla3d23202015-09-14 17:42:22 -07003Go is fully supported on Linux and Darwin. Any Go program that you can compile for x86/x86\_64 should work on Arm. Besides Linux and Darwin, Go is also experimentally supported on FreeBSD, and NetBSD.
Andrew Gerrand5bc444d2014-12-10 11:35:11 +11004
5# Supported architectures
6
7Go supports the following ARM architectural families.
8
Burcu Doganfe0fd212015-11-28 13:03:37 -06009| **Architecture** | **Status** | **GOARM value** |
10|:-----------------|:-----------|:----------------|
11| ARMv4 and below | sorry, not supported | n/a |
12| ARMv5 | supported | GOARM=5 |
Burcu Dogan912b17a2015-11-28 13:08:14 -060013| ARMv6 | supported | GOARM=6 |
Burcu Doganfe0fd212015-11-28 13:03:37 -060014| ARMv7 | supported | GOARM=7 |
15| ARMv8 | supported | GOARCH=arm64 |
Andrew Gerrand5bc444d2014-12-10 11:35:11 +110016
Burcu Dogan686c8ff2015-11-27 11:40:52 -080017Starting from Go 1.1, the appropriate GOARM value will be chosen if you compile the program from source on the target machine. In cross compilation situations, it is recommended that you always set an appropriate GOARM value.
Andrew Gerrand5bc444d2014-12-10 11:35:11 +110018
19# Supported operating systems
20
Burcu Dogan3e40cdf2015-11-27 11:47:27 -080021* ARM on Linux. You must run an [EABI](http://wiki.debian.org/ArmEabiPort) kernel. These are generally known as `armel` for softfloat (compatible with ARMv5) or `armhf` for hardware floating point (ARMv6 and above).
22* ARM on Darwin.
Burcu Dogan53b27b92015-11-28 13:07:02 -060023* ARM on FreeBSD and OpenBSD.
Andrew Gerrand5bc444d2014-12-10 11:35:11 +110024
25# Recommended Go version
26
27The recommended minimum version for running Go on arm systems is Go 1.1.
28
29# Tips and tricks
30
31## /tmp and tmpfs
32The ` go ` build tool uses ` /tmp ` when compiling and testing, this can cause heavy wear and tear if ` /tmp ` lives on your SD card. To minimise this effect, either ` export TMPDIR ` to somewhere that lives on another filesystem. Alternatively if you have lots of physical memory you can mount a swap backed tmpfs filesystem on /tmp by adding this line to ` /etc/fstab `
33
34```
35tmpfs /tmp tmpfs nodev,nosuid,mode=1777 0 0
36```
37
38## Swap
39Building Go from source requires at least 256mb of RAM. Running the tests requires at least 256mb of memory and at least 512mb of swap space.
40
41## Build failures due to lack of memory
42The Go tool will try to keep all your cpu cores busy when installing packages (during make.bash),
43this is normally preferable on PCs where memory is abundant.
44However, some powerful multicore ARM machines don't have enough memory to support parallel
45builds utilizing all available cores, and you can work around that by using the ` taskset(1) ` utility
46to limit Go to only use one core without resorting to swaps.
47```
48taskset 1 ./make.bash # use 3 if you want to use two cores
49```
50Note: the 1 here is a bitmask for cpu affinity and it's not the number of cpu cores you're
51willing to use, please refer to ` taskset(1) ` manual for details.
52
53# Known issues
54
55## Lack of floating point hardware on ARMv5
56The major issue with ARMv5 is the lack of floating point support in common ARMv5 harware<sup>†</sup>. When compiled with the GOARM=5 environment variable, the 5l linker will insert a call to ` _sfloat ` before any block of floating point instructions to branch into the floating point emulator. This means that binaries produced with a Go installation that was compiled with soft float support will work on all supported architectures, but builds compiled without soft floating point support will not work on ARMv5.
57
58<sup>†</sup> This isn't strictly true, there exist ARMv5 implementations which have VFP1 floating point. However the compiler doesn't support VFP1 yet.
59
60## html/template and test/nilptr.go test fail on HTC Android
61html/template test and test/nilptr.go is known to fail on HTC's Android kernels ([ref](http://www.mail-archive.com/android-developers@googlegroups.com/msg153389.html)), because the kernel will kill the application after 10 segfaults.
62
63## Potential kernel bug in 2.6.32-5-kirkwood on QNAP 219P
nathany2c4a8d92014-12-10 22:16:11 -080064See [Issue 5466](https://github.com/golang/go/issues/5466) for details. Updating to 3.2.0-4-kirkwood solved the issue.
Andrew Gerrand5bc444d2014-12-10 11:35:11 +110065
66# Success stories
67
68ARM hardware comes in a myriad of shapes and sizes. If you've had a success story building and running Go on your Arm system, please detail your results here.
69
70## Netgear Stora
71
72Architecture: ARMv5
73
74Operating System: Debian Sid
75
76The Netgear Stora is an ARMv5 (Marvell Kirkwood) platform. I flashed mine with a Debian Sid distribution and it was, until Go1, a solid platform for Go development. The main drawback is the Stora only has 128mb of ram, which is not quite enough to run ./all.bash as 5l can use more than 100mb of ram when linking some commands.
77
78Instructions for installing Debian on your Stora can be found on the OpenStora website, http://www.openstora.com/wiki/index.php?title=How_to_install_Debian_Linux_on_NETGEAR_Stora.
79
80> _-- dave cheney_
81
82## Qnap TS-119P II
83
84Architecture: ARMv5
85
86Operating System: Debian Squeeze
87
88The Qnap TS series of NASs are excellent hackable little linux hosts. The TS-11P9 II is a 2Ghz Marvell Kirkwood ARMv5 processor with 512mb of ram and a single SATA drive bay.
89
90The kirkwood platform is supported by the native debian installer. http://www.cyrius.com/debian/kirkwood/qnap/ts-119/install.html
91
92> _-- dave cheney_
93
94## Pandaboard
95
96Architecture: ARMv7
97
98Operating System: Ubuntu 12.04LTS (armhf)
99
100The Pandaboard is a dual core ARMv7 development board based on the Texas Instruments OMAP4 SoC platform. I run ubuntu 12.04 LTS server on mine, which is an excellent distribution for Arm development. The Pandaboard has a gig of ram which makes it excellent for development and benchmarking.
101
102Instructions and SD card image can be found on on the Ubuntu wiki, https://wiki.ubuntu.com/ARM/Server/Install#Installing_pre-installed_OMAP4_Precise_.2812.04.29_Server_Images.
103
104> _-- dave cheney_
105
106## BeagleBone
107
108Architecture: ARMv7 single core, Cortex-A8, 256MB RAM, 720 MHz
109
110Operating System: Angstrom Linux
111
112BeagleBone is similar to Beagleboard, but without the video components. Angstrom is a very small Linux distribution for ARM based systems. It is built on top of Yocto and OpenEmbedded with additional tools and recipes to make it even easier to build a distribution. You can think of Angstrom as Ubuntu and OpenEmbedded/Yocto as Debian. Angstrom is very light weight and fast compared to Ubuntu. It uses systemd instead of the sys5 scripts which help give you a very fast boot time of a few seconds.
113
114BeagleBone is probably faster than a RasberryPI because of it's newer Cortex-A8 dual-issue superscalar architecture, but the PI has the GPU which theoretically could be used with something like OpenCL to really run circles around the BeagleBone. However, for embedded applications the BeagleBone is easier to work with because it is ready out of the box with GPIO connections.
115
116I've cross compiled for ARM with 5g from a Mac and so far I haven't run into any problems. You can build on the BeagleBone, but cross compiling with Go is so easy that it is better to save wear and tear on the flash drive and just compile somewhere else.
117
118> _-- hans stimer_
119
120### Zyxel NSA 310
121
122Architecture: ARM5
123Platform: Debian Wheeze
124
125Successfuly built default branch, going to write fan control daemon for this device in golang.
126
127### Raspberry Pi
128
Jason Bubereld8d72c92015-09-07 15:58:27 -0700129* [Building Go 1.5 on the Raspberry Pi - Dave Cheney](http://dave.cheney.net/2015/09/04/building-go-1-5-on-the-raspberry-pi)
130
Andrew Gerrand5bc444d2014-12-10 11:35:11 +1100131Architecture: ARM1176JZFS, with floating point, running at 700Mhz
132
133Operating System: Debian Wheezy beta distribution (http://www.raspberrypi.org/archives/1435) reported as:
134
135` Linux raspberrypi 3.1.9+ #125 PREEMPT Sun Jun 17 16:09:36 BST 2012 armv6l GNU/Linux `
136
137**Memory Split**: the Pi shares its 256mb of memory between the CPU and the GPU. You should allocate as much memory as possible to the CPU for a successful compilation. The configuration for the memory split is stored on your SD card. This link has a script to adjust the configuration, http://sirlagz.net/?p=445.
138
139Go version weekly.2012-03-27 +645947213cac, with timeout and GOARM 7 patches http://codereview.appspot.com/5987063/) builds with 2 test failures: encoding/gob fails with out of memory, and fmt fails the NaN test.
140
141Successfully installed and run SVGo via go get github.com/ajstarks/svgo, tested with goplay:
142
143![http://farm8.staticflickr.com/7139/7451061716_fbb585c55f.jpg](http://farm8.staticflickr.com/7139/7451061716_fbb585c55f.jpg)
144
145Division benchmark via http://codereview.appspot.com/6258067:
146
147
148```
149$ cd $GOROOT/src/pkg/runtime
150$ go test -test.bench=BenchmarkUint
151
152
153BenchmarkUint32Div7 5000000 547 ns/op
154BenchmarkUint32Div37 5000000 547 ns/op
155BenchmarkUint32Div123 5000000 547 ns/op
156BenchmarkUint32Div763 5000000 547 ns/op
157BenchmarkUint32Div1247 5000000 547 ns/op
158BenchmarkUint32Div9305 5000000 547 ns/op
159BenchmarkUint32Div13307 5000000 547 ns/op
160BenchmarkUint32Div52513 5000000 547 ns/op
161BenchmarkUint32Div60978747 5000000 547 ns/op
162BenchmarkUint32Div106956295 5000000 547 ns/op
163BenchmarkUint32Mod7 5000000 547 ns/op
164BenchmarkUint32Mod37 5000000 547 ns/op
165BenchmarkUint32Mod123 5000000 547 ns/op
166BenchmarkUint32Mod763 5000000 547 ns/op
167BenchmarkUint32Mod1247 5000000 547 ns/op
168BenchmarkUint32Mod9305 5000000 547 ns/op
169BenchmarkUint32Mod13307 5000000 547 ns/op
170BenchmarkUint32Mod52513 5000000 547 ns/op
171BenchmarkUint32Mod60978747 5000000 547 ns/op
172BenchmarkUint32Mod106956295 5000000 547 ns/op
173```
174
175Running the hardware floating point distribution, Raspbian "pisces" (http://www.raspbian.org/PiscesImages) and applying the patches in https://gist.github.com/3116118, here are the results of the Eleanor McHugh gospeed benchmark:
176
177```
178raspbian@pisces:~/gowork/src/github.com/feyeleanor/gospeed$ uname -a
179Linux pisces 3.1.9+ #171 PREEMPT Tue Jul 17 01:08:22 BST 2012 armv6l GNU/Linux
180raspbian@pisces:~/gowork/src/github.com/feyeleanor/gospeed$ go test -test.bench=".*"
181PASS
182BenchmarkBaselineCastInt32ToInt 100000000 13.5 ns/op
183BenchmarkBaselineCastIntToInt32 100000000 13.5 ns/op
184BenchmarkBaselineCastInt64ToUint64 100000000 17.8 ns/op
185BenchmarkBaselineCastUint64ToInt64 100000000 17.2 ns/op
186BenchmarkBaselineVariableGet 100000000 13.4 ns/op
187BenchmarkBaselineVariableSet 100000000 22.4 ns/op
188BenchmarkBaselineVariableGetInterface 100000000 13.5 ns/op
189BenchmarkBaselineVariableSetInterface 50000000 31.3 ns/op
190BenchmarkBaselineVariableIncrement 100000000 23.9 ns/op
191BenchmarkBaselineVariableDecrement 100000000 23.9 ns/op
192BenchmarkBaselineFieldGet 100000000 13.5 ns/op
193BenchmarkBaselineFieldSet 100000000 20.9 ns/op
194BenchmarkBaselineSliceGet 50000000 32.9 ns/op
195BenchmarkBaselineSliceSet 50000000 34.5 ns/op
196BenchmarkBaselineMapIntGet 1000000 1448 ns/op
197BenchmarkBaselineMapIntSet 1000000 1968 ns/op
198BenchmarkBaselineMapStringGet 1000000 1119 ns/op
199BenchmarkBaselineMapStringSet 1000000 1675 ns/op
200BenchmarkBaselineIf 100000000 15.0 ns/op
201BenchmarkBaselineIfElse 100000000 15.0 ns/op
202BenchmarkBaselineSwitchDefault 100000000 13.5 ns/op
203BenchmarkBaselineSwitchOneCase 100000000 15.0 ns/op
204BenchmarkBaselineSwitchTwoCases 100000000 18.0 ns/op
205BenchmarkBaselineSwitchTwoCasesFallthrough 100000000 18.0 ns/op
206BenchmarkBaselineForLoopIteration 50000000 42.0 ns/op
207BenchmarkBaselineForReverseLoopIteration 50000000 36.0 ns/op
208BenchmarkBaselineForRange 20000000 80.9 ns/op
209BenchmarkBaselineForSliceLength 50000000 39.0 ns/op
210BenchmarkBaselineForReverseSliceLength 50000000 36.0 ns/op
211BenchmarkBaselineForLoopIteration10 20000000 119 ns/op
212BenchmarkBaselineForReverseLoopIteration10 20000000 92.9 ns/op
213BenchmarkBaselineForRange10 10000000 215 ns/op
214BenchmarkBaselineForSliceLength10 20000000 109 ns/op
215BenchmarkBaselineForReverseSliceLength10 20000000 92.9 ns/op
216BenchmarkBaselineForLoopIteration100 2000000 929 ns/op
217BenchmarkBaselineForReverseLoopIteration100 5000000 700 ns/op
218BenchmarkBaselineForRange100 1000000 1567 ns/op
219BenchmarkBaselineForSliceLength100 2000000 853 ns/op
220BenchmarkBaselineForReverseSliceLength100 5000000 700 ns/op
221BenchmarkBaselineForLoopIteration10000 10000 106006 ns/op
222BenchmarkBaselineForReverseLoopIteration10000 50000 67480 ns/op
223BenchmarkBaselineForRange10000 10000 153841 ns/op
224BenchmarkBaselineForSliceLength10000 20000 85735 ns/op
225BenchmarkBaselineForReverseSliceLength10000 50000 69461 ns/op
226BenchmarkBaselineMakeChannelBoolUnbuffered 200000 10162 ns/op
227BenchmarkBaselineMakeChannelBool1 200000 12517 ns/op
228BenchmarkBaselineMakeChannelBool10 200000 12521 ns/op
229BenchmarkBaselineMakeChannelStringUnbuffered 500000 10369 ns/op
230BenchmarkBaselineMakeChannelString1 200000 12576 ns/op
231BenchmarkBaselineMakeChannelString10 100000 22358 ns/op
232BenchmarkBaselineGo 50000 367593 ns/op
233BenchmarkBaselineFunctionCall 50000000 57.0 ns/op
234BenchmarkBaselineFunctionCallArg 20000000 81.0 ns/op
235BenchmarkBaselineFunctionCall5VarArgs 500000 6852 ns/op
236BenchmarkBaselineFunctionCallInt 50000000 60.3 ns/op
237BenchmarkBaselineFunctionCall5VarInts 1000000 3185 ns/op
238BenchmarkBaselineFunctionCallWithDefer 1000000 2330 ns/op
239BenchmarkBaselineFunctionCallPanicRecover 500000 6222 ns/op
240BenchmarkBaselineMethodCallDirect 20000000 83.8 ns/op
241BenchmarkBaselineMethodCallDirect1Arg 20000000 106 ns/op
242BenchmarkBaselineMethodCallDirect1Int 20000000 85.2 ns/op
243BenchmarkBaselineMethodCallDirect5Args 5000000 368 ns/op
244BenchmarkBaselineMethodCallDirect5Ints 10000000 233 ns/op
245BenchmarkBaselineMethodCallIndirect 100000000 18.0 ns/op
246BenchmarkBaselineMethodCallIndirect1Arg 50000000 42.0 ns/op
247BenchmarkBaselineMethodCallIndirect1Int 100000000 19.5 ns/op
248BenchmarkBaselineMethodCallIndirect5Args 5000000 309 ns/op
249BenchmarkBaselineMethodCallIndirect5Ints 10000000 168 ns/op
250BenchmarkBaselineTypeAssertion 10000000 218 ns/op
251BenchmarkBaselineTypeAssertionEmptyInterface 20000000 106 ns/op
252BenchmarkBaselineTypeAssertionInterface1 5000000 576 ns/op
253BenchmarkBaselineTypeAssertionInterface2 5000000 579 ns/op
254BenchmarkBaselineTypeReflectPrimitiveToValue 5000000 425 ns/op
255BenchmarkBaselineTypeReflectSliceToValue 1000000 3218 ns/op
256BenchmarkBaselineTypeReflectStructToValue 500000 4760 ns/op
257BenchmarkBaselineTypeCheck 10000000 189 ns/op
258BenchmarkBaselineTypeCheckEmptyInterface 20000000 93.1 ns/op
259BenchmarkBaselineTypeCheckInterface1 5000000 511 ns/op
260BenchmarkBaselineTypeCheckInterface2 5000000 516 ns/op
261BenchmarkBaselineTypeSwitchOneCase 10000000 262 ns/op
262BenchmarkBaselineTypeSwitchBasicTypesCase 10000000 295 ns/op
263BenchmarkBaselineTypeSwitchEmptyInterface 10000000 163 ns/op
264BenchmarkBaselineTypeSwitchInterface1 5000000 588 ns/op
265BenchmarkBaselineTypeSwitchInterface2 5000000 602 ns/op
266BenchmarkBaselineNewStructureLiteral 20000000 84.0 ns/op
267BenchmarkBaselineNewStructure 20000000 127 ns/op
268BenchmarkBaselineNewSliceLiteral 50000000 54.2 ns/op
269BenchmarkBaselineNewSlice 1000000 3124 ns/op
270BenchmarkBaselineNewMapLiteralIntToInt 500000 9083 ns/op
271BenchmarkBaselineNewMapLiteralIntToInterface 500000 9807 ns/op
272BenchmarkBaselineNewMapLiteralStringToInt 500000 9792 ns/op
273BenchmarkBaselineNewMapLiteralStringToInterface 500000 10595 ns/op
274BenchmarkBaselineNewMapLiteralIntToInt2Item 200000 14265 ns/op
275BenchmarkBaselineNewMapLiteralIntToInterface2Item 200000 14669 ns/op
276BenchmarkBaselineNewMapLiteralStringToInt2Item 200000 14025 ns/op
277BenchmarkBaselineNewMapLiteralStringToInterface2Item 200000 15086 ns/op
278BenchmarkBaselineNewMapIntToInt 500000 9025 ns/op
279BenchmarkBaselineNewMapIntToInterface 500000 9753 ns/op
280BenchmarkBaselineNewMapStringToInt 500000 9740 ns/op
281BenchmarkBaselineNewMapStringToInterface 500000 10486 ns/op
282BenchmarkBaselineSliceCopy 5000000 300 ns/op
283BenchmarkBaselineNewSliceAppendElement1 1000000 3318 ns/op
284BenchmarkBaselineNewSliceAppendElement10 1000000 5174 ns/op
285ok github.com/feyeleanor/gospeed 417.296s
286```
287
288_-- anthony starks_
289
Burcu Dogan894f5172015-12-06 18:47:54 -0800290## Raspberry Pi Zero
291
292Architecture: 1 GHz ARM1176JZF-S, running at 700Mhz; 512MB RAM
293
294Operating System: Raspbian Jessie
295
296```
297$ go version
298go version devel +5c24832 Sat Dec 5 00:10:40 2015 +0000 linux/arm
299
300$ go test -timeout 20m -v -bench=Benchmark -run=X
301PASS
302BenchmarkAppend 3000000 518 ns/op
303BenchmarkAppendGrowByte 20 95720661 ns/op
304BenchmarkAppendGrowString 1 2232033275 ns/op
305BenchmarkAppend1Byte 20000000 99.0 ns/op
306BenchmarkAppend4Bytes 10000000 120 ns/op
307BenchmarkAppend7Bytes 10000000 155 ns/op
308BenchmarkAppend8Bytes 10000000 132 ns/op
309BenchmarkAppend15Bytes 10000000 162 ns/op
310BenchmarkAppend16Bytes 10000000 134 ns/op
311BenchmarkAppend32Bytes 10000000 121 ns/op
312BenchmarkAppendStr1Byte 20000000 97.0 ns/op
313BenchmarkAppendStr4Bytes 10000000 118 ns/op
314BenchmarkAppendStr8Bytes 10000000 129 ns/op
315BenchmarkAppendStr16Bytes 10000000 132 ns/op
316BenchmarkAppendStr32Bytes 10000000 121 ns/op
317BenchmarkAppendSpecialCase 2000000 791 ns/op
318BenchmarkCopy1Byte 10000000 132 ns/op 7.54 MB/s
319BenchmarkCopy2Byte 10000000 144 ns/op 13.81 MB/s
320BenchmarkCopy4Byte 10000000 153 ns/op 26.12 MB/s
321BenchmarkCopy8Byte 10000000 164 ns/op 48.51 MB/s
322BenchmarkCopy12Byte 10000000 162 ns/op 74.03 MB/s
323BenchmarkCopy16Byte 10000000 167 ns/op 95.63 MB/s
324BenchmarkCopy32Byte 10000000 155 ns/op 205.20 MB/s
325BenchmarkCopy128Byte 10000000 192 ns/op 664.06 MB/s
326BenchmarkCopy1024Byte 2000000 689 ns/op 1484.28 MB/s
327BenchmarkCopy1String 10000000 120 ns/op 8.27 MB/s
328BenchmarkCopy2String 10000000 134 ns/op 14.85 MB/s
329BenchmarkCopy4String 10000000 142 ns/op 28.01 MB/s
330BenchmarkCopy8String 10000000 154 ns/op 51.81 MB/s
331BenchmarkCopy12String 10000000 151 ns/op 79.01 MB/s
332BenchmarkCopy16String 10000000 157 ns/op 101.82 MB/s
333BenchmarkCopy32String 10000000 145 ns/op 219.52 MB/s
334BenchmarkCopy128String 10000000 182 ns/op 700.88 MB/s
335BenchmarkCopy1024String 2000000 976 ns/op 1048.87 MB/s
336BenchmarkChanNonblocking 5000000 246 ns/op
337BenchmarkSelectUncontended 500000 3610 ns/op
338BenchmarkSelectSyncContended 100000 18957 ns/op
339BenchmarkSelectAsyncContended 500000 3614 ns/op
340BenchmarkSelectNonblock 2000000 814 ns/op
341BenchmarkChanUncontended 10000 135820 ns/op
342BenchmarkChanContended 10000 133122 ns/op
343BenchmarkChanSync 200000 5870 ns/op
344BenchmarkChanProdCons0 200000 5899 ns/op
345BenchmarkChanProdCons10 500000 2138 ns/op
346BenchmarkChanProdCons100 1000000 1557 ns/op
347BenchmarkChanProdConsWork0 200000 8948 ns/op
348BenchmarkChanProdConsWork10 300000 5043 ns/op
349BenchmarkChanProdConsWork100 300000 4498 ns/op
350BenchmarkSelectProdCons 200000 10818 ns/op
351BenchmarkChanCreation 500000 3187 ns/op
352BenchmarkChanSem 1000000 1266 ns/op
353BenchmarkChanPopular 100 14315946 ns/op
354BenchmarkCallClosure 30000000 50.0 ns/op
355BenchmarkCallClosure1 30000000 56.3 ns/op
356BenchmarkCallClosure2 3000000 512 ns/op
357BenchmarkCallClosure3 3000000 503 ns/op
358BenchmarkCallClosure4 3000000 512 ns/op
359BenchmarkComplex128DivNormal 2000000 735 ns/op
360BenchmarkComplex128DivNisNaN 200000 6001 ns/op
361BenchmarkComplex128DivDisNaN 200000 5992 ns/op
362BenchmarkComplex128DivNisInf 5000000 390 ns/op
363BenchmarkComplex128DivDisInf 5000000 375 ns/op
364BenchmarkSetTypePtr 10000000 119 ns/op 33.43 MB/s
365BenchmarkSetTypePtr8 10000000 227 ns/op 140.89 MB/s
366BenchmarkSetTypePtr16 5000000 285 ns/op 224.30 MB/s
367BenchmarkSetTypePtr32 5000000 388 ns/op 329.65 MB/s
368BenchmarkSetTypePtr64 3000000 591 ns/op 432.77 MB/s
369BenchmarkSetTypePtr126 1000000 1021 ns/op 493.46 MB/s
370BenchmarkSetTypePtr128 1000000 1003 ns/op 510.46 MB/s
371BenchmarkSetTypePtrSlice 200000 7427 ns/op 551.43 MB/s
372BenchmarkSetTypeNode1 10000000 217 ns/op 55.20 MB/s
373BenchmarkSetTypeNode1Slice 1000000 1284 ns/op 299.03 MB/s
374BenchmarkSetTypeNode8 5000000 277 ns/op 144.17 MB/s
375BenchmarkSetTypeNode8Slice 500000 2825 ns/op 453.02 MB/s
376BenchmarkSetTypeNode64 2000000 661 ns/op 398.89 MB/s
377BenchmarkSetTypeNode64Slice 100000 15531 ns/op 543.92 MB/s
378BenchmarkSetTypeNode64Dead 5000000 382 ns/op 689.66 MB/s
379BenchmarkSetTypeNode64DeadSlice 100000 13252 ns/op 637.46 MB/s
380BenchmarkSetTypeNode124 1000000 1017 ns/op 495.27 MB/s
381BenchmarkSetTypeNode124Slice 50000 28139 ns/op 573.14 MB/s
382BenchmarkSetTypeNode126 2000000 1001 ns/op 511.10 MB/s
383BenchmarkSetTypeNode126Slice 50000 26535 ns/op 617.43 MB/s
384BenchmarkSetTypeNode128 1000000 1087 ns/op 478.22 MB/s
385BenchmarkSetTypeNode128Slice 50000 29166 ns/op 570.52 MB/s
386BenchmarkSetTypeNode130 1000000 1067 ns/op 494.83 MB/s
387BenchmarkSetTypeNode130Slice 50000 29691 ns/op 569.04 MB/s
388BenchmarkSetTypeNode1024 200000 7155 ns/op 573.51 MB/s
389BenchmarkSetTypeNode1024Slice 5000 224292 ns/op 585.52 MB/s
390BenchmarkAllocation 2000 957094 ns/op
391BenchmarkHash5 5000000 349 ns/op 14.29 MB/s
392BenchmarkHash16 3000000 436 ns/op 36.66 MB/s
393BenchmarkHash64 1000000 1007 ns/op 63.49 MB/s
394BenchmarkHash1024 200000 11267 ns/op 90.88 MB/s
395BenchmarkHash65536 2000 797741 ns/op 82.15 MB/s
396BenchmarkEqEfaceConcrete 20000000 111 ns/op
397BenchmarkEqIfaceConcrete 20000000 106 ns/op
398BenchmarkNeEfaceConcrete 20000000 111 ns/op
399BenchmarkNeIfaceConcrete 20000000 106 ns/op
400BenchmarkConvT2ESmall 3000000 561 ns/op
401BenchmarkConvT2EUintptr 2000000 599 ns/op
402BenchmarkConvT2ELarge 2000000 767 ns/op
403BenchmarkConvT2ISmall 2000000 724 ns/op
404BenchmarkConvT2IUintptr 2000000 750 ns/op
405BenchmarkConvT2ILarge 2000000 907 ns/op
406BenchmarkConvI2E 20000000 76.7 ns/op
407BenchmarkConvI2I 3000000 425 ns/op
408BenchmarkAssertE2T 10000000 176 ns/op
409BenchmarkAssertE2TLarge 10000000 189 ns/op
410BenchmarkAssertE2I 3000000 455 ns/op
411BenchmarkAssertI2T 10000000 176 ns/op
412BenchmarkAssertI2I 3000000 451 ns/op
413BenchmarkAssertI2E 20000000 109 ns/op
414BenchmarkAssertE2E 30000000 40.7 ns/op
415BenchmarkAssertE2T2 10000000 180 ns/op
416BenchmarkAssertE2T2Blank 50000000 22.8 ns/op
417BenchmarkAssertI2E2 20000000 117 ns/op
418BenchmarkAssertI2E2Blank 100000000 21.7 ns/op
419BenchmarkAssertE2E2 10000000 231 ns/op
420BenchmarkAssertE2E2Blank 100000000 21.8 ns/op
421BenchmarkMalloc8 3000000 507 ns/op
422BenchmarkMalloc16 2000000 848 ns/op
423BenchmarkMallocTypeInfo8 2000000 1012 ns/op
424BenchmarkMallocTypeInfo16 1000000 1168 ns/op
425BenchmarkMallocLargeStruct 500000 4823 ns/op
426BenchmarkGoroutineSelect 20 76172338 ns/op
427BenchmarkGoroutineBlocking 20 63469806 ns/op
428BenchmarkGoroutineForRange 20 64107650 ns/op
429BenchmarkGoroutineIdle 20 60844381 ns/op
430BenchmarkMapPop100 3000 409498 ns/op
431BenchmarkMapPop1000 200 7783817 ns/op
432BenchmarkMapPop10000 10 170736704 ns/op
433BenchmarkHashStringSpeed 3000000 541 ns/op
434BenchmarkHashBytesSpeed 1000000 1157 ns/op
435BenchmarkHashInt32Speed 5000000 371 ns/op
436BenchmarkHashInt64Speed 3000000 427 ns/op
437BenchmarkHashStringArraySpeed 1000000 1417 ns/op
438BenchmarkMegMap 3000000 404 ns/op
439BenchmarkMegOneMap 5000000 346 ns/op
440BenchmarkMegEqMap 100 16663414 ns/op
441BenchmarkMegEmptyMap 10000000 160 ns/op
442BenchmarkSmallStrMap 3000000 415 ns/op
443BenchmarkMapStringKeysEight_16 3000000 417 ns/op
444BenchmarkMapStringKeysEight_32 3000000 420 ns/op
445BenchmarkMapStringKeysEight_64 3000000 420 ns/op
446BenchmarkMapStringKeysEight_1M 3000000 419 ns/op
447BenchmarkIntMap 10000000 220 ns/op
448BenchmarkRepeatedLookupStrMapKey32 1000000 1015 ns/op
449BenchmarkRepeatedLookupStrMapKey1M 100 15652033 ns/op
450BenchmarkNewEmptyMap 1000000 1395 ns/op 0 B/op 0 allocs/op
451BenchmarkNewSmallMap 300000 3368 ns/op 0 B/op 0 allocs/op
452BenchmarkMapIter 500000 2947 ns/op
453BenchmarkMapIterEmpty 20000000 163 ns/op
454BenchmarkSameLengthMap 10000000 133 ns/op
455BenchmarkBigKeyMap 2000000 899 ns/op
456BenchmarkBigValMap 2000000 922 ns/op
457BenchmarkSmallKeyMap 3000000 402 ns/op
458BenchmarkComplexAlgMap 1000000 2003 ns/op
459BenchmarkMemmove0 20000000 61.4 ns/op
460BenchmarkMemmove1 20000000 76.6 ns/op 13.05 MB/s
461BenchmarkMemmove2 20000000 86.3 ns/op 23.18 MB/s
462BenchmarkMemmove3 20000000 83.7 ns/op 35.83 MB/s
463BenchmarkMemmove4 20000000 88.0 ns/op 45.48 MB/s
464BenchmarkMemmove5 20000000 110 ns/op 45.37 MB/s
465BenchmarkMemmove6 20000000 115 ns/op 51.99 MB/s
466BenchmarkMemmove7 10000000 123 ns/op 56.89 MB/s
467BenchmarkMemmove8 20000000 99.5 ns/op 80.44 MB/s
468BenchmarkMemmove9 20000000 112 ns/op 79.76 MB/s
469BenchmarkMemmove10 10000000 125 ns/op 79.48 MB/s
470BenchmarkMemmove11 10000000 125 ns/op 87.84 MB/s
471BenchmarkMemmove12 20000000 96.9 ns/op 123.87 MB/s
472BenchmarkMemmove13 20000000 110 ns/op 117.83 MB/s
473BenchmarkMemmove14 10000000 123 ns/op 113.65 MB/s
474BenchmarkMemmove15 10000000 122 ns/op 122.30 MB/s
475BenchmarkMemmove16 20000000 101 ns/op 156.89 MB/s
476BenchmarkMemmove32 20000000 90.8 ns/op 352.44 MB/s
477BenchmarkMemmove64 20000000 108 ns/op 588.34 MB/s
478BenchmarkMemmove128 10000000 127 ns/op 1001.83 MB/s
479BenchmarkMemmove256 10000000 178 ns/op 1436.19 MB/s
480BenchmarkMemmove512 5000000 326 ns/op 1569.07 MB/s
481BenchmarkMemmove1024 2000000 631 ns/op 1620.84 MB/s
482BenchmarkMemmove2048 1000000 1251 ns/op 1636.60 MB/s
483BenchmarkMemmove4096 500000 2499 ns/op 1638.97 MB/s
484BenchmarkMemmoveUnaligned0 20000000 72.5 ns/op
485BenchmarkMemmoveUnaligned1 20000000 87.8 ns/op 11.39 MB/s
486BenchmarkMemmoveUnaligned2 20000000 99.4 ns/op 20.12 MB/s
487BenchmarkMemmoveUnaligned3 20000000 96.9 ns/op 30.96 MB/s
488BenchmarkMemmoveUnaligned4 10000000 135 ns/op 29.44 MB/s
489BenchmarkMemmoveUnaligned5 10000000 147 ns/op 33.90 MB/s
490BenchmarkMemmoveUnaligned6 10000000 146 ns/op 41.09 MB/s
491BenchmarkMemmoveUnaligned7 10000000 151 ns/op 46.27 MB/s
492BenchmarkMemmoveUnaligned8 10000000 156 ns/op 51.22 MB/s
493BenchmarkMemmoveUnaligned9 10000000 161 ns/op 55.82 MB/s
494BenchmarkMemmoveUnaligned10 10000000 166 ns/op 60.09 MB/s
495BenchmarkMemmoveUnaligned11 10000000 171 ns/op 64.17 MB/s
496BenchmarkMemmoveUnaligned12 10000000 177 ns/op 67.79 MB/s
497BenchmarkMemmoveUnaligned13 10000000 181 ns/op 71.60 MB/s
498BenchmarkMemmoveUnaligned14 10000000 189 ns/op 74.03 MB/s
499BenchmarkMemmoveUnaligned15 10000000 196 ns/op 76.30 MB/s
500BenchmarkMemmoveUnaligned16 10000000 200 ns/op 79.91 MB/s
501BenchmarkMemmoveUnaligned32 10000000 221 ns/op 144.64 MB/s
502BenchmarkMemmoveUnaligned64 5000000 290 ns/op 220.16 MB/s
503BenchmarkMemmoveUnaligned128 3000000 413 ns/op 309.84 MB/s
504BenchmarkMemmoveUnaligned256 2000000 766 ns/op 334.16 MB/s
505BenchmarkMemmoveUnaligned512 2000000 925 ns/op 553.13 MB/s
506BenchmarkMemmoveUnaligned1024 500000 2747 ns/op 372.66 MB/s
507BenchmarkMemmoveUnaligned2048 500000 3180 ns/op 643.85 MB/s
508BenchmarkMemmoveUnaligned4096 200000 6206 ns/op 659.99 MB/s
509BenchmarkMemclr5 20000000 105 ns/op 47.53 MB/s
510BenchmarkMemclr16 20000000 110 ns/op 144.77 MB/s
511BenchmarkMemclr64 10000000 125 ns/op 511.58 MB/s
512BenchmarkMemclr256 10000000 182 ns/op 1402.34 MB/s
513BenchmarkMemclr4096 500000 2489 ns/op 1645.22 MB/s
514BenchmarkMemclr65536 50000 39883 ns/op 1643.18 MB/s
515BenchmarkMemclr1M 2000 636812 ns/op 1646.60 MB/s
516BenchmarkMemclr4M 500 2549362 ns/op 1645.24 MB/s
517BenchmarkMemclr8M 300 5162451 ns/op 1624.93 MB/s
518BenchmarkMemclr16M 200 10300878 ns/op 1628.72 MB/s
519BenchmarkMemclr64M 30 42801198 ns/op 1567.92 MB/s
520BenchmarkGoMemclr5 20000000 73.5 ns/op 67.99 MB/s
521BenchmarkGoMemclr16 20000000 85.9 ns/op 186.24 MB/s
522BenchmarkGoMemclr64 20000000 87.8 ns/op 729.24 MB/s
523BenchmarkGoMemclr256 10000000 160 ns/op 1591.97 MB/s
524BenchmarkClearFat8 100000000 15.6 ns/op
525BenchmarkClearFat12 100000000 27.5 ns/op
526BenchmarkClearFat16 100000000 32.4 ns/op
527BenchmarkClearFat24 50000000 57.0 ns/op
528BenchmarkClearFat32 50000000 80.5 ns/op
529BenchmarkClearFat40 30000000 77.5 ns/op
530BenchmarkClearFat48 30000000 105 ns/op
531BenchmarkClearFat56 20000000 87.1 ns/op
532BenchmarkClearFat64 20000000 137 ns/op
533BenchmarkClearFat128 20000000 278 ns/op
534BenchmarkClearFat256 5000000 537 ns/op
535BenchmarkClearFat512 2000000 1293 ns/op
536BenchmarkClearFat1024 1000000 2545 ns/op
537BenchmarkCopyFat8 100000000 12.2 ns/op
538BenchmarkCopyFat12 100000000 20.3 ns/op
539BenchmarkCopyFat16 100000000 34.3 ns/op
540BenchmarkCopyFat24 50000000 27.7 ns/op
541BenchmarkCopyFat32 50000000 25.4 ns/op
542BenchmarkCopyFat64 20000000 135 ns/op
543BenchmarkCopyFat128 10000000 299 ns/op
544BenchmarkCopyFat256 2000000 571 ns/op
545BenchmarkCopyFat512 1000000 1218 ns/op
546BenchmarkCopyFat1024 500000 2665 ns/op
547BenchmarkFinalizer 50 20313669 ns/op
548BenchmarkFinalizerRun 30000 49987 ns/op
549BenchmarkSyscall 1000000 1625 ns/op
550BenchmarkSyscallWork 500000 2668 ns/op
551BenchmarkSyscallExcess 1000000 1613 ns/op
552BenchmarkSyscallExcessWork 500000 2658 ns/op
553BenchmarkPingPongHog 100000 20539 ns/op
554BenchmarkStackGrowth 50000 28473 ns/op
555BenchmarkStackGrowthDeep 500 2845263 ns/op
556BenchmarkCreateGoroutines 300000 4297 ns/op
557BenchmarkCreateGoroutinesParallel 300000 4300 ns/op
558BenchmarkCreateGoroutinesCapture 50000 33218 ns/op 16 B/op 1 allocs/op
559BenchmarkClosureCall 30000000 55.1 ns/op
560BenchmarkMatmult 10000000 196 ns/op
561BenchmarkIfaceCmp100 500000 2672 ns/op
562BenchmarkIfaceCmpNil100 500000 2982 ns/op
563BenchmarkDefer 1000000 1819 ns/op
564BenchmarkDefer10 1000000 1478 ns/op
565BenchmarkDeferMany 500000 3464 ns/op
566BenchmarkStackCopy 1 3714828065 ns/op
567BenchmarkCompareStringEqual 10000000 160 ns/op
568BenchmarkCompareStringIdentical 30000000 54.1 ns/op
569BenchmarkCompareStringSameLength 20000000 111 ns/op
570BenchmarkCompareStringDifferentLength 100000000 16.3 ns/op
571BenchmarkCompareStringBigUnaligned 100 16695582 ns/op 62.81 MB/s
572BenchmarkCompareStringBig 100 17208318 ns/op 60.93 MB/s
573BenchmarkRuneIterate 300000 5159 ns/op
574BenchmarkRuneIterate2 300000 5158 ns/op
575BenchmarkUint32Div7 10000000 144 ns/op
576BenchmarkUint32Div37 10000000 144 ns/op
577BenchmarkUint32Div123 10000000 144 ns/op
578BenchmarkUint32Div763 10000000 148 ns/op
579BenchmarkUint32Div1247 10000000 144 ns/op
580BenchmarkUint32Div9305 10000000 144 ns/op
581BenchmarkUint32Div13307 10000000 144 ns/op
582BenchmarkUint32Div52513 10000000 144 ns/op
583BenchmarkUint32Div60978747 10000000 131 ns/op
584BenchmarkUint32Div106956295 10000000 131 ns/op
585BenchmarkUint32Mod7 10000000 144 ns/op
586BenchmarkUint32Mod37 10000000 144 ns/op
587BenchmarkUint32Mod123 10000000 144 ns/op
588BenchmarkUint32Mod763 10000000 144 ns/op
589BenchmarkUint32Mod1247 10000000 144 ns/op
590BenchmarkUint32Mod9305 10000000 144 ns/op
591BenchmarkUint32Mod13307 10000000 144 ns/op
592BenchmarkUint32Mod52513 10000000 144 ns/op
593BenchmarkUint32Mod60978747 10000000 131 ns/op
594BenchmarkUint32Mod106956295 10000000 131 ns/op
595ok runtime 566.969s
596```
597
Andrew Gerrand5bc444d2014-12-10 11:35:11 +1100598## ODROID-X
599
600Architecture: ARMv7 quad-core Cortex-A9 (Samsung Exynos 4412 1.4GHz), 1GB RAM, Mali graphics (untested).
601
602Operating System: [Archlinux ARM](http://archlinuxarm.org/)
603
604Go pre-1.1 compiles out of the box. The four cores make it particularly suited to Go multi-threaded programs. An ODROID-X2 is coming (Nov 2012) with more RAM.
605
606_-- Rémy Oudompheng_
607
608## BananaPi
609
610[BananaPi](http://bananapi.org) has a few enhanced hardware components compare with Raspberry Pi.
611
612| **Architecture** | **Comments** |
613|:-----------------|:-------------|
614| [Allwinner A20(ARM Cortex-A7 Dual-core, 1GHz, Mali400MP2 GPU)](http://www.allwinnertech.com/en/clq/processora/A20.html) | tbc |
615| eSATA | No worry to wear out your root SD Card|
616| Onboard Microphone | tbc |
617| 1G Etherenet | tbc |
618| 1G RAM | tbc |
619| Reset Switch | To reset the board ?|
620| Power Switch | To power cycle the board ?|
621
622```
Andrew Gerrand5bc444d2014-12-10 11:35:11 +1100623root@bpi01:/data/go13/src# cat ./buildgo.bash
624#!/bin/bash
625# use 1 CPU to avoid out of memory compilation issue.
626time taskset 2 ./make.bash
627
628root@bpi01:/data/go13/src# ./buildgo.bash
629
630<snipped>
631
632Installed Go for linux/arm in /data/go1.3
633Installed commands in /data/go1.3/bin
634
635real 9m9.222s
636user 8m18.960s
637sys 0m40.920s
638root@bpi01:/data/go1.3/src#
639```
640
641_--T.J. Yang_
642
643## AppliedMicro X-Gene (ARMv8)
644
645Architecture: ARMv8 (64-bit) 8-core, 2.4GHz, 16GB RAM
646
Itaru Kitayamafa6e1042015-08-04 10:50:04 +0900647Operating Systems: Linux, Fedora 21
Andrew Gerrand5bc444d2014-12-10 11:35:11 +1100648
Aram Hăvărneanua9c4b042015-03-25 14:53:56 +0100649You will need to cross-compile a toolchain using bootstrap.bash. After you copy it to the arm64 system and set `GOROOT_BOOTSTRAP`, you can build go natively.
Andrew Cenciniaa3ff6f2015-07-15 18:12:48 -0400650
651## 96Boards HiKey (ARMv8)
652
653Architecture: ARMv8 (64-bit) 8-core, 1.2GHz, 1GB RAM
654
655Operating System: Linux (Linaro)
656
657Go Version: 1.5Beta1
658
659Special Notes: Enable a swap partition (<=1GB is fine). Build process is CPU-intensive and may cause the internal 90C temperature threshold to be exceeded - keep the HiKey cool during the build.
660
Ian Lance Taylor1385efb2015-07-31 10:42:17 -0700661As mentioned above, use bootstrap.sh (e.g. on Ubuntu AMD64) for ARM64, then transfer over the bootstrap tbx file, untar it, and use it as GOROOT_BOOTSTRAP. Check out the Go sources into a separate GOROOT, and build.
662
Jason Bubereld8d72c92015-09-07 15:58:27 -0700663_--Andrew Cencini_ (andrew@vapor.io)
Laurent Debackerbc5a2312015-09-10 13:26:23 +0200664
665## Scaleway C1 Server
666
667Architecture: armv7l
668
669Operating System: Debian 8.2 (armhf)
670
671Go Version: 1.5
672
673The Scaleway C1 Server is a dedicated ARM server with 2GiB RAM using a SAN for storage.
674
675I used the following guide: [Building Go 1.5 on the Raspberry Pi](http://dave.cheney.net/2015/09/04/building-go-1-5-on-the-raspberry-pi)
Laurent Debacker71908792015-09-10 13:27:13 +0200676
677_--Laurent Debacker