You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jena.apache.org by "Alexis Armin Huf (JIRA)" <ji...@apache.org> on 2017/02/19 21:21:44 UTC
[jira] [Updated] (JENA-1290) Slow Model.createList()
[ https://issues.apache.org/jira/browse/JENA-1290?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Alexis Armin Huf updated JENA-1290:
-----------------------------------
Attachment: JENA-1290.patch
> Slow Model.createList()
> -----------------------
>
> Key: JENA-1290
> URL: https://issues.apache.org/jira/browse/JENA-1290
> Project: Apache Jena
> Issue Type: Improvement
> Components: Core
> Affects Versions: Jena 3.0.1, Jena 3.2.0
> Environment: OpenJDK 1.8.0.121-b13
> Reporter: Alexis Armin Huf
> Priority: Minor
> Attachments: JENA-1290.patch
>
>
> Model.createList(Iterator) is slow for large list sizes. Starting at 128 nodes, creating a list from an ArrayList iterator takes ~3.6ms and the time goes up to 182ms for 1024 nodes. Creating the RDF list by hand and then doing .as(RDFList.class) for the 1024-nodes tests takes only 1.2ms. I will attach a MWE.
> Going through the code, the cause seems to be that RDFListImpl.with() , which is called for every member added, will always walk the entire list to get the last node. It mentions a possible cache for that, but it is not implemented. I wrote a patch for this issue replacing ModelCom.createList() implementation. I could not find tests for createList, so I added three simple ones to TestModel.
> PS: I'm having a classpath issue with jena-arq tests on mvn clean install, so I could only run tests for jena-core. Are there specific more instructions somewhere for building and testing jena?
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)