RFR: 8314512: IGV: clean up hierarchical layout code
Tobias Holenstein
tholenstein at openjdk.org
Wed Nov 27 22:06:39 UTC 2024
On Wed, 27 Nov 2024 11:05:07 GMT, Roberto Castañeda Lozano <rcastanedalo at openjdk.org> wrote:
> Perhaps
I think I removed the performance bottlenecks. (it was not the layouting).
- I set setToolTipText(“<HTML>” + generateToolTipText(this.connections) + “</HTML>“); only when needed for `LineWidget`
- I add all created `LineWidgets` as a batch with `connectionLayer.addChildren(newWidgets);`
- This left me with a last bottleneck where 90% of runtime for a large graph was spend in `connectionLayer.addChildren` -> `Widget.addChild` -> `Widget.setConstraint`:
public final void setChildConstraint(Widget child, Object constraint) {
assert this.children.contains(child); // we spend 90% of runtime on this assert
if (constraint == null) {
if (this.constraints != null) {
this.constraints.remove(child);
}
} else {
if (this.constraints == null) {
this.constraints = new HashMap();
}
this.constraints.put(child, constraint);
}
}
We end up spending almost all runtime for large graphs on this assert that is part of the Netbeans library code. It has never failed. So the best thing is to run Java with asserts disabled, except for when we debug: this can be done be running `mvn` with -Dnetbeans.run.params="-J-da"
I have modified the igv.sh with this command.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/22402#issuecomment-2504874316
More information about the hotspot-compiler-dev
mailing list