leverage the cached pdbwriters
this increased performance from 500 entries per second to 4000.
This commit is contained in:
@@ -16,6 +16,8 @@ public class Tags {
|
||||
|
||||
private final Map<String, Tag> tags;
|
||||
|
||||
private int cachedHash = 0;
|
||||
|
||||
private Tags() {
|
||||
super();
|
||||
tags = Collections.emptyMap();
|
||||
@@ -87,10 +89,17 @@ public class Tags {
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + ((tags == null) ? 0 : tags.hashCode());
|
||||
return result;
|
||||
|
||||
if (cachedHash != 0) {
|
||||
return cachedHash;
|
||||
} else {
|
||||
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + ((tags == null) ? 0 : tags.hashCode());
|
||||
cachedHash = result;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user