incubator-jena-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stephen Allen (Created) (JIRA)" <>
Subject [jira] [Created] (JENA-237) Quad is mutable
Date Mon, 16 Apr 2012 18:24:18 GMT
Quad is mutable

                 Key: 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.

  - 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:!default.jspa
For more information on JIRA, see:


View raw message