jbrukh / ggit

ggit
17 stars 2 forks source link

Performance comparisons between ggit, git, jgit, grit. #17

Open jbrukh opened 11 years ago

MikeBosw commented 11 years ago

I think the fixed cost of starting a Go program might be slightly greater than that of starting Git - at least on my setup. Here's the shortest non-Hello-World Go program I've written:

package main

import (
    "time"
    "os"
    "fmt"
)

func main() {
    fmt.Fprintln(os.Stdout, time.Now().UnixNano())
}

On my Mac, the above takes slightly longer than "git cat-file -p 5b27f03a" (where 5b27f03a is the packed delta of a blob), and 1.3 to 1.4x as long as "git --version". (Anecdotally: I've been running a 1,200-iteration loop over and over again for each command.)

Same goes for Go Hello World.

jbrukh commented 11 years ago

No Internet to send you latest benches, but reading packed objects is on the order of 8000 ns. Compared with something like 60000 to read loose objects.

Go programs have a runtime built into the executable so not surprising that it is slower than pure C. Nonetheless, the figures that you gave are pretty damn good compared with Java.

On Oct 31, 2012, at 11:23 PM, MikeBosw notifications@github.com wrote:

I think the fixed cost of starting a Go program might be slightly greater than that of starting Git - at least on my setup. Here's the shortest non-Hello-World Go program I've written:

package main import ( "time" "os" "fmt") func main() { fmt.Fprintln(os.Stdout, time.Now().UnixNano())}

On my Mac, the above takes slightly longer than "git cat-file -p 5b27f03https://github.com/jbrukh/ggit/commit/5b27f03a" (where 5b27f03 https://github.com/jbrukh/ggit/commit/5b27f03a is the packed delta of a blob), and 1.3 to 1.4x as long as "git --version". (Anecdotally: I've been running a 1,200-iteration loop over and over again for each command.)

Same goes for Go Hello World.

— Reply to this email directly or view it on GitHubhttps://github.com/jbrukh/ggit/issues/17#issuecomment-9969896.