Skip to content

Conversation

meeximum
Copy link

In our case this brings a performance improvement!

In our case this brings a performance improvement!
ConcurrentHashMap,ConcurrentMap
@meeximum meeximum closed this Feb 20, 2017
@meeximum meeximum reopened this Feb 20, 2017
@stariy95
Copy link
Member

Hi @meeximum,

Thank you for your pull request, indeed caching can be helpful in query parsing.
But I see some problems with your solution:

  1. Cache is unbound, so it can lead to memory leaks in long living apps.
  2. SimpleNode is a mutable object, and even if it is used only inside parser, we shouldn't assume that it wouldn't change its state somehow.

So while this solution can be really helpful in certain Cayenne usage, we can't approve this for general usage.
Moreover the caching inside Cayenne probably should be redesigned, so this task is out of scope for 4.0 release as it is close to BETA stage.

Also I've created JIRA issue not to lose your idea: https://issues.apache.org/jira/browse/CAY-2247

@meeximum
Copy link
Author

meeximum commented Feb 24, 2017 via email

@ben-manes
Copy link

Cayenne is currently using concurrentlinkedhashmap for caching, so an option is available data structure wise. It's successor, Caffeine, has optional jcache support.

@stariy95
Copy link
Member

For the history.
Per #238 Cayenne got own template parser with proper result caching.

@stariy95 stariy95 closed this May 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants