Commit 212860e2 authored by Noric Couderc's avatar Noric Couderc
Browse files

Fix: Intern repetitive strings

There are a lot of strings which are actually the same string, except
the JVM stores the same data in two different objects. I used intern()
to try to make sure it's the same objects that is used if we've already
seen that string before.
parent 90a0ca31
......@@ -283,7 +283,7 @@ public class BCBenchmarkPackage<T> implements Serializable {
/**
* A function returning a unique indentifier for the generated benchmark
* A function returning a unique identifier for the generated benchmark
* which is the identifier for the plan, with additional information about the
* collection that was used.
* @return An benchmark unique ID.
......@@ -293,7 +293,7 @@ public class BCBenchmarkPackage<T> implements Serializable {
getPlanIdentifier(),
this.datastructure_size,
this.getDataStructureSimpleName()
);
).intern();
}
public String getDataStructureSimpleName() { return this.datastructure.getClass().getSimpleName(); }
......
......@@ -104,7 +104,9 @@ class JMHProcessor {
null
}
JMHRecord(seed, size, baseStructureSize,
interfaceName, it.get("Param: datastructureName"), best!!,
interfaceName.intern(),
it.get("Param: datastructureName").intern(),
best!!.intern(),
methodSelection)
}
}
......
......@@ -52,11 +52,11 @@ open class PapiTracerRunner() : PapiRunner() {
return cleanedLines.map { line ->
val splitted = line.split("\t")
TraceRecord(splitted[0],
splitted[1],
TraceRecord(splitted[0].intern(),
splitted[1].intern(),
Integer.parseInt(splitted[2]),
splitted[3],
splitted[4]
splitted[3].intern(),
splitted[4].intern()
)
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment