This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I have really come to enjoy working in Go. From time to time I expect that the team at Apcera will | |
need to dip back into C for some things, but I decided to try to push the envelope with Go on making | |
some faster HashMaps than Go's builtin map. I started with the hash algorithms. | |
These are some results from my MBA11" core i7.. The fastest Hash algorithms will not work on machines | |
without support for unaligned access, and I still need to do some cleaning up before we OSS, but so far so good. | |
I aslo need to implement the fastest one, FNV1A_Hash_Yorikke, from http://http://www.sanmayce.com/Fastest_Hash | |
I hack SetBytes(1) to get a rough idea of ops/sec, its not actually IO.. So 10 MB/s is 10 Million ops per sec. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Latency Comparison Numbers (~2012) | |
---------------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns 3 us | |
Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void doSnapshot(String url, String username, String password, String vmname, String snapshotname) throws Exception | |
{ | |
ServiceInstance si = new ServiceInstance(new URL(url), username, password, true); | |
Folder rootFolder = si.getRootFolder(); | |
VirtualMachine vm = null; | |
vm = (VirtualMachine) new InventoryNavigator(rootFolder).searchManagedEntity("VirtualMachine", vmname); | |
if(vm==null) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
include $(GOROOT)/src/Make.inc | |
GOFMT=gofmt -spaces=true -tabindent=false -tabwidth=4 | |
all: | |
$(GC) jsontest.go | |
$(LD) -o jsontest.out jsontest.$O | |
format: | |
$(GOFMT) -w jsontest.go |