[jira] [Commented] (OFBIZ-6747) Replace ConcurrentLinkedHashMap by Caffeine
[ https://issues.apache.org/jira/browse/OFBIZ-6747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17616204#comment-17616204 ] Ben Manes commented on OFBIZ-6747: -- I see that comment in your {{ldap/build.gradle}} file, but now that you changed the "consumer" to 11 it should allow you to upgrade? > Replace ConcurrentLinkedHashMap by Caffeine > --- > > Key: OFBIZ-6747 > URL: https://issues.apache.org/jira/browse/OFBIZ-6747 > Project: OFBiz > Issue Type: Task > Components: ALL COMPONENTS >Reporter: Ben Manes >Assignee: Jacques Le Roux >Priority: Minor > > Similar to OFBIZ-3779, please consider upgrading the library used by > [UtilCache|https://github.com/apache/ofbiz/blob/trunk/framework/base/src/main/java/org/apache/ofbiz/base/util/cache/UtilCache.java] > (v1.2). The current version is 1.4.2 and is the last major release planned. > The preferable alternative would be to upgrade to > [Caffeine|https://github.com/ben-manes/caffeine]. This is a Java 8 rewrite > based on what I've learned since developing CLHM and Guava's cache. As > expected it provides [superior > performance|https://github.com/ben-manes/caffeine/wiki/Benchmarks]. It also > provides a [near > optimal|https://github.com/ben-manes/caffeine/wiki/Efficiency] eviction > policy. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (OFBIZ-6747) Replace ConcurrentLinkedHashMap by Caffeine
[ https://issues.apache.org/jira/browse/OFBIZ-6747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17616197#comment-17616197 ] Jacques Le Roux commented on OFBIZ-6747: We crossed on wire :) > Replace ConcurrentLinkedHashMap by Caffeine > --- > > Key: OFBIZ-6747 > URL: https://issues.apache.org/jira/browse/OFBIZ-6747 > Project: OFBiz > Issue Type: Task > Components: ALL COMPONENTS >Reporter: Ben Manes >Assignee: Jacques Le Roux >Priority: Minor > > Similar to OFBIZ-3779, please consider upgrading the library used by > [UtilCache|https://github.com/apache/ofbiz/blob/trunk/framework/base/src/main/java/org/apache/ofbiz/base/util/cache/UtilCache.java] > (v1.2). The current version is 1.4.2 and is the last major release planned. > The preferable alternative would be to upgrade to > [Caffeine|https://github.com/ben-manes/caffeine]. This is a Java 8 rewrite > based on what I've learned since developing CLHM and Guava's cache. As > expected it provides [superior > performance|https://github.com/ben-manes/caffeine/wiki/Benchmarks]. It also > provides a [near > optimal|https://github.com/ben-manes/caffeine/wiki/Efficiency] eviction > policy. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (OFBIZ-6747) Replace ConcurrentLinkedHashMap by Caffeine
[ https://issues.apache.org/jira/browse/OFBIZ-6747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17616196#comment-17616196 ] Jacques Le Roux commented on OFBIZ-6747: Thanks for targetCompatibility info. As I said I'm far from a Gradle specialist :/ So 3.1.1 compiles when using sourceCompatibility = '11' targetCompatibility = '11' Not even a problem with solr-core. We are already running all our branches with Java 11. Remains solr-core but that's another issue (with also our LDAP plugin that says: bq. pluginLibsCompile 'org.apereo.cas:cas-server-support-ldap-core:5.0.10' // 6.4.0 declares an API of a component compatible with Java 11 and the consumer needed a runtime of a component compatible with Java 8) > Replace ConcurrentLinkedHashMap by Caffeine > --- > > Key: OFBIZ-6747 > URL: https://issues.apache.org/jira/browse/OFBIZ-6747 > Project: OFBiz > Issue Type: Task > Components: ALL COMPONENTS >Reporter: Ben Manes >Assignee: Jacques Le Roux >Priority: Minor > > Similar to OFBIZ-3779, please consider upgrading the library used by > [UtilCache|https://github.com/apache/ofbiz/blob/trunk/framework/base/src/main/java/org/apache/ofbiz/base/util/cache/UtilCache.java] > (v1.2). The current version is 1.4.2 and is the last major release planned. > The preferable alternative would be to upgrade to > [Caffeine|https://github.com/ben-manes/caffeine]. This is a Java 8 rewrite > based on what I've learned since developing CLHM and Guava's cache. As > expected it provides [superior > performance|https://github.com/ben-manes/caffeine/wiki/Benchmarks]. It also > provides a [near > optimal|https://github.com/ben-manes/caffeine/wiki/Efficiency] eviction > policy. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (OFBIZ-6747) Replace ConcurrentLinkedHashMap by Caffeine
[ https://issues.apache.org/jira/browse/OFBIZ-6747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17616194#comment-17616194 ] Ben Manes commented on OFBIZ-6747: -- I think you could change these [two lines|https://github.com/apache/ofbiz-framework/blob/ac2270118df04bc593d4af029942478f85f13f01/build.gradle#L125-L126] to 11 and it might work, {code:groovy} sourceCompatibility = '1.8' targetCompatibility = '1.8' {code} > Replace ConcurrentLinkedHashMap by Caffeine > --- > > Key: OFBIZ-6747 > URL: https://issues.apache.org/jira/browse/OFBIZ-6747 > Project: OFBiz > Issue Type: Task > Components: ALL COMPONENTS >Reporter: Ben Manes >Assignee: Jacques Le Roux >Priority: Minor > > Similar to OFBIZ-3779, please consider upgrading the library used by > [UtilCache|https://github.com/apache/ofbiz/blob/trunk/framework/base/src/main/java/org/apache/ofbiz/base/util/cache/UtilCache.java] > (v1.2). The current version is 1.4.2 and is the last major release planned. > The preferable alternative would be to upgrade to > [Caffeine|https://github.com/ben-manes/caffeine]. This is a Java 8 rewrite > based on what I've learned since developing CLHM and Guava's cache. As > expected it provides [superior > performance|https://github.com/ben-manes/caffeine/wiki/Benchmarks]. It also > provides a [near > optimal|https://github.com/ben-manes/caffeine/wiki/Efficiency] eviction > policy. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (OFBIZ-6747) Replace ConcurrentLinkedHashMap by Caffeine
[ https://issues.apache.org/jira/browse/OFBIZ-6747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17616193#comment-17616193 ] Jacques Le Roux commented on OFBIZ-6747: By curiosity I tried that with 3.1.1: {code} --- a/build.gradle +++ b/build.gradle @@ -100,7 +100,7 @@ javadoc { // Those external Javadoc links should correspond to the actual // versions declared in the 'dependencies' block. links( -'https://docs.oracle.com/javase/8/docs/api', +'https://docs.oracle.com/javase/11/docs/api', 'https://tomcat.apache.org/tomcat-9.0-doc/servletapi/', 'http://docs.groovy-lang.org/docs/groovy-2.5.18/html/api', 'https://commons.apache.org/proper/commons-cli/apidocs' {code} Excluding solr-core, I thought the problem could be using a reference to Java 8 API. But I get the same error. I don't clearly understand why it says: {code} The consumer was configured to find a runtime of a library compatible with Java 8, packaged as a jar, and its dependencies declared externally {code} I don't see any other place where Java 8 is required. I must say I'm not a Gradle specialist Anyway, more as an information for us. As we said we can still use CLHM. Anyway, that's not the sole dependency we are stuck with. OFBiz is a 21 years old large project, quite mature we can say ;) > Replace ConcurrentLinkedHashMap by Caffeine > --- > > Key: OFBIZ-6747 > URL: https://issues.apache.org/jira/browse/OFBIZ-6747 > Project: OFBiz > Issue Type: Task > Components: ALL COMPONENTS >Reporter: Ben Manes >Assignee: Jacques Le Roux >Priority: Minor > > Similar to OFBIZ-3779, please consider upgrading the library used by > [UtilCache|https://github.com/apache/ofbiz/blob/trunk/framework/base/src/main/java/org/apache/ofbiz/base/util/cache/UtilCache.java] > (v1.2). The current version is 1.4.2 and is the last major release planned. > The preferable alternative would be to upgrade to > [Caffeine|https://github.com/ben-manes/caffeine]. This is a Java 8 rewrite > based on what I've learned since developing CLHM and Guava's cache. As > expected it provides [superior > performance|https://github.com/ben-manes/caffeine/wiki/Benchmarks]. It also > provides a [near > optimal|https://github.com/ben-manes/caffeine/wiki/Efficiency] eviction > policy. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (OFBIZ-6747) Replace ConcurrentLinkedHashMap by Caffeine
[ https://issues.apache.org/jira/browse/OFBIZ-6747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17616191#comment-17616191 ] Ben Manes commented on OFBIZ-6747: -- {quote}We run under Java 11, but the build requires Java 8, right? {quote} Yes, in your build file it specifies {{{}targetCompatibility = '1.8'{}}}. Since Caffeine v3.x targets 11 it fails when Gradle inspects their module metadata rather that at compile / runtime due to an unsupported class file version. Unfortunately the error messages are not very clear and I even ran into a dependency's [mismatch|https://github.com/tbroyer/gradle-errorprone-plugin/issues/73] yesterday. The {{:}} is short for the root project, so a subproject would be {{:applications:workeffort}} (via {{{}gradlew projects{}}}). In your setup I think it is applied everywhere. {quote}Also we are somehow stuck with solr-core 8 {quote} fwiw, Solr 8.3 adopted Caffeine and removed their custom caches in 9.0. > Replace ConcurrentLinkedHashMap by Caffeine > --- > > Key: OFBIZ-6747 > URL: https://issues.apache.org/jira/browse/OFBIZ-6747 > Project: OFBiz > Issue Type: Task > Components: ALL COMPONENTS >Reporter: Ben Manes >Assignee: Jacques Le Roux >Priority: Minor > > Similar to OFBIZ-3779, please consider upgrading the library used by > [UtilCache|https://github.com/apache/ofbiz/blob/trunk/framework/base/src/main/java/org/apache/ofbiz/base/util/cache/UtilCache.java] > (v1.2). The current version is 1.4.2 and is the last major release planned. > The preferable alternative would be to upgrade to > [Caffeine|https://github.com/ben-manes/caffeine]. This is a Java 8 rewrite > based on what I've learned since developing CLHM and Guava's cache. As > expected it provides [superior > performance|https://github.com/ben-manes/caffeine/wiki/Benchmarks]. It also > provides a [near > optimal|https://github.com/ben-manes/caffeine/wiki/Efficiency] eviction > policy. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (OFBIZ-6747) Replace ConcurrentLinkedHashMap by Caffeine
[ https://issues.apache.org/jira/browse/OFBIZ-6747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17616188#comment-17616188 ] Jacques Le Roux commented on OFBIZ-6747: Hi Ben, I'm still not sure to understand the reason we need 2.9.3. We run under Java 11, but the build requires Java 8, right? Something I don't understand is the 1st block of error {quote} > Could not resolve com.github.ben-manes.caffeine:caffeine:3.1.1. Required by: project : > No matching variant of com.github.ben-manes.caffeine:caffeine:3.1.1 was found. {quote} "project" is empty. I guess it means the whole project (ie ofbiz), right? Also we are somehow stuck with solr-core 8 (OFBIZ-10633). {quote} So it works but I'm unsure of the situation. So I suggest for now to continue to use the 8 branch. {quote} Fortunately, as you said, we can live with CLHM for now, no hurry :) > Replace ConcurrentLinkedHashMap by Caffeine > --- > > Key: OFBIZ-6747 > URL: https://issues.apache.org/jira/browse/OFBIZ-6747 > Project: OFBiz > Issue Type: Task > Components: ALL COMPONENTS >Reporter: Ben Manes >Assignee: Jacques Le Roux >Priority: Minor > > Similar to OFBIZ-3779, please consider upgrading the library used by > [UtilCache|https://github.com/apache/ofbiz/blob/trunk/framework/base/src/main/java/org/apache/ofbiz/base/util/cache/UtilCache.java] > (v1.2). The current version is 1.4.2 and is the last major release planned. > The preferable alternative would be to upgrade to > [Caffeine|https://github.com/ben-manes/caffeine]. This is a Java 8 rewrite > based on what I've learned since developing CLHM and Guava's cache. As > expected it provides [superior > performance|https://github.com/ben-manes/caffeine/wiki/Benchmarks]. It also > provides a [near > optimal|https://github.com/ben-manes/caffeine/wiki/Efficiency] eviction > policy. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (OFBIZ-6747) Replace ConcurrentLinkedHashMap by Caffeine
[ https://issues.apache.org/jira/browse/OFBIZ-6747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17615993#comment-17615993 ] Ben Manes commented on OFBIZ-6747: -- Good catch. The error you saw and figured out is that Caffeine v3 requires Java 11+, but your build targets Java 8. {quote}The consumer was configured to find a runtime of a library compatible with Java 8 {quote} The minimum requirements change was to migrate from {{sun.misc.Unsafe}} to {{VarHandles}} (Java 9). The usage was primarily to avoid per-entry bloat of a few {{AtomicReference}} fields so benign, but understandably no one's preference. For Java 8 the only alternative is {{AtomicReferenceFieldUpdater,}} but that uses reflection per call so known that it can be slow. Anyway, the main motivation for this ticket was informing you of the dependency's evolution. As it works fine I don't want to create headaches, just awareness that CLHM is stable but end-of-life with the successor being Caffeine. It's perfectly fine to stay as is. > Replace ConcurrentLinkedHashMap by Caffeine > --- > > Key: OFBIZ-6747 > URL: https://issues.apache.org/jira/browse/OFBIZ-6747 > Project: OFBiz > Issue Type: Task > Components: ALL COMPONENTS >Reporter: Ben Manes >Assignee: Jacques Le Roux >Priority: Minor > > Similar to OFBIZ-3779, please consider upgrading the library used by > [UtilCache|https://github.com/apache/ofbiz/blob/trunk/framework/base/src/main/java/org/apache/ofbiz/base/util/cache/UtilCache.java] > (v1.2). The current version is 1.4.2 and is the last major release planned. > The preferable alternative would be to upgrade to > [Caffeine|https://github.com/ben-manes/caffeine]. This is a Java 8 rewrite > based on what I've learned since developing CLHM and Guava's cache. As > expected it provides [superior > performance|https://github.com/ben-manes/caffeine/wiki/Benchmarks]. It also > provides a [near > optimal|https://github.com/ben-manes/caffeine/wiki/Efficiency] eviction > policy. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Comment Edited] (OFBIZ-6747) Replace ConcurrentLinkedHashMap by Caffeine
[ https://issues.apache.org/jira/browse/OFBIZ-6747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17615730#comment-17615730 ] Jacques Le Roux edited comment on OFBIZ-6747 at 10/11/22 12:02 PM: --- 2.9.3 works. I mean you can compile, did not touch at the code yet. was (Author: jacques.le.roux): 2.9.3 works > Replace ConcurrentLinkedHashMap by Caffeine > --- > > Key: OFBIZ-6747 > URL: https://issues.apache.org/jira/browse/OFBIZ-6747 > Project: OFBiz > Issue Type: Task > Components: ALL COMPONENTS >Reporter: Ben Manes >Assignee: Jacques Le Roux >Priority: Minor > > Similar to OFBIZ-3779, please consider upgrading the library used by > [UtilCache|https://github.com/apache/ofbiz/blob/trunk/framework/base/src/main/java/org/apache/ofbiz/base/util/cache/UtilCache.java] > (v1.2). The current version is 1.4.2 and is the last major release planned. > The preferable alternative would be to upgrade to > [Caffeine|https://github.com/ben-manes/caffeine]. This is a Java 8 rewrite > based on what I've learned since developing CLHM and Guava's cache. As > expected it provides [superior > performance|https://github.com/ben-manes/caffeine/wiki/Benchmarks]. It also > provides a [near > optimal|https://github.com/ben-manes/caffeine/wiki/Efficiency] eviction > policy. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (OFBIZ-6747) Replace ConcurrentLinkedHashMap by Caffeine
[ https://issues.apache.org/jira/browse/OFBIZ-6747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17615730#comment-17615730 ] Jacques Le Roux commented on OFBIZ-6747: 2.9.3 works > Replace ConcurrentLinkedHashMap by Caffeine > --- > > Key: OFBIZ-6747 > URL: https://issues.apache.org/jira/browse/OFBIZ-6747 > Project: OFBiz > Issue Type: Task > Components: ALL COMPONENTS >Reporter: Ben Manes >Assignee: Jacques Le Roux >Priority: Minor > > Similar to OFBIZ-3779, please consider upgrading the library used by > [UtilCache|https://github.com/apache/ofbiz/blob/trunk/framework/base/src/main/java/org/apache/ofbiz/base/util/cache/UtilCache.java] > (v1.2). The current version is 1.4.2 and is the last major release planned. > The preferable alternative would be to upgrade to > [Caffeine|https://github.com/ben-manes/caffeine]. This is a Java 8 rewrite > based on what I've learned since developing CLHM and Guava's cache. As > expected it provides [superior > performance|https://github.com/ben-manes/caffeine/wiki/Benchmarks]. It also > provides a [near > optimal|https://github.com/ben-manes/caffeine/wiki/Efficiency] eviction > policy. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (OFBIZ-6747) Replace ConcurrentLinkedHashMap by Caffeine
[ https://issues.apache.org/jira/browse/OFBIZ-6747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17615671#comment-17615671 ] Jacques Le Roux commented on OFBIZ-6747: I tried to add caffeine:3.1.1 and got this: {noformat} > Could not resolve com.github.ben-manes.caffeine:caffeine:3.1.1. Required by: project : > No matching variant of com.github.ben-manes.caffeine:caffeine:3.1.1 was found. The consumer was configured to find a runtime of a library compatible with Java 8, packaged as a jar, and its dependencies declared externally but: - Variant 'apiElements' capability com.github.ben-manes.caffeine:caffeine:3.1.1 declares a library, packaged as a jar, and its dependencies declared externally: - Incompatible because this component declares an API of a component compatible with Java 11 and the consumer needed a runtime of a component compatible with Java 8 - Variant 'javadocElements' capability com.github.ben-manes.caffeine:caffeine:3.1.1 declares a runtime of a component, and its dependencies declared externally: - Incompatible because this component declares documentation and the consumer needed a library - Other compatible attributes: - Doesn't say anything about its target Java version (required compatibility with Java 8) - Doesn't say anything about its elements (required them packaged as a jar) - Variant 'runtimeElements' capability com.github.ben-manes.caffeine:caffeine:3.1.1 declares a runtime of a library, packaged as a jar, and its dependencies declared externally: - Incompatible because this component declares a component compatible with Java 11 and the consumer needed a component compatible with Java 8 - Variant 'sourcesElements' capability com.github.ben-manes.caffeine:caffeine:3.1.1 declares a runtime of a component, and its dependencies declared externally: - Incompatible because this component declares documentation and the consumer needed a library - Other compatible attributes: - Doesn't say anything about its target Java version (required compatibility with Java 8) - Doesn't say anything about its elements (required them packaged as a jar) > Could not resolve com.github.ben-manes.caffeine:caffeine:2.9.2. Required by: project : > project :plugins:solr > org.apache.solr:solr-core:8.11.2 > No matching variant of com.github.ben-manes.caffeine:caffeine:3.1.1 was found. The consumer was configured to find a runtime of a library compatible with Java 8, packaged as a jar, and its dependencies declared externally but: - Variant 'apiElements' capability com.github.ben-manes.caffeine:caffeine:3.1.1 declares a library, packaged as a jar, and its dependencies declared externally: - Incompatible because this component declares an API of a component compatible with Java 11 and the consumer needed a runtime of a component compatible with Java 8 - Variant 'javadocElements' capability com.github.ben-manes.caffeine:caffeine:3.1.1 declares a runtime of a component, and its dependencies declared externally: - Incompatible because this component declares documentation and the consumer needed a library - Other compatible attributes: - Doesn't say anything about its target Java version (required compatibility with Java 8) - Doesn't say anything about its elements (required them packaged as a jar) - Variant 'runtimeElements' capability com.github.ben-manes.caffeine:caffeine:3.1.1 declares a runtime of a library, packaged as a jar, and its dependencies declared externally: - Incompatible because this component declares a component compatible with Java 11 and the consumer needed a component compatible with Java 8 - Variant 'sourcesElements' capability com.github.ben-manes.caffeine:caffeine:3.1.1 declares a runtime of a component, and its dependencies declared externally: - Incompatible because this component declares documentation and the consumer needed a library - Other compatible attributes: - Doesn't say anything about its target Java version (required compatibility with Java 8) - Doesn't say anything about its elements (required them packaged as a jar) {noformat} I tried to comment out related tasks. after 3 changes decided to stop. It seems similar to https://github.com/ben-manes/caffeine/issues/716 but I have not yet looked into details > Replace ConcurrentLinkedHashMap by Caffeine > --- > > Key: OFBIZ-6747 > URL: https://issues.apache.org/jira/browse/OFBIZ-6747 > Project: OFBiz > Issue Type: Task > Components: ALL COMPONENTS >Reporter: Ben Manes >
[jira] [Commented] (OFBIZ-10934) Performance Increase: Using replace() instead of replaceAll() when a regex is not used increases performance
[ https://issues.apache.org/jira/browse/OFBIZ-10934?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17615642#comment-17615642 ] ASF subversion and git services commented on OFBIZ-10934: - Commit ac2270118df04bc593d4af029942478f85f13f01 in ofbiz-framework's branch refs/heads/trunk from Jacques Le Roux [ https://gitbox.apache.org/repos/asf?p=ofbiz-framework.git;h=ac2270118d ] Fixed: Use replace() instead of replaceAll() when a regex is not used (OFBIZ-10934) Regexp needs to double the backslash, so replaceAll() needs too, but not replace() This fixes all cases put in with previous commits > Performance Increase: Using replace() instead of replaceAll() when a regex is > not used increases performance > > > Key: OFBIZ-10934 > URL: https://issues.apache.org/jira/browse/OFBIZ-10934 > Project: OFBiz > Issue Type: Improvement > Components: framework >Affects Versions: Trunk, Upcoming Branch >Reporter: bd2019us >Assignee: Jacques Le Roux >Priority: Trivial > Labels: performance > Attachments: OFBIZ-10934.patch, OFBIZ10934-MORE.patch, affected_files > > > Affected files: > # framework/base/src/main/java/org/apache/ofbiz/base/util/UtilHttp.java > # > framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/MacroFormRenderer.java > # > framework/entity/src/main/java/org/apache/ofbiz/entity/condition/EntityOperator.java > # framework/base/src/main/java/org/apache/ofbiz/base/util/KeyStoreUtil.java > When replaceAll() is utilized and no regex is used, replaceAll() can be > replaced with replace() for better performance. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (OFBIZ-6747) Replace ConcurrentLinkedHashMap by Caffeine
[ https://issues.apache.org/jira/browse/OFBIZ-6747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17615572#comment-17615572 ] Jacques Le Roux commented on OFBIZ-6747: Thanks Ben, That's another perspective to consider indeed! > Replace ConcurrentLinkedHashMap by Caffeine > --- > > Key: OFBIZ-6747 > URL: https://issues.apache.org/jira/browse/OFBIZ-6747 > Project: OFBiz > Issue Type: Task > Components: ALL COMPONENTS >Reporter: Ben Manes >Assignee: Jacques Le Roux >Priority: Minor > > Similar to OFBIZ-3779, please consider upgrading the library used by > [UtilCache|https://github.com/apache/ofbiz/blob/trunk/framework/base/src/main/java/org/apache/ofbiz/base/util/cache/UtilCache.java] > (v1.2). The current version is 1.4.2 and is the last major release planned. > The preferable alternative would be to upgrade to > [Caffeine|https://github.com/ben-manes/caffeine]. This is a Java 8 rewrite > based on what I've learned since developing CLHM and Guava's cache. As > expected it provides [superior > performance|https://github.com/ben-manes/caffeine/wiki/Benchmarks]. It also > provides a [near > optimal|https://github.com/ben-manes/caffeine/wiki/Efficiency] eviction > policy. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (OFBIZ-6747) Replace ConcurrentLinkedHashMap by Caffeine
[ https://issues.apache.org/jira/browse/OFBIZ-6747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17615508#comment-17615508 ] Ben Manes commented on OFBIZ-6747: -- Sorry, I did not mean for you to replace {{UtilCache}} as it provides a nice abstraction. The internal implementation could switch from CLHM to Caffeine. This would be less invasive as Caffeine offers all of the older library's functionality, with the caveat that the eviction policy differs (if sadly someone depended on LRU behavior). It may be that you could reduce code by migrating features like expiration and soft references to Caffeine, but that would be a larger, more complicated effort. > Replace ConcurrentLinkedHashMap by Caffeine > --- > > Key: OFBIZ-6747 > URL: https://issues.apache.org/jira/browse/OFBIZ-6747 > Project: OFBiz > Issue Type: Task > Components: ALL COMPONENTS >Reporter: Ben Manes >Assignee: Jacques Le Roux >Priority: Minor > > Similar to OFBIZ-3779, please consider upgrading the library used by > [UtilCache|https://github.com/apache/ofbiz/blob/trunk/framework/base/src/main/java/org/apache/ofbiz/base/util/cache/UtilCache.java] > (v1.2). The current version is 1.4.2 and is the last major release planned. > The preferable alternative would be to upgrade to > [Caffeine|https://github.com/ben-manes/caffeine]. This is a Java 8 rewrite > based on what I've learned since developing CLHM and Guava's cache. As > expected it provides [superior > performance|https://github.com/ben-manes/caffeine/wiki/Benchmarks]. It also > provides a [near > optimal|https://github.com/ben-manes/caffeine/wiki/Efficiency] eviction > policy. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (OFBIZ-10934) Performance Increase: Using replace() instead of replaceAll() when a regex is not used increases performance
[ https://issues.apache.org/jira/browse/OFBIZ-10934?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17615506#comment-17615506 ] ASF subversion and git services commented on OFBIZ-10934: - Commit 4316959ba87c2237dc1149dd44f0f3a9f17d93af in ofbiz-framework's branch refs/heads/trunk from Jacques Le Roux [ https://gitbox.apache.org/repos/asf?p=ofbiz-framework.git;h=4316959ba8 ] Reverted: Improved: Use replace() instead of replaceAll() when a regex is not used (OFBIZ-10934) Reverts commit 198748b89d. I have to investigate what the pb is. Seems to be in MacroMenuRenderer > Performance Increase: Using replace() instead of replaceAll() when a regex is > not used increases performance > > > Key: OFBIZ-10934 > URL: https://issues.apache.org/jira/browse/OFBIZ-10934 > Project: OFBiz > Issue Type: Improvement > Components: framework >Affects Versions: Trunk, Upcoming Branch >Reporter: bd2019us >Assignee: Jacques Le Roux >Priority: Trivial > Labels: performance > Attachments: OFBIZ-10934.patch, OFBIZ10934-MORE.patch, affected_files > > > Affected files: > # framework/base/src/main/java/org/apache/ofbiz/base/util/UtilHttp.java > # > framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/MacroFormRenderer.java > # > framework/entity/src/main/java/org/apache/ofbiz/entity/condition/EntityOperator.java > # framework/base/src/main/java/org/apache/ofbiz/base/util/KeyStoreUtil.java > When replaceAll() is utilized and no regex is used, replaceAll() can be > replaced with replace() for better performance. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (OFBIZ-6747) Replace ConcurrentLinkedHashMap by Caffeine
[ https://issues.apache.org/jira/browse/OFBIZ-6747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17615501#comment-17615501 ] Jacques Le Roux commented on OFBIZ-6747: This is not an easy work. There are 289 occurrences of UtilCache class usage in both Java and Groovy files. And the UtilCache and Caffeine APIs are of course different. It does not mean that we can't do it. But that's a huge and risky task... > Replace ConcurrentLinkedHashMap by Caffeine > --- > > Key: OFBIZ-6747 > URL: https://issues.apache.org/jira/browse/OFBIZ-6747 > Project: OFBiz > Issue Type: Task > Components: ALL COMPONENTS >Reporter: Ben Manes >Assignee: Jacques Le Roux >Priority: Minor > > Similar to OFBIZ-3779, please consider upgrading the library used by > [UtilCache|https://github.com/apache/ofbiz/blob/trunk/framework/base/src/main/java/org/apache/ofbiz/base/util/cache/UtilCache.java] > (v1.2). The current version is 1.4.2 and is the last major release planned. > The preferable alternative would be to upgrade to > [Caffeine|https://github.com/ben-manes/caffeine]. This is a Java 8 rewrite > based on what I've learned since developing CLHM and Guava's cache. As > expected it provides [superior > performance|https://github.com/ben-manes/caffeine/wiki/Benchmarks]. It also > provides a [near > optimal|https://github.com/ben-manes/caffeine/wiki/Efficiency] eviction > policy. -- This message was sent by Atlassian Jira (v8.20.10#820010)