<p dir="auto">by <strong><a href="mailto:daniel@heroku.com">daniel@heroku.com</a></strong>:</p>
<pre class="notranslate">Although it's already possible to link C code into a Go program (that controls the entry
point), it would be highly useful to me to have the opposite (running a Go runtime in a
C program).

I'm mostly interested in exposing exported Go symbols and bindings to Python (and Ruby,
Java, and similar), and PostgreSQL.  In the latter case, the sandboxed variant of Go
provides a more unique advantage as it can be run as a "trusted" language.</pre>
<pre class="notranslate">Interface equality check is expensive compared to integer comparison check.

In the benchmark, I compare two integers. I then wrap them in interface{} and compare
them.

As interface{}, the comparison check takes over 20X the time taken by just plain
comparison check.

See <a href="http://play.golang.org/p/1evwkTYYlB" rel="nofollow">http://play.golang.org/p/1evwkTYYlB</a>

Results:
BenchmarkIntfEqual  100000000            14.5 ns/op
BenchmarkReflectTypeEqual   100000000    14.4 ns/op
BenchmarkPtrEqual   2000000000           1.06 ns/op
BenchmarkIntEqual   2000000000           0.70 ns/op
BenchmarkIntMapAccess   500000000            5.22 ns/op
BenchmarkReflectTypeMapAccess   50000000     57.6 ns/op
BenchmarkIntMapAccessMiss   100000000           16.4 ns/op
BenchmarkReflectTypeMapAccessMiss   50000000    58.3 ns/op

Which compiler are you using (5g, 6g, 8g, gccgo)?
6g

Which operating system are you using?
Linux 3.8.0-27-generic #40-Ubuntu SMP Tue Jul 9 00:17:05 UTC 2013 x86_64 x86_64 x86_64
GNU/Linux

Which version are you using?  (run 'go version')
go version devel +21ae2c5817da Fri Aug 09 23:23:34 2013 +1000 linux/amd64


Please provide any additional information below.</pre>