You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jena.apache.org by "Stephen Allen (Updated) (JIRA)" <ji...@apache.org> on 2012/04/16 20:24:20 UTC

[jira] [Updated] (JENA-237) Quad is mutable

     [ https://issues.apache.org/jira/browse/JENA-237?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stephen Allen updated JENA-237:
-------------------------------

    Attachment: JENA-237 - Immutable Quad.patch
    
> Quad is mutable
> ---------------
>
>                 Key: JENA-237
>                 URL: https://issues.apache.org/jira/browse/JENA-237
>             Project: Apache Jena
>          Issue Type: Improvement
>          Components: ARQ
>            Reporter: Stephen Allen
>            Assignee: Stephen Allen
>            Priority: Minor
>         Attachments: JENA-237 - Immutable Quad.patch
>
>
> I notice that Quad is a mutable object, specifically it lazily caches the call of asTriple().  It seems that we can eliminate this caching and make Quad an immutable object.
> Benefits:
>   - It's really cheap to create a new Triple object on each call to asTriple()
>   - Reduce the memory footprint of Quad objects by eliminating at least a pointer, and potentially a pointer and a whole Triple object
>   - Makes Quad thread-safe
> I didn't just make the change because I didn't know if there was a reason for the current situation.  Attached patch.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira