Aklakan opened a new issue, #1474: URL: https://github.com/apache/jena/issues/1474
### Version 4.6.0-SNAPSHOT ### What happened? Another follow up on https://issues.apache.org/jira/browse/JENA-2309 I investigated the issue of slow PrefixMapStd further and it turns out that when there are 'hits' using it's fast track approach its very fast - however on 'misses' it gets extremely slow because then it falls back to iteration of all prefixes in the map. Using a small benchmark runner (part of the PR) shows the the PrefixMap can be easily brought to require dozens of seconds for lookups that can be accomplished in a split second. For that I created a new PrefixMap intended as a replacement that combines the best of both worlds: The fast track of PrefixMapStd and the trie backing (together with a guava cache) of the removed FastAbbreviatingPrefixMap. Approach 0 = Jena's original PrefixMapStd: ``` Run 1 with base <http://example.org/> and separator / using approach 0: Static IRI lookups took 0.082 seconds Run 1 with base <http://example.org/> and separator / using approach 0: Dynamic IRI lookups took 33.443 seconds Run 1 with base <urn:foo:bar:> and separator : using approach 0: Static IRI lookups took 25.482 seconds Run 1 with base <urn:foo:bar:> and separator : using approach 0: Dynamic IRI lookups took 31.088 seconds ``` Approach 1 = my optimized PrefixMap: ``` Run 1 with base <http://example.org/> and separator / using approach 1: Static IRI lookups took 0.070 seconds Run 1 with base <http://example.org/> and separator / using approach 1: Dynamic IRI lookups took 0.401 seconds Run 1 with base <urn:foo:bar:> and separator : using approach 1: Static IRI lookups took 0.099 seconds Run 1 with base <urn:foo:bar:> and separator : using approach 1: Dynamic IRI lookups took 0.433 seconds ``` ### Relevant output and stacktrace _No response_ ### Are you interested in making a pull request? Yes -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
