このあたり ã§ãã³ããã¼ã¯ã®çµæã python ã«è² ãã¦ãã®ããã£ã¦ãã£ãããã¿ãããªè©±é¡ã«å¯¾ãã¦ãid:tokuhirom ãããããã¼ããã¿ãªã®ãããããã½ã¼ã¹ãããèªãã§å¤æãããã¨ãã話ãhttp://d.hatena.ne.jp/tokuhirom/20091124/1259029688
æ¢ãã¦ã¿ãããmisc/cgo/gmp/ å ã« GMP ã® wrapper ãå ¥ã£ã¦ã¾ãã
An example of wrapping a C library in Go.
ã¨ã¯æ¸ãã¦ãããã©ãããã¤ããåãã« pi.go ã¨ããåå¨çãæ±ãããµã³ãã«ã³ã¼ããå ¥ã£ã¦ããã®ã§ãããã使ã£ã¦ pidigits Go 6g 8g program ãæ¸ãç´ãã¦ã¿ãã
ã½ã¼ã¹ã³ã¼ãã¯ãã¡ããhttp://gist.github.com/241663
æå ã®ç°å¢ (Ubuntu-9.10 AMD64, AthlonX2 5400+) ã§ã®å®è¡çµæãæ¯è¼ç¨ã« C ã®å®è¡çµæããpidigits C GNU gcc #4 program
n=2000 Go(bignum) 2.141s Go(gmp) 0.172s C 0.110s n=6000 Go(bignum) 20.348s Go(gmp) 0.839s C 0.663s n=10000 Go(bignum) 64.630s Go(gmp) 2.472s C 2.160s
ãããªæã㧠GMP ã使ãã°ãC ããã¡ãã£ã¨é ããããã®é度ã«ãªãã¾ãããã