[
https://issues.apache.org/jira/browse/JENA-1414?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16226630#comment-16226630
]
Andy Seaborne edited comment on JENA-1414 at 10/31/17 11:33 AM:
----------------------------------------------------------------
See the discussion on JENA-1284.
If {{remove(Model)}} is not suitable when the argument model is persistent,
then the application will need to take more direct control using
{{remove(StmtIterator)}} or calls to {{removeAll}}, or even drop down to
{{GraphUtil}} bulk operations.
I do not see how {{remove(Model)}} can adapt (short of extensive redesign to
Jena graphs). It is better to provide the cases where {{size()}} is cheap or
cached.
Possible change to javadoc of {{GraphUtil.deleteFrom(Graph, Graph}}:
{noformat}
/**
* Delete triples in the destination (arg 1) as given in the source (arg
2). If
* {@code dstGraph} is a graph where {@code Graph.size()} is expensive
(e.g. it is
* persistent), then call {@link #delete(dstGraph, srcGraph.find())}
instead.
*/
{noformat}
was (Author: andy.seaborne):
See the discussion on JENA-1284.
If {{remove(Model)}} is not suitable when the argument model is persistent,
then the application will need to take more direct control using
{{remove(StmtIterator)}} or calls to {{removeAll}}, or even drop down to
{{GraphUtil}} bulk operations.
I do not see how {{remove(Model)}} can adapt (short of extensive redesign to
Jena graphs). It is better to provide the cases where {{size()}} is cheap or
cached.
Possible change to javadoc:
{noformat}
/**
* Delete triples in the destination (arg 1) as given in the source (arg
2). If
* {@code dstGraph} is a graph where {@code Graph.size()} is expensive
(e.g. it is
* persistent), then call {@link #delete(dstGraph, srcGraph.find())}
instead.
*/
{noformat}
> Performance regression in Model.remove(Model m) method
> ------------------------------------------------------
>
> Key: JENA-1414
> URL: https://issues.apache.org/jira/browse/JENA-1414
> Project: Apache Jena
> Issue Type: Bug
> Components: Core
> Affects Versions: Jena 3.3.0, Jena 3.4.0
> Reporter: Michał Woźniak
>
> The Model.remove(Model) works very slow on large models, as it propagates to
> GraphUtil.deleteFrom(Graph, Graph), which computes size of the target graph
> by iterating over all triples. This computation takes nearly 100% of the time
> of the Model.remove(Model) operation.
> It seems this commit introduced the issue:
> https://github.com/apache/jena/commit/781895ce64e062c7f2268a78189a777c39b92844#diff-fbb4d11dc804464f94c27e33e11b18e8
> Due to this bug deletion of a concept scheme on a large ontology may take
> several minutes.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)