RFR: 8330584: IGV: XML does not save all node properties [v2]

Tobias Holenstein tholenstein at openjdk.org
Wed May 8 12:10:23 UTC 2024


> When C2 sends graphs over the network to IGV, each graph is sent separately. The same applies if C2 saves graphs to XML: each graph is saved with all it's nodes as a separate `<graph>...</graph>` in the XML
> 
> To save space, graphs that are saved from IGV only contains the incremental difference for each graph. This saves a lot of space (~5-10x). The logic happens in Printer.java -> `exportInputGraph(.., difference=true, ...)` Unfortunately, there is a bug in this logic: the properties of the nodes are not saved correctly. 
> 
> [graphs.zip](https://github.com/openjdk/jdk/files/15220940/graphs.zip) contains 4 graphs: 
> 
> `graph_c2.xml` (230KB) - a XML saved from C2 
> `graph_igv_bug.xml` (73KB) - opened `graph_c2.xml` in IGV (without this fix) and save as `graph_igv_bug.xml`.
> `graph_igv_fixed.xml` (123KB) - opened `graph_c2.xml` in IGV (with this fix) and save as `graph_igv_fixed.xml `.
> 
> As you can see `graph_igv_fixed.xml` is twice as large as `graph_igv_bug.xml` because it contains the missing properties. But now the memory saving from the original `graph_c2.xml` is only ~2x. 
> Therefore a new format for saving is added: graphs can now be saved and opened from IGV as `.igv`. This uses a compressed (ZIP) format. 
> 
> `graph.igv` (10KB) is the same graph as `graph_c2.xml` (230KB). But it uses difference graph compression and ZIP compression and is in total 23x smaller in memory footprint. 
> 
> 
> 
> E.g. The root in the last graph of difference_true.xml has way less properties than in difference_false.xml.

Tobias Holenstein has updated the pull request incrementally with one additional commit since the last revision:

  Update src/utils/IdealGraphVisualizer/Coordinator/src/main/java/com/sun/hotspot/igv/coordinator/OutlineTopComponent.java
  
  Co-authored-by: Roberto Castañeda Lozano <robcasloz at users.noreply.github.com>

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/19104/files
  - new: https://git.openjdk.org/jdk/pull/19104/files/eabd53cd..632b4baa

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=19104&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=19104&range=00-01

  Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/19104.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/19104/head:pull/19104

PR: https://git.openjdk.org/jdk/pull/19104


More information about the hotspot-compiler-dev mailing list