[
https://issues.apache.org/jira/browse/JENA-1212?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15393897#comment-15393897
]
ASF GitHub Bot commented on JENA-1212:
--------------------------------------
Github user ehedgehog commented on the issue:
https://github.com/apache/jena/pull/157
OK. Timing: I had writen tests that did not allow for garbage collection
times and had also not allocated
enough heap to the JVM running the timing test.
Here's what I did. Create an array of 8M Bindings. Create a base
BindingComparator with a
SortCondition of ?v = "x/" + ((i * 223 * 359) & 0xffffff) where i is the
index of the
comparator -- this is so that sorting is predictable but telements are not
already sorted.
Run the GC and then sort the array using either the base comparator (A) or
the
comparator wrapped as an abortableComparator (B). Report the time taken.
Run comparison 20 times AB AB AB AB ... Discard first 10 measurments as
warmup. The remaining sorts take 59-61 seconds with no visible bias to
either A or B.
Similar results (that is, little difference between A and B) obtain using
2M bindings
rather than 8M, and using a different generated values for the
SortCondition.
We also compared timings of a typical query from our initial problem app;
swichting
from the Fuseki currently in use for this app to the code in this pull
request,
ie with cancellable sorts, replaced runs of approximately 26.5 seconds with
runs of approximately 27.7 seconds.
I think this is enough to say that making sorts cancellable has an overhead
of
2-4%. Do we think that's OK ?
> allow ORDER BY sort to be cancelled
> -----------------------------------
>
> Key: JENA-1212
> URL: https://issues.apache.org/jira/browse/JENA-1212
> Project: Apache Jena
> Issue Type: Improvement
> Components: ARQ
> Reporter: christopher james dollin
> Priority: Minor
> Fix For: Jena 3.1.1
>
>
> When a query with an ORDER BY is cancelled, the component
> Arrays.sort() that sorts the chunk(s) of the result
> bindings runs to completion before the cancel finishes.
> [See QueryIterSort and SortedDataBag.]
> For a large result set, this results in a long wait
> before the cancelled request finally finishes. This
> can be inconvenient.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)