XStream
  1. XStream
  2. XSTR-773

Exclude Immutable types from xpath entry on deserialization

    Details

    • Type: Improvement Improvement
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.4.7
    • Fix Version/s: 1.4.9
    • Component/s: Converters
    • Labels:
      None

      Description

      As a developer I want to serialize and deserialize complex models without excessive use of xpath's so that I can use xstream on large documents with little memory overhead.

      Currently XStream's use of XPaths is very selective in serialization (marshalling), but excessive in unmarshalling (deserialization). while unmarshalling documents, regardless immutability configuration, every instance will receive an xpath entry in the AbstractReferenceUnmarshaller's xpath map.

      To complicate things, if this map is simply updated to follow the same behavior as serialization, then it would break compatibility with previous versions of xstream, as the default immutable types configuration changes. In the event that type X is serialized with an early version of XStream that considers it not to be immutable, and then later deserialized with a version of XStream that does consider it to be immutable, the resulting deserialization attempt will fail, as the document will contain and xpath entry that the deserializer will not keep.

        Activity

        Geoff Groos made changes -
        Field Original Value New Value
        Summary Exclude Immutable types from xpath system on deserialization Exclude Immutable types from xpath entry on deserialization
        Geoff Groos made changes -
        Description > As a developer I want to serialize and deserialize complex models without excessive use of xpath's so that I can use xstream on large documents with little memory overhead.

        Currently XStream's use of XPaths is very selective in serialization (marshalling), but excessive in unmarshalling (deserialization). while unmarshalling documents, regardless immutability configuration, every instance will receive an xpath entry in the `AbstractReferenceUnmarshaller`'s xpath map.

        To complicate things, if this map is simply updated to follow the same behavior as serialization, then it would break compatibility with previous versions of xstream, as the default immutable types configuration changes. In the event that type X is serialized with an early version of XStream that considers it _not_ to be immutable, and then later deserialized with a version of XStream that _does_ consider it to be immutable, the resulting deserialization attempt will fail, as the document will contain and xpath entry that the deserializer will not keep.
        > As a developer I want to serialize and deserialize complex models without excessive use of xpath's so that I can use xstream on large documents with little memory overhead.

        Currently XStream's use of XPaths is very selective in serialization (marshalling), but excessive in unmarshalling (deserialization). while unmarshalling documents, regardless immutability configuration, every instance will receive an xpath entry in the {{AbstractReferenceUnmarshaller}}'s xpath map.

        To complicate things, if this map is simply updated to follow the same behavior as serialization, then it would break compatibility with previous versions of xstream, as the default immutable types configuration changes. In the event that type X is serialized with an early version of XStream that considers it _not_ to be immutable, and then later deserialized with a version of XStream that _does_ consider it to be immutable, the resulting deserialization attempt will fail, as the document will contain and xpath entry that the deserializer will not keep.
        Geoff Groos made changes -
        Description > As a developer I want to serialize and deserialize complex models without excessive use of xpath's so that I can use xstream on large documents with little memory overhead.

        Currently XStream's use of XPaths is very selective in serialization (marshalling), but excessive in unmarshalling (deserialization). while unmarshalling documents, regardless immutability configuration, every instance will receive an xpath entry in the {{AbstractReferenceUnmarshaller}}'s xpath map.

        To complicate things, if this map is simply updated to follow the same behavior as serialization, then it would break compatibility with previous versions of xstream, as the default immutable types configuration changes. In the event that type X is serialized with an early version of XStream that considers it _not_ to be immutable, and then later deserialized with a version of XStream that _does_ consider it to be immutable, the resulting deserialization attempt will fail, as the document will contain and xpath entry that the deserializer will not keep.
        > As a developer I want to serialize and deserialize complex models without excessive use of xpath's so that I can use xstream on large documents with little memory overhead.

        Currently XStream's use of XPaths is very selective in serialization (marshalling), but excessive in unmarshalling (deserialization). while unmarshalling documents, regardless immutability configuration, every instance will receive an xpath entry in the {{AbstractReferenceUnmarshaller}}'s xpath map.

        To complicate things, if this map is simply updated to follow the same behavior as serialization, then it would break compatibility with previous versions of xstream, as the default immutable types configuration changes. In the event that type {{X}} is serialized with an early version of XStream that considers it _not_ to be immutable, and then later deserialized with a version of XStream that _does_ consider it to be immutable, the resulting deserialization attempt will fail, as the document will contain and xpath entry that the deserializer will not keep.
        Geoff Groos made changes -
        Description > As a developer I want to serialize and deserialize complex models without excessive use of xpath's so that I can use xstream on large documents with little memory overhead.

        Currently XStream's use of XPaths is very selective in serialization (marshalling), but excessive in unmarshalling (deserialization). while unmarshalling documents, regardless immutability configuration, every instance will receive an xpath entry in the {{AbstractReferenceUnmarshaller}}'s xpath map.

        To complicate things, if this map is simply updated to follow the same behavior as serialization, then it would break compatibility with previous versions of xstream, as the default immutable types configuration changes. In the event that type {{X}} is serialized with an early version of XStream that considers it _not_ to be immutable, and then later deserialized with a version of XStream that _does_ consider it to be immutable, the resulting deserialization attempt will fail, as the document will contain and xpath entry that the deserializer will not keep.
        bq. As a developer I want to serialize and deserialize complex models without excessive use of xpath's so that I can use xstream on large documents with little memory overhead.

        Currently XStream's use of XPaths is very selective in serialization (marshalling), but excessive in unmarshalling (deserialization). while unmarshalling documents, regardless immutability configuration, every instance will receive an xpath entry in the {{AbstractReferenceUnmarshaller}}'s xpath map.

        To complicate things, if this map is simply updated to follow the same behavior as serialization, then it would break compatibility with previous versions of xstream, as the default immutable types configuration changes. In the event that type {{X}} is serialized with an early version of XStream that considers it _not_ to be immutable, and then later deserialized with a version of XStream that _does_ consider it to be immutable, the resulting deserialization attempt will fail, as the document will contain and xpath entry that the deserializer will not keep.
        Hide
        Geoff Groos added a comment -

        To give this issue a bit of punch, here is XStream using 210mb to deserialize a 10mb document:

        Show
        Geoff Groos added a comment - To give this issue a bit of punch, here is XStream using 210mb to deserialize a 10mb document:
        Geoff Groos made changes -
        Hide
        Geoff Groos added a comment -
        Show
        Geoff Groos added a comment - I started implementing some tests for this over at github: https://github.com/Groostav/XStream-GG/commits/XSTR_773_exclude_immutable_types_from_xpath_map_on_unmarshal
        Hide
        Geoff Groos added a comment -

        Created a pull request on github: https://github.com/Groostav/XStream-GG/pull/1

        Show
        Geoff Groos added a comment - Created a pull request on github: https://github.com/Groostav/XStream-GG/pull/1
        Hide
        Geoff Groos added a comment -

        I was able to deserialize a blob that was 10x larger than that with 300mb of heap space – definitely an improvement.

        Show
        Geoff Groos added a comment - I was able to deserialize a blob that was 10x larger than that with 300mb of heap space – definitely an improvement.

          People

          • Assignee:
            Jörg Schaible
            Reporter:
            Geoff Groos
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: