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 { ...@@ -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 * which is the identifier for the plan, with additional information about the
* collection that was used. * collection that was used.
* @return An benchmark unique ID. * @return An benchmark unique ID.
...@@ -293,7 +293,7 @@ public class BCBenchmarkPackage<T> implements Serializable { ...@@ -293,7 +293,7 @@ public class BCBenchmarkPackage<T> implements Serializable {
getPlanIdentifier(), getPlanIdentifier(),
this.datastructure_size, this.datastructure_size,
this.getDataStructureSimpleName() this.getDataStructureSimpleName()
); ).intern();
} }
public String getDataStructureSimpleName() { return this.datastructure.getClass().getSimpleName(); } public String getDataStructureSimpleName() { return this.datastructure.getClass().getSimpleName(); }
......
...@@ -104,7 +104,9 @@ class JMHProcessor { ...@@ -104,7 +104,9 @@ class JMHProcessor {
null null
} }
JMHRecord(seed, size, baseStructureSize, JMHRecord(seed, size, baseStructureSize,
interfaceName, it.get("Param: datastructureName"), best!!, interfaceName.intern(),
it.get("Param: datastructureName").intern(),
best!!.intern(),
methodSelection) methodSelection)
} }
} }
......
...@@ -52,11 +52,11 @@ open class PapiTracerRunner() : PapiRunner() { ...@@ -52,11 +52,11 @@ open class PapiTracerRunner() : PapiRunner() {
return cleanedLines.map { line -> return cleanedLines.map { line ->
val splitted = line.split("\t") val splitted = line.split("\t")
TraceRecord(splitted[0], TraceRecord(splitted[0].intern(),
splitted[1], splitted[1].intern(),
Integer.parseInt(splitted[2]), Integer.parseInt(splitted[2]),
splitted[3], splitted[3].intern(),
splitted[4] splitted[4].intern()
) )
} }
} }
......
Supports Markdown
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