DataNucleus JIRA is now in read-only mode. Raise any new issues in GitHub against the plugin that it applies to. DataNucleus JIRA will remain for the foreseeable future but will eventually be discontinued
Issue Details (XML | Word | Printable)

Key: NUCCORE-1214
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Trivial Trivial
Assignee: Unassigned
Reporter: Kaarel Kann
Votes: 0
Watchers: 0

If you were logged in you would be able to see more operations.
DataNucleus Core

Cache populated ClassMetadata

Created: 23/May/14 02:13 PM   Updated: 27/May/14 08:18 PM   Resolved: 23/May/14 05:17 PM
Component/s: None
Affects Version/s: 4.0.0.m3
Fix Version/s: 4.0.0.m4

Severity: Development

 Description  « Hide
Metadata is accessed extremely frequently. Caching populated metadata separately minimizes steps needed to get the metadata (and helps to decrease lock contention).

Test results (
Head vs change:

Single-threaded test (3% difference):
COMPLETE: getObjectById time(ms)=23187
COMPLETE: getObjectById time(ms)=22307

10 thread test (~7%):
COMPLETE: getObjectById time(ms)=29920
COMPLETE: getObjectById time(ms)=27848

Sort Order: Ascending order - Click to sort in descending order
Kaarel Kann added a comment - 23/May/14 02:15 PM

Andy Jefferson added a comment - 23/May/14 03:37 PM
Couple of clarifications needed :-

1. Please clarify what is "populatedClassMetaDataByClass" ? i.e what do you mean "populated" ? Metadata is firstly populated then initialised. Then it is ready for use. Something saying "populated" to me means just populated, so not ready to hand out (assuming that is what you mean).

2. Also "getMetaDataForClassImpl" ? What does this do that getMetaDataForClass doesn't do ? "ClassImpl" naming implies implementation of class (to me). Do you mean "internal" (for internal use only) ? If so I'd expect it to be private/protected and named as such.

Andy Jefferson added a comment - 23/May/14 05:17 PM
Actually your "XXXImpl" method were private, was trying to read the lines changed and work out what it looked like. Anyway I've applied an adaption of your patch to GitHub master where we don't have these 2 new methods but still restrict how much code is synced. Suggest you have a try with that and if you have any updates to it I can re-open this.