Skip to content

Commit

Permalink
Identified performance issue as GitRepo:getTags() #13
Browse files Browse the repository at this point in the history
 * Updating performance test to reveal it.
  • Loading branch information
tomasbjerre committed Feb 11, 2016
1 parent 0e062d7 commit be9fb93
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 17 deletions.
12 changes: 11 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,22 @@ Changelog of Git Changelog.
## Next release
### GitHub [#13](https://github.com/tomasbjerre/git-changelog-lib/issues/13) GitRepo getDiff performance

**Identified performance issue as GitRepo:getTags()**

* Updating performance test to reveal it.

[e27a4791fb52f33](https://github.com/tomasbjerre/git-changelog-lib/commit/e27a4791fb52f33) Tomas Bjerre *2016-02-11 17:47:00*


## 1.25
### GitHub [#13](https://github.com/tomasbjerre/git-changelog-lib/issues/13) GitRepo getDiff performance

**Letting JGit determine new commits between refs**

* Also changing changelog template.
* Also trimming messageTitle variable.

[946c500d639a41d](https://github.com/tomasbjerre/git-changelog-lib/commit/946c500d639a41d) Tomas Bjerre *2016-02-10 17:27:01*
[5b307bd00b47e83](https://github.com/tomasbjerre/git-changelog-lib/commit/5b307bd00b47e83) Tomas Bjerre *2016-02-10 17:31:13*


## 1.24
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ It is fully configurable with a [Mustache](http://mustache.github.io/) template.

It can integrate with Jira and/or GitHub to retrieve the title of issues.

The [changelog](https://github.com/tomasbjerre/git-changelog-lib/blob/master/CHANGELOG.md) of this project is automatically generated with [this template](https://github.com/tomasbjerre/git-changelog-lib/blob/master/changelog.mustache).

There are some screenshots [here](https://github.com/tomasbjerre/git-changelog-lib/tree/screenshots/sandbox).

## Usage
Expand Down
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
package se.bjurr.gitchangelog.internal.git;
package se.bjurr.gitchangelog.test;

import static com.google.common.base.Stopwatch.createStarted;
import static java.util.concurrent.TimeUnit.SECONDS;
import static se.bjurr.gitchangelog.api.GitChangelogApi.gitChangelogApiBuilder;

import java.io.File;
import java.util.List;
import java.util.logging.Logger;

import org.eclipse.jgit.lib.ObjectId;
import org.junit.After;
import org.junit.Before;
import org.junit.BeforeClass;

import se.bjurr.gitchangelog.api.GitChangelogApi;
import se.bjurr.gitchangelog.internal.git.GitRepo;
import se.bjurr.gitchangelog.internal.git.model.GitTag;

import com.google.common.base.Stopwatch;

public class GitRepoPerformanceTest {
public class LibPerformanceTest {
private static final String GIT_REPO_DIR = "/home/bjerre/workspace/spring-framework";
private Stopwatch stopwatch;
private static final Logger LOG = Logger.getLogger(GitRepoPerformanceTest.class.getSimpleName());
private GitChangelogApi gitChangelogApiBuilder;
private GitRepo gitRepo;

@BeforeClass
public static void beforeClass() {
}
private static final Logger LOG = Logger.getLogger(LibPerformanceTest.class.getSimpleName());

@Before
public void before() {
File gitRepoFile = new File("/home/bjerre/workspace/spring-framework");
gitRepo = new GitRepo(gitRepoFile);
LOG.info("Using repo:\n" + gitRepo);
this.stopwatch = Stopwatch.createStarted();
gitChangelogApiBuilder = gitChangelogApiBuilder()//
.withFromRepo(GIT_REPO_DIR);
gitRepo = new GitRepo(new File(GIT_REPO_DIR));
this.stopwatch = createStarted();
}

@After
Expand All @@ -50,11 +50,12 @@ public void testThatGimmitsBetweenTagsCanBeFound() {
if (from.getName().equals(to.getName())) {
continue;
}
ObjectId fromCommit = gitRepo.getRef(from.getName());
ObjectId toCommit = gitRepo.getRef(to.getName());
String str = from.getName() + " -> " + to.getName();
LOG.info(str);
gitRepo.getDiff(fromCommit, toCommit);
gitChangelogApiBuilder//
.withFromRef(from.getName())//
.withToRef(to.getName())//
.render();
}
}
}
Expand Down

0 comments on commit be9fb93

Please sign in to comment.