diff --git a/CoreDependencies/nbproject/project.xml b/CoreDependencies/nbproject/project.xml index 947118ea6c..7d509a57b6 100644 --- a/CoreDependencies/nbproject/project.xml +++ b/CoreDependencies/nbproject/project.xml @@ -37,7 +37,6 @@ Lib.xml.sax Lib.xml.sax.drivers2 au.com.objectix.jgridshift - au.com.objectix.jgridshift.jca com.ctc.wstx.api com.ctc.wstx.cfg com.ctc.wstx.compat @@ -89,6 +88,8 @@ com.fasterxml.jackson.databind.ser.std com.fasterxml.jackson.databind.type com.fasterxml.jackson.databind.util + com.github.benmanes.caffeine.cache + com.github.benmanes.caffeine.cache.stats com.github.rjeschke.txtmark com.github.rjeschke.txtmark.cmd com.google.common.annotations @@ -209,31 +210,14 @@ com.microsoft.schemas.office.visio.x2012.main.impl com.microsoft.schemas.office.x2006.digsig com.microsoft.schemas.office.x2006.digsig.impl - com.microsoft.schemas.office.x2006.encryption - com.microsoft.schemas.office.x2006.encryption.impl - com.microsoft.schemas.office.x2006.keyEncryptor.certificate - com.microsoft.schemas.office.x2006.keyEncryptor.certificate.impl - com.microsoft.schemas.office.x2006.keyEncryptor.password - com.microsoft.schemas.office.x2006.keyEncryptor.password.impl com.microsoft.schemas.vml com.microsoft.schemas.vml.impl - com.sun.activation.registries - com.sun.activation.viewers com.sun.glass.ui.monocle com.sun.istack com.sun.istack.localization com.sun.istack.logging com.sun.java.help.impl com.sun.java.help.search - com.sun.mail.auth - com.sun.mail.handlers - com.sun.mail.iap - com.sun.mail.imap - com.sun.mail.imap.protocol - com.sun.mail.pop3 - com.sun.mail.smtp - com.sun.mail.util - com.sun.mail.util.logging com.sun.media.imageio.plugins.bmp com.sun.media.imageio.plugins.jpeg2000 com.sun.media.imageio.plugins.pnm @@ -411,7 +395,6 @@ impl.org.controlsfx.tools impl.org.controlsfx.tools.rectangle impl.org.controlsfx.tools.rectangle.change - impl.org.controlsfx.version impl.org.controlsfx.worldmap it.geosolutions.imageio.core it.geosolutions.imageio.imageioimpl @@ -488,54 +471,6 @@ javax.annotation.meta javax.annotation.security javax.annotation.sql - javax.batch.api - javax.batch.api.chunk - javax.batch.api.chunk.listener - javax.batch.api.listener - javax.batch.api.partition - javax.batch.operations - javax.batch.runtime - javax.batch.runtime.context - javax.decorator - javax.ejb - javax.ejb.embeddable - javax.ejb.spi - javax.el - javax.enterprise.concurrent - javax.enterprise.context - javax.enterprise.context.spi - javax.enterprise.deploy.model - javax.enterprise.deploy.model.exceptions - javax.enterprise.deploy.shared - javax.enterprise.deploy.shared.factories - javax.enterprise.deploy.spi - javax.enterprise.deploy.spi.exceptions - javax.enterprise.deploy.spi.factories - javax.enterprise.deploy.spi.status - javax.enterprise.event - javax.enterprise.inject - javax.enterprise.inject.spi - javax.enterprise.util - javax.faces - javax.faces.application - javax.faces.bean - javax.faces.component - javax.faces.component.behavior - javax.faces.component.html - javax.faces.component.visit - javax.faces.context - javax.faces.convert - javax.faces.el - javax.faces.event - javax.faces.flow - javax.faces.flow.builder - javax.faces.lifecycle - javax.faces.model - javax.faces.render - javax.faces.validator - javax.faces.view - javax.faces.view.facelets - javax.faces.webapp javax.help javax.help.event javax.help.plaf @@ -545,67 +480,10 @@ javax.help.search javax.help.tagext javax.inject - javax.interceptor - javax.jms - javax.json - javax.json.spi - javax.json.stream - javax.jws - javax.jws.soap - javax.mail - javax.mail.event - javax.mail.internet - javax.mail.search - javax.mail.util - javax.management.j2ee - javax.management.j2ee.statistics javax.measure javax.measure.format javax.measure.quantity javax.measure.spi - javax.persistence - javax.persistence.criteria - javax.persistence.metamodel - javax.persistence.spi - javax.resource - javax.resource.cci - javax.resource.spi - javax.resource.spi.endpoint - javax.resource.spi.security - javax.resource.spi.work - javax.security.auth.message - javax.security.auth.message.callback - javax.security.auth.message.config - javax.security.auth.message.module - javax.security.jacc - javax.servlet - javax.servlet.annotation - javax.servlet.descriptor - javax.servlet.http - javax.servlet.jsp - javax.servlet.jsp.el - javax.servlet.jsp.jstl.core - javax.servlet.jsp.jstl.fmt - javax.servlet.jsp.jstl.sql - javax.servlet.jsp.jstl.tlv - javax.servlet.jsp.tagext - javax.transaction - javax.transaction.xa - javax.validation - javax.validation.bootstrap - javax.validation.constraints - javax.validation.constraintvalidation - javax.validation.executable - javax.validation.groups - javax.validation.metadata - javax.validation.spi - javax.websocket - javax.websocket.server - javax.ws.rs - javax.ws.rs.client - javax.ws.rs.container - javax.ws.rs.core - javax.ws.rs.ext javax.xml javax.xml.bind javax.xml.bind.annotation @@ -616,16 +494,6 @@ javax.xml.datatype javax.xml.namespace javax.xml.parsers - javax.xml.registry - javax.xml.registry.infomodel - javax.xml.rpc - javax.xml.rpc.encoding - javax.xml.rpc.handler - javax.xml.rpc.handler.soap - javax.xml.rpc.holders - javax.xml.rpc.server - javax.xml.rpc.soap - javax.xml.soap javax.xml.stream javax.xml.stream.events javax.xml.stream.util @@ -635,14 +503,6 @@ javax.xml.transform.stax javax.xml.transform.stream javax.xml.validation - javax.xml.ws - javax.xml.ws.handler - javax.xml.ws.handler.soap - javax.xml.ws.http - javax.xml.ws.soap - javax.xml.ws.spi - javax.xml.ws.spi.http - javax.xml.ws.wsaddressing javax.xml.xpath jj2000.j2k jj2000.j2k.codestream @@ -1020,18 +880,6 @@ org.apache.commons.codec.language org.apache.commons.codec.language.bm org.apache.commons.codec.net - org.apache.commons.collections - org.apache.commons.collections.bag - org.apache.commons.collections.bidimap - org.apache.commons.collections.buffer - org.apache.commons.collections.collection - org.apache.commons.collections.comparators - org.apache.commons.collections.functors - org.apache.commons.collections.iterators - org.apache.commons.collections.keyvalue - org.apache.commons.collections.list - org.apache.commons.collections.map - org.apache.commons.collections.set org.apache.commons.collections4 org.apache.commons.collections4.bag org.apache.commons.collections4.bidimap @@ -1359,7 +1207,6 @@ org.apache.poi.schemas.vmldrawing org.apache.poi.schemas.vmldrawing.impl org.apache.poi.sl.draw - org.apache.poi.sl.draw.binding org.apache.poi.sl.draw.geom org.apache.poi.sl.extractor org.apache.poi.sl.image @@ -1377,7 +1224,6 @@ org.apache.poi.ss.formula.ptg org.apache.poi.ss.formula.udf org.apache.poi.ss.usermodel - org.apache.poi.ss.usermodel.charts org.apache.poi.ss.usermodel.helpers org.apache.poi.ss.util org.apache.poi.ss.util.cellwalk @@ -1408,7 +1254,6 @@ org.apache.poi.xssf.model org.apache.poi.xssf.streaming org.apache.poi.xssf.usermodel - org.apache.poi.xssf.usermodel.charts org.apache.poi.xssf.usermodel.extensions org.apache.poi.xssf.usermodel.helpers org.apache.poi.xssf.util @@ -1507,18 +1352,6 @@ org.apache.xmlbeans.impl.config org.apache.xmlbeans.impl.inst2xsd org.apache.xmlbeans.impl.inst2xsd.util - org.apache.xmlbeans.impl.jam - org.apache.xmlbeans.impl.jam.annotation - org.apache.xmlbeans.impl.jam.internal - org.apache.xmlbeans.impl.jam.internal.classrefs - org.apache.xmlbeans.impl.jam.internal.elements - org.apache.xmlbeans.impl.jam.internal.javadoc - org.apache.xmlbeans.impl.jam.internal.parser - org.apache.xmlbeans.impl.jam.internal.reflect - org.apache.xmlbeans.impl.jam.mutable - org.apache.xmlbeans.impl.jam.provider - org.apache.xmlbeans.impl.jam.visitor - org.apache.xmlbeans.impl.jam.xml org.apache.xmlbeans.impl.regex org.apache.xmlbeans.impl.repackage org.apache.xmlbeans.impl.richParser @@ -1545,7 +1378,6 @@ org.apache.xmlbeans.impl.xpath.saxon org.apache.xmlbeans.impl.xpath.xmlbeans org.apache.xmlbeans.impl.xpathgen - org.apache.xmlbeans.impl.xquery.saxon org.apache.xmlbeans.impl.xsd2inst org.apache.xmlbeans.metadata.system.sXMLCONFIG org.apache.xmlbeans.metadata.system.sXMLLANG @@ -1554,7 +1386,6 @@ org.apache.xmlbeans.soap org.apache.xmlbeans.xml.stream org.apache.xmlbeans.xml.stream.events - org.apache.xmlbeans.xml.stream.utils org.apache.xmlcommons org.apache.xmlgraphics.fonts org.apache.xmlgraphics.image @@ -1869,27 +1700,21 @@ org.checkerframework.checker.calledmethods.qual org.checkerframework.checker.compilermsgs.qual org.checkerframework.checker.fenum.qual - org.checkerframework.checker.formatter org.checkerframework.checker.formatter.qual org.checkerframework.checker.guieffect.qual org.checkerframework.checker.i18n.qual - org.checkerframework.checker.i18nformatter org.checkerframework.checker.i18nformatter.qual org.checkerframework.checker.index.qual org.checkerframework.checker.initialization.qual org.checkerframework.checker.interning.qual org.checkerframework.checker.lock.qual - org.checkerframework.checker.nullness org.checkerframework.checker.nullness.qual org.checkerframework.checker.optional.qual org.checkerframework.checker.propkey.qual - org.checkerframework.checker.regex org.checkerframework.checker.regex.qual org.checkerframework.checker.signature.qual - org.checkerframework.checker.signedness org.checkerframework.checker.signedness.qual org.checkerframework.checker.tainting.qual - org.checkerframework.checker.units org.checkerframework.checker.units.qual org.checkerframework.common.aliasing.qual org.checkerframework.common.initializedfields.qual @@ -1900,7 +1725,6 @@ org.checkerframework.common.value.qual org.checkerframework.dataflow.qual org.checkerframework.framework.qual - org.checkerframework.framework.util org.codehaus.jackson org.codehaus.jackson.annotate org.codehaus.jackson.impl @@ -1976,14 +1800,12 @@ org.eclipse.jetty.server.handler.gzip org.eclipse.jetty.server.handler.jmx org.eclipse.jetty.server.jmx - org.eclipse.jetty.server.nio org.eclipse.jetty.server.resource org.eclipse.jetty.server.session org.eclipse.jetty.servlet org.eclipse.jetty.servlet.jmx org.eclipse.jetty.servlet.listener org.eclipse.jetty.util - org.eclipse.jetty.util.ajax org.eclipse.jetty.util.annotation org.eclipse.jetty.util.component org.eclipse.jetty.util.compression @@ -2341,21 +2163,6 @@ org.jdesktop.swingx.tree org.jdesktop.swingx.treetable org.jdesktop.swingx.util - org.jdom2 - org.jdom2.adapters - org.jdom2.filter - org.jdom2.input - org.jdom2.input.sax - org.jdom2.input.stax - org.jdom2.internal - org.jdom2.located - org.jdom2.output - org.jdom2.output.support - org.jdom2.transform - org.jdom2.util - org.jdom2.xpath - org.jdom2.xpath.jaxen - org.jdom2.xpath.util org.json org.json.simple org.json.simple.parser @@ -2452,21 +2259,9 @@ org.locationtech.jts.triangulate.quadedge org.locationtech.jts.util org.mockito - org.mockito.asm - org.mockito.asm.tree - org.mockito.asm.tree.analysis - org.mockito.asm.util - org.mockito.cglib.beans - org.mockito.cglib.core - org.mockito.cglib.proxy - org.mockito.cglib.reflect - org.mockito.cglib.transform - org.mockito.cglib.transform.impl - org.mockito.cglib.util org.mockito.codegen org.mockito.configuration org.mockito.creation.instance - org.mockito.exceptions org.mockito.exceptions.base org.mockito.exceptions.misusing org.mockito.exceptions.stacktrace @@ -2482,7 +2277,6 @@ org.mockito.internal.configuration.plugins org.mockito.internal.creation org.mockito.internal.creation.bytebuddy - org.mockito.internal.creation.cglib org.mockito.internal.creation.instance org.mockito.internal.creation.settings org.mockito.internal.creation.util @@ -2496,7 +2290,6 @@ org.mockito.internal.invocation org.mockito.internal.invocation.finder org.mockito.internal.invocation.mockref - org.mockito.internal.invocation.realmethod org.mockito.internal.junit org.mockito.internal.junit.util org.mockito.internal.listeners @@ -2515,7 +2308,6 @@ org.mockito.internal.util.collections org.mockito.internal.util.concurrent org.mockito.internal.util.io - org.mockito.internal.util.junit org.mockito.internal.util.reflection org.mockito.internal.verification org.mockito.internal.verification.api @@ -2530,7 +2322,6 @@ org.mockito.runners org.mockito.session org.mockito.stubbing - org.mockito.stubbing.answers org.mockito.verification org.objenesis org.objenesis.instantiator @@ -2538,7 +2329,6 @@ org.objenesis.instantiator.annotations org.objenesis.instantiator.basic org.objenesis.instantiator.gcj - org.objenesis.instantiator.jrockit org.objenesis.instantiator.perc org.objenesis.instantiator.sun org.objenesis.instantiator.util @@ -3101,34 +2891,12 @@ processing.event processing.javafx processing.opengl - schemaorg_apache_xmlbeans.system.s8C3F193EE11A2F798ACF65489B9E6078 - schemaorg_apache_xmlbeans.system.sD023D6490046BA0250A839A9AD24C443 - schemaorg_apache_xmlbeans.system.sXMLCONFIG - schemaorg_apache_xmlbeans.system.sXMLLANG - schemaorg_apache_xmlbeans.system.sXMLSCHEMA - schemaorg_apache_xmlbeans.system.sXMLTOOLS si.uom - si.uom.impl - si.uom.impl.quantity si.uom.quantity si.uom.quantity.impl systems.uom.common systems.uom.common.ancient - systems.uom.common.internal systems.uom.common.spi - tec.uom.lib.common - tec.uom.lib.common.function - tec.uom.lib.common.util - tec.uom.se - tec.uom.se.format - tec.uom.se.function - tec.uom.se.internal - tec.uom.se.internal.format - tec.uom.se.internal.format.l10n - tec.uom.se.quantity - tec.uom.se.quantity.time - tec.uom.se.spi - tec.uom.se.unit tech.units.indriya tech.units.indriya.format tech.units.indriya.function @@ -3305,8 +3073,12 @@ release/modules/ext/byte-buddy-agent-1.11.3.jar - ext/checker-qual-3.8.0.jar - release/modules/ext/checker-qual-3.8.0.jar + ext/caffeine-3.0.1.jar + release/modules/ext/caffeine-3.0.1.jar + + + ext/checker-qual-3.11.0.jar + release/modules/ext/checker-qual-3.11.0.jar ext/commons-codec-1.15.jar diff --git a/CoreDependencies/src/ivy.xml b/CoreDependencies/src/ivy.xml index ba6a5e4697..5d2f2df5c1 100644 --- a/CoreDependencies/src/ivy.xml +++ b/CoreDependencies/src/ivy.xml @@ -1,7 +1,7 @@ - + @@ -63,7 +63,7 @@ - + @@ -81,17 +81,18 @@ - + - + - + + diff --git a/CoreOpenGLDisplay/src/au/gov/asd/tac/constellation/visual/opengl/utilities/glyphs/GlyphManagerBI.java b/CoreOpenGLDisplay/src/au/gov/asd/tac/constellation/visual/opengl/utilities/glyphs/GlyphManagerBI.java index c4a11786d6..6759df9070 100644 --- a/CoreOpenGLDisplay/src/au/gov/asd/tac/constellation/visual/opengl/utilities/glyphs/GlyphManagerBI.java +++ b/CoreOpenGLDisplay/src/au/gov/asd/tac/constellation/visual/opengl/utilities/glyphs/GlyphManagerBI.java @@ -15,6 +15,8 @@ */ package au.gov.asd.tac.constellation.visual.opengl.utilities.glyphs; +import com.github.benmanes.caffeine.cache.Caffeine; +import com.github.benmanes.caffeine.cache.LoadingCache; import au.gov.asd.tac.constellation.utilities.datastructure.FourTuple; import au.gov.asd.tac.constellation.utilities.datastructure.ThreeTuple; import java.awt.Color; @@ -40,6 +42,7 @@ import java.util.Map; import java.util.NoSuchElementException; import java.util.Optional; +import java.util.concurrent.TimeUnit; import java.util.logging.Level; import java.util.logging.Logger; import javax.imageio.ImageIO; @@ -126,7 +129,7 @@ public LigatureContext(final GlyphRectangle[] glyphRectangles, final int left, f * Cache the bulk of the work renderTextAsLigature does to greatly improve * performance. */ - private static Map cache = new HashMap<>();; + private static LoadingCache cache; /** * A default no-op GlyphStream to use when the user specifies null. @@ -182,6 +185,11 @@ public GlyphManagerBI(final FontInfo[] fontsInfo, final int textureBufferSize, f drawRuns = false; drawIndividual = false; drawCombined = false; + + cache = Caffeine.newBuilder() + .expireAfterWrite(1, TimeUnit.HOURS) // TODO: make this configurable + .build(key -> buildLigature(key)); + } public BufferedImage getImage() { @@ -348,16 +356,10 @@ public void renderTextAsLigatures(final String text, GlyphStream glyphStream, Gl glyphStream = DEFAULT_GLYPH_STREAM; } - // Retrieve the LigatureContext from the cache to greatly speed up - // building these ligatures which are built every time the graph is - // loaded or when the graph structure changes. Note that items are not - // purged from this cache so there is a small build up of memory over - // time. Guava caching was attempted though it was slower and negating - // the performance improvements of caching. + // Retrieve the LigatureContext from the cache to greatly speed up + // building these ligatures which are built every time the graph is + // loaded or when the graph structure changes. // - if (!cache.containsKey(text)) { - cache.put(text, buildLigature(text)); - } final LigatureContext ligature = cache.get(text); // Add the background for this text.