]> gerrit.simantics Code Review - simantics/platform.git/commit
Include cached hash code in TransferableGraph1 extensions map 43/1543/2
authorTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Fri, 9 Mar 2018 11:20:47 +0000 (13:20 +0200)
committerTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Fri, 9 Mar 2018 11:22:12 +0000 (13:22 +0200)
commitaab6399f20c07b61a0dbf9614614f44a2e0ea325
tree59a81c262daafa963a459f716c826b6ed10c40ac
parentfb019f116468d003a751e4274a69ba01c34fa10b
Include cached hash code in TransferableGraph1 extensions map

The cached hashcode is calculated before inserting the cached hash value
in the TransferableGraph1.extensions TreeMap. Reading and inspection
must be done with this in mind.

This cached value is used to optimize platform startup by removing the
need to calculate the TransferableGraph1 structure hashcode at runtime
which can be quite expensive because the standard databoard Bindings are
slow compared to optimal methods. Of course an optimized binding could
be used to speed the calculation up dramatically but it still can't beat
caching the final (immutable) hashCode value.

refs #7806

Change-Id: I9d4fc6549cba567f95b19f80bd15c1ccfbbedf07
bundles/org.simantics.graph.compiler/src/org/simantics/graph/compiler/GraphCompiler.java
bundles/org.simantics.graph/src/org/simantics/graph/representation/Extensions.java