Mercurial > hg4j
diff src/org/tmatesoft/hg/internal/Pool.java @ 264:6bb5e7ed051a
Optimize memory usage (reduce number of objects instantiated) when pooling file names and nodeids during manifest parsing
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Fri, 19 Aug 2011 03:36:25 +0200 |
parents | 3dcd3dd90c77 |
children | 12f668401613 |
line wrap: on
line diff
--- a/src/org/tmatesoft/hg/internal/Pool.java Thu Aug 18 18:06:44 2011 +0200 +++ b/src/org/tmatesoft/hg/internal/Pool.java Fri Aug 19 03:36:25 2011 +0200 @@ -18,8 +18,6 @@ import java.util.HashMap; -import org.tmatesoft.hg.util.SparseSet; - /** * Instance pooling. * @@ -28,7 +26,6 @@ */ public class Pool<T> { private final HashMap<T,T> unify; -// private final SparseSet<T> unify = new SparseSet<T>(); public Pool() { unify = new HashMap<T, T>(); @@ -73,9 +70,9 @@ StringBuilder sb = new StringBuilder(); sb.append(Pool.class.getSimpleName()); sb.append('<'); -// if (!unify.isEmpty()) { -// sb.append(unify.keySet().iterator().next().getClass().getName()); -// } + if (!unify.isEmpty()) { + sb.append(unify.keySet().iterator().next().getClass().getName()); + } sb.append('>'); sb.append(':'); sb.append(unify.size());