Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache ClassInfo methods results #852

Closed
nithril opened this issue Oct 21, 2020 · 2 comments
Closed

Cache ClassInfo methods results #852

nithril opened this issue Oct 21, 2020 · 2 comments

Comments

@nithril
Copy link
Contributor

nithril commented Oct 21, 2020

Expected Behavior

Per my (little) understanding of the ClassInfo class I would suggest to cache the results of the following methods:

  • ClassInfo#relationshipFields
  • ClassInfo#getEndNodeReader
  • ClassInfo#startNodeReader

Context

On a project I'm working on we have performance issues. We made the exercise to profile the application to fix the bottleneck.
We have identified the aforementionned methods as responsible of a fraction of the time taken (not negligible).

Please let me know if it makes sense. If so I can submit a pull request.

Your Environment

  • Java version: 1.8.0.265
  • Neo4j version (The version of the database): 3.5.21
  • OGM Version (The version of this software): 3.2.17
  • OGM Transport used (One of Bolt, HTTP or embedded): Bolt
  • Neo4j Java Driver version (in case of Bolt transport): 4.0.2
@meistermeier
Copy link
Collaborator

Thanks for reporting this (and the two others).
I just had a glance at the methods you mentioned and think that a storage of those static information could be worth the memory.
So if you are willing to submit a PR for those, go ahead. Looking forward to see your contribution.
Even though this one and #853 are pretty close together, I would prefer to have two separated PRs to avoid too much changes in a commit.

@nithril
Copy link
Contributor Author

nithril commented Oct 23, 2020

👍 I will work on that. Given that #849 has already tackled ClassInfo#relationshipFields I will do the 2 others one

nithril pushed a commit to nithril/neo4j-ogm that referenced this issue Oct 26, 2020
michael-simons pushed a commit that referenced this issue Oct 29, 2020
…escribing relationship entities.

This closes #852.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants