You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Yevgeniy Ignatyev (JIRA)" <ji...@apache.org> on 2019/05/17 08:32:00 UTC

[jira] [Commented] (IGNITE-11854) Serialization of arrays of primitives in python thin client is not optimal

    [ https://issues.apache.org/jira/browse/IGNITE-11854?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16841994#comment-16841994 ] 

Yevgeniy Ignatyev commented on IGNITE-11854:
--------------------------------------------

I think the issue is related to building bytes counterpart of an array during serialization using += operation on bytes object which is immutable. This leads to throwing away previously created bytes instances, each of which grows at new iteration.

This aligns with what I observe when run the test provided here.

Quick fix - [https://github.com/YevIgn/ignite/commit/64211b2d7c9e174f0c8979cbb4f26df52b8ebcd8]

After it, the array building stops hanging on my machine.

Should I open PR?

> Serialization of arrays of primitives in python thin client is not optimal
> --------------------------------------------------------------------------
>
>                 Key: IGNITE-11854
>                 URL: https://issues.apache.org/jira/browse/IGNITE-11854
>             Project: Ignite
>          Issue Type: Bug
>          Components: thin client
>    Affects Versions: 2.7
>            Reporter: Denis Mekhanikov
>            Priority: Major
>
> The following code hangs indefinitely inside of invocation to {{my_cache.put()}}
> {code:java}
> from pyignite import Client
> arr_len = 3_000_000
> content = bytearray(arr_len)
> for i in range(arr_len):
>     content[i] = i % 256
> client = Client()
> client.connect('127.0.0.1', 10800)
> my_cache = client.get_or_create_cache('my cache')
> my_cache.put("key_bin", content){code}
> While the value is only 3MB in size. Implementation of serialization of primitive arrays seems to be quadratic in length of the array.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)