Skip to content

Commit

Permalink
reindent. made profile.go build again
Browse files Browse the repository at this point in the history
  • Loading branch information
zond committed Feb 8, 2013
1 parent aceb1b7 commit 3eb9d47
Showing 1 changed file with 27 additions and 27 deletions.
54 changes: 27 additions & 27 deletions radix/profile/profile.go
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
package main

import (
"bytes"
"fmt"
. "github.com/zond/god/"
"github.com/zond/god/../murmur"
"os"
"runtime/pprof"
"bytes"
"fmt"
"github.com/zond/god/murmur"
"github.com/zond/god/radix"
"os"
"runtime/pprof"
)

func main() {
f, err := os.Create("cpuprofile")
if err != nil {
panic(err.Error())
}
f2, err := os.Create("memprofile")
if err != nil {
panic(err.Error())
}
f, err := os.Create("cpuprofile")
if err != nil {
panic(err.Error())
}
f2, err := os.Create("memprofile")
if err != nil {
panic(err.Error())
}

pprof.StartCPUProfile(f)
defer pprof.StopCPUProfile()
defer pprof.WriteHeapProfile(f2)
pprof.StartCPUProfile(f)
defer pprof.StopCPUProfile()
defer pprof.WriteHeapProfile(f2)

m := NewTree()
var k []byte
for i := 0; i < 100000; i++ {
k = murmur.HashString(fmt.Sprint(i))
m.Put(k, k, 1)
x, _, _ := m.Get(k)
if bytes.Compare(x, k) != 0 {
panic("humbug")
}
}
m := radix.NewTree()
var k []byte
for i := 0; i < 100000; i++ {
k = murmur.HashString(fmt.Sprint(i))
m.Put(k, k, 1)
x, _, _ := m.Get(k)
if bytes.Compare(x, k) != 0 {
panic("humbug")
}
}
}

0 comments on commit 3eb9d47

Please sign in to comment.