[
https://issues.apache.org/jira/browse/IGNITE-1963?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Igor Sapego updated IGNITE-1963:
--------------------------------
Description:
Current design of the {{InteropMemory}} class got some unavoidable overheads
and makes it difficult to implement adapter-like subclasses.
1. Considering that {{InteropMemory}} is the only class that can be used with
binary streams and binary readers/writers, it should have design that allows
writing adapter subclasses. For example, it could be std::vector class adapter
or stack-allocated array.
2. Current {{InteropUnpooledMemory}} implementation makes two heap memory
allocations during instance construction. It's a big overhead considering that
{{InteropUnpooledMemory}} instances construction happens often.
3. Consider replacing this class with two classes: read/write memory and read
only memory. It makes sense because Input streams do not modify memory they
operate on. That would allow us to implement reading in a more efficient way
because we wont be needing to implement {{Reallocate()}} method anymore.
was:
Current design of the {{InteropMemory}} class got some unavoidable overheads
and makes it difficult to implement adapter-like subclasses.
1. Considering that {{InteropMemory}} is the only class that can be used with
binary streams and binary readers/writers, it should have design that allows
writing adapter subclasses. For example, it could be std::vector class adapter
or stack-allocated array.
2. Current {{InteropUnpooledMemory}} implementation makes two heap memory
allocations during instance construction. It's a big overhead considering that
{{InteropUnpooledMemory}} instances construction happens often.
3. Consider replacing this class with two classes: read/write memory and read
only memory. It makes sense because Input streams do not modify memory they
operate on and It would allow us to implement reading in a more efficient way
because we wont be needing to implement {{Reallocate()}} method anymore.
> CPP: Optimize interop memory
> ----------------------------
>
> Key: IGNITE-1963
> URL: https://issues.apache.org/jira/browse/IGNITE-1963
> Project: Ignite
> Issue Type: Task
> Components: interop
> Affects Versions: ignite-1.4
> Reporter: Igor Sapego
> Priority: Minor
> Fix For: 1.6
>
>
> Current design of the {{InteropMemory}} class got some unavoidable overheads
> and makes it difficult to implement adapter-like subclasses.
> 1. Considering that {{InteropMemory}} is the only class that can be used with
> binary streams and binary readers/writers, it should have design that allows
> writing adapter subclasses. For example, it could be std::vector class
> adapter or stack-allocated array.
> 2. Current {{InteropUnpooledMemory}} implementation makes two heap memory
> allocations during instance construction. It's a big overhead considering
> that {{InteropUnpooledMemory}} instances construction happens often.
> 3. Consider replacing this class with two classes: read/write memory and read
> only memory. It makes sense because Input streams do not modify memory they
> operate on. That would allow us to implement reading in a more efficient way
> because we wont be needing to implement {{Reallocate()}} method anymore.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)