[infinispan-issues] [JBoss JIRA] (ISPN-7122) JpaStore Performance is Poor
Tuomas Kiviaho (JIRA)
issues at jboss.org
Thu Sep 28 04:41:00 EDT 2017
[ https://issues.jboss.org/browse/ISPN-7122?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13469643#comment-13469643 ]
Tuomas Kiviaho commented on ISPN-7122:
--------------------------------------
The bad thing is that the slowness can creep in gradually long after the decision to utilize this cache-store has been made.
It seems to me based on what is documented into the codebase that in the feat of JPA eager fetch causing OOME, the fetching of only id's is being applied.
Hibernate nowadays admits in it's fetching strategies that eager fetch should be disabled by default and (named) entity graphs/queries should be used instead in contradiction what default fetch types of @ManyToOne and @OneToOne are. The code base seems to be still using now deprecated criteria queries, but allowing different fetching strategies would leave the responsibility of avoiding possible OOME to the configurator. When no named entity graphs/queries have been provided then the default behavior could be what it is currently.
[~sannegrinovero] What would happen if the https://issues.jboss.org/browse/ISPN-4538 would be solved by just applying detach right after the entity has been consumed. Would it impact also the possible second level cache.
> JpaStore Performance is Poor
> ----------------------------
>
> Key: ISPN-7122
> URL: https://issues.jboss.org/browse/ISPN-7122
> Project: Infinispan
> Issue Type: Bug
> Components: Loaders and Stores
> Affects Versions: 8.2.4.Final
> Reporter: Dan Siviter
> Assignee: Ryan Emerson
>
> When using the {{JpaStore}} it load's IDs, then iterates around the result and manually getting the record. This means for large datasets the performance is really poor. There is a comment in the code regarding this, but in it's current state it effectively makes it unusable.
> As an example with a dataset of 12,600 records using a a generic but customised JPA:
> * Bulk load: 977ms,
> * {{JpaStore}}: 137,906ms
>
> Increase: 14,015%
> Obviously paralleling the call or another DB might be quicker, but not much!
> Would it possible to have some level of chunking/batching of the load? IMO this would be a suitable compromise.
> I'm afraid I can't share the code for my loader, but it is loading a simple entity with no referenced objects, no so no joins.
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
More information about the infinispan-issues
mailing list