git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Shawn Pearce <spearce@spearce.org>
To: git@vger.kernel.org
Subject: jgit performance update
Date: Sat, 2 Dec 2006 23:59:53 -0500	[thread overview]
Message-ID: <20061203045953.GE26668@spearce.org> (raw)

With the help of Robin Rosenberg I've been able to make jgit's log
operation run (on average) within a few milliseconds of core Git.

Walking the 50,000 most recent commits from the Mozilla trunk[1]:

  $ time git rev-list --max-count=50000 HEAD >/dev/null

  core Git:  1.882s (average)
  jgit:      1.932s (average)

  (times are with hot cache and from repeated executions)

I think that is actually pretty good given that jgit is written
in Java using a fairly object-oriented design and has to deal with
some of the limitations of the language.

One of the biggest annoyances has been the fact that although Java
1.4 offers a way to mmap a file into the process, the overhead to
access that data seems to be far higher than just reading the file
content into a very large byte array, especially if we are going
to access that file content multiple times.  So jgit performs worse
than core Git early on while it copies everything from the OS buffer
cache into the Java process, but then performs reasonably well once
the internal cache is hot.  On the other hand using the mmap call
reduces early latency but hurts the access times so much that we're
talking closer to 3s average read times for the same log operation.

Anyway, jgit is now hopefully fast enough that we can start to build
some real functionality on top of it, and not need to wait several
minutes for answers from those features while debugging them.  :)


**1** This is the pack file from Jon Smirl's import attempt.

-- 

             reply	other threads:[~2006-12-03  5:00 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-03  4:59 Shawn Pearce [this message]
2006-12-03 13:55 ` jgit performance update Robin Rosenberg
2006-12-03 14:19   ` Jakub Narebski
2006-12-03 15:53     ` Robin Rosenberg
2006-12-03 23:06       ` Shawn Pearce
2006-12-03 22:59   ` Shawn Pearce
2006-12-03 17:45 ` Linus Torvalds
2006-12-03 17:56   ` Jakub Narebski
2006-12-03 22:42     ` Juergen Stuber
2006-12-03 23:39       ` Robin Rosenberg
2006-12-03 23:58         ` Jakub Narebski
2006-12-04  0:46           ` Shawn Pearce
2006-12-04 20:35         ` Juergen Stuber
2006-12-03 22:47   ` Shawn Pearce
2006-12-03 21:55 ` sf
2006-12-03 22:16   ` Shawn Pearce

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20061203045953.GE26668@spearce.org \
    --to=spearce@spearce.org \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).