Tomek Rękawek commented on SLING-7524:

[~jebailey], thanks for the PR! You're right, we don't need to sort the 
collection to remove the unique nodes. I have one more concern - up until now 
we don't have any iterators in Sling Query which memory usage depends on the 
collection size. Eg. we may create the collection representing the whole 
repository: {{$("/").find()}}, add any number of operations and we don't have 
to worry about OOM. The memory usage will depend on the number of operations, 
but not on the collection size. I don't think this has been documented, but 
still is quite useful. I'll update the Sling Query docs.

With the new unique() implementation we'd end up with storing all the processed 
resources in the memory. For me, the low-level memory usage is something more 
important than having the unique() behaviour fixed. That's why I'd rather avoid 

> Sling Query - unique function does not not remove all duplicates
> ----------------------------------------------------------------
>                 Key: SLING-7524
>                 URL: https://issues.apache.org/jira/browse/SLING-7524
>             Project: Sling
>          Issue Type: Improvement
>          Components: Sling Query
>            Reporter: Jason E Bailey
>            Assignee: Jason E Bailey
>            Priority: Major
> the function for unique does not match the contract a unique function usually 
> provides including JQuery, rather it's providing a sequential deduplicator.

This message was sent by Atlassian JIRA

Reply via email to