[jira] [Commented] (OAK-3958) Split SegmentWriter records cache into 2: strings and templates
[ https://issues.apache.org/jira/browse/OAK-3958?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15125909#comment-15125909 ] Michael Dürig commented on OAK-3958: Hmm I see. The higher load factor trades some memory for CPU cycles. Not sure whether this is worth it or even notable. Probably not as the write calls are dominated by IO. I guess we will never know until we benchmark > Split SegmentWriter records cache into 2: strings and templates > --- > > Key: OAK-3958 > URL: https://issues.apache.org/jira/browse/OAK-3958 > Project: Jackrabbit Oak > Issue Type: Improvement > Components: segmentmk >Reporter: Alex Parvulescu >Assignee: Alex Parvulescu >Priority: Minor > Fix For: 1.3.15 > > Attachments: OAK-3958.patch > > > I think it makes sense to split the 2 caches apart, from what I've seen the > ratio is very unbalanced (10 strings to 1 template), so keeping the 2 > together might hurt the template cache. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (OAK-3958) Split SegmentWriter records cache into 2: strings and templates
[ https://issues.apache.org/jira/browse/OAK-3958?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15124891#comment-15124891 ] Alex Parvulescu commented on OAK-3958: -- interesting comment. I always wondered about this setup. before it was: {{new LinkedHashMap(15000, 0.75f, true)}} and evict when it goes over 10k items, so it would size the map at max 15k items, and it would resize at 0.75*15k = 11250 which it would never reach. with the patch I tried to keep close to this idea, but make the margins tighter: strings cache: 15k items (same as before), size the map at 1.2*size = 18k items, and trigger a resize at 0.9 of this size (16.2), while evicting at 15k. do you see anything wrong with this setup? > Split SegmentWriter records cache into 2: strings and templates > --- > > Key: OAK-3958 > URL: https://issues.apache.org/jira/browse/OAK-3958 > Project: Jackrabbit Oak > Issue Type: Improvement > Components: segmentmk >Reporter: Alex Parvulescu >Assignee: Alex Parvulescu >Priority: Minor > Fix For: 1.3.15 > > Attachments: OAK-3958.patch > > > I think it makes sense to split the 2 caches apart, from what I've seen the > ratio is very unbalanced (10 strings to 1 template), so keeping the 2 > together might hurt the template cache. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (OAK-3958) Split SegmentWriter records cache into 2: strings and templates
[ https://issues.apache.org/jira/browse/OAK-3958?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15123764#comment-15123764 ] Michael Dürig commented on OAK-3958: Patch looks good. What is the reason for changing the load factor of the linked hash map from 0.75 to 0.9? According to the Javadoc of {{HashMap}}: "As a general rule, the default load factor (.75) offers a good tradeoff between time and space costs". > Split SegmentWriter records cache into 2: strings and templates > --- > > Key: OAK-3958 > URL: https://issues.apache.org/jira/browse/OAK-3958 > Project: Jackrabbit Oak > Issue Type: Improvement > Components: segmentmk >Reporter: Alex Parvulescu >Assignee: Alex Parvulescu >Priority: Minor > Fix For: 1.3.15 > > Attachments: OAK-3958.patch > > > I think it makes sense to split the 2 caches apart, from what I've seen the > ratio is very unbalanced (10 strings to 1 template), so keeping the 2 > together might hurt the template cache. -- This message was sent by Atlassian JIRA (v6.3.4#6332)