You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Ivan Daschinsky (Jira)" <ji...@apache.org> on 2021/04/12 07:12:00 UTC

[jira] [Commented] (IGNITE-14511) Putting bytes to cache converted to string by default.

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

Ivan Daschinsky commented on IGNITE-14511:
------------------------------------------

As a side effect, putting and getting binary objects and byte arrays or bytes become a way more effective

*bytearray befor*
{code}
------------------------------------------------------------------------------------------------ benchmark 'bytearray_get': 6 tests -----------------------------------------------------------------------------------------------
Name (time in us)                                       Min                   Max                  Mean              StdDev                Median                 IQR            Outliers         OPS            Rounds  Iterations
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
benchmark_sync_bytearray_get[simple-1024]          363.9936 (1.0)        403.9113 (1.0)        382.3829 (1.0)       12.7645 (1.03)       380.3216 (1.0)       19.0095 (1.62)          4;0  2,615.1798 (1.0)          10        1000
benchmark_sync_bytearray_get[simple-4096]          398.8775 (1.10)       442.8425 (1.10)       413.1407 (1.08)      12.4136 (1.0)        414.8340 (1.09)      11.7552 (1.0)           3;1  2,420.4827 (0.93)         10        1000
benchmark_sync_bytearray_get[simple-10240]         426.8143 (1.17)       477.6629 (1.18)       453.4785 (1.19)      16.8254 (1.36)       449.5732 (1.18)      26.5592 (2.26)          4;0  2,205.1763 (0.84)         10        1000
benchmark_sync_bytearray_get[simple-102400]        877.1394 (2.41)       936.3191 (2.32)       905.8655 (2.37)      17.0528 (1.37)       904.1946 (2.38)      22.9770 (1.95)          2;0  1,103.9167 (0.42)         10        1000
benchmark_sync_bytearray_get[simple-512000]      2,693.2290 (7.40)     2,877.7321 (7.12)     2,767.0330 (7.24)      57.8004 (4.66)     2,751.3925 (7.23)      74.3372 (6.32)          3;0    361.3979 (0.14)         10        1000
benchmark_sync_bytearray_get[simple-1048576]     5,348.8148 (14.69)    6,244.1749 (15.46)    5,625.7397 (14.71)    310.9137 (25.05)    5,469.4422 (14.38)    211.9015 (18.03)         2;2    177.7544 (0.07)         10        1000
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

------------------------------------------------------------------------------------------------ benchmark 'bytearray_put': 6 tests -----------------------------------------------------------------------------------------------
Name (time in us)                                       Min                   Max                  Mean              StdDev                Median                 IQR            Outliers         OPS            Rounds  Iterations
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
benchmark_sync_bytearray_put[simple-1024]          323.6677 (1.0)        351.4854 (1.0)        336.2562 (1.0)       10.7350 (1.0)        332.0588 (1.0)       20.2253 (1.40)          5;0  2,973.9226 (1.0)          10        1000
benchmark_sync_bytearray_put[simple-4096]          355.7405 (1.10)       400.6470 (1.14)       380.3919 (1.13)      12.4192 (1.16)       383.4460 (1.15)      14.4306 (1.0)           3;0  2,628.8680 (0.88)         10        1000
benchmark_sync_bytearray_put[simple-10240]         417.8659 (1.29)       468.3039 (1.33)       437.6813 (1.30)      14.6515 (1.36)       435.8900 (1.31)      18.8076 (1.30)          2;0  2,284.7674 (0.77)         10        1000
benchmark_sync_bytearray_put[simple-102400]        911.3239 (2.82)     1,196.0655 (3.40)       971.3909 (2.89)      83.2223 (7.75)       947.8232 (2.85)      51.1142 (3.54)          1;1  1,029.4516 (0.35)         10        1000
benchmark_sync_bytearray_put[simple-512000]      2,955.5702 (9.13)     3,117.4901 (8.87)     3,026.2937 (9.00)      67.0163 (6.24)     3,015.3415 (9.08)     132.7574 (9.20)          5;0    330.4372 (0.11)         10        1000
benchmark_sync_bytearray_put[simple-1048576]     5,400.8204 (16.69)    5,817.7921 (16.55)    5,551.0985 (16.51)    134.7372 (12.55)    5,514.5516 (16.61)    192.7049 (13.35)         3;0    180.1445 (0.06)         10        1000
--------
{code}

*bytearray after*
{code}

----------------------------------------------------------------------------------------------- benchmark 'bytearray_get': 6 tests -----------------------------------------------------------------------------------------------
Name (time in us)                                       Min                   Max                  Mean              StdDev                Median                IQR            Outliers         OPS            Rounds  Iterations
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
benchmark_sync_bytearray_get[simple-1024]          336.7489 (1.0)        374.6189 (1.0)        353.8447 (1.0)       10.1799 (1.76)       354.0342 (1.0)      10.1213 (1.76)          2;1  2,826.0989 (1.0)          10        1000
benchmark_sync_bytearray_get[simple-4096]          377.6675 (1.12)       403.8140 (1.08)       388.0702 (1.10)       8.8989 (1.54)       385.5753 (1.09)     14.6124 (2.54)          4;0  2,576.8533 (0.91)         10        1000
benchmark_sync_bytearray_get[simple-10240]         404.8328 (1.20)       424.3164 (1.13)       419.2881 (1.18)       5.7913 (1.0)        420.2480 (1.19)      5.7576 (1.0)           1;1  2,384.9951 (0.84)         10        1000
benchmark_sync_bytearray_get[simple-102400]        876.9893 (2.60)       893.7254 (2.39)       886.0853 (2.50)       6.3480 (1.10)       887.3625 (2.51)     12.9831 (2.25)          4;0  1,128.5595 (0.40)         10        1000
benchmark_sync_bytearray_get[simple-512000]      2,610.6037 (7.75)     2,973.4540 (7.94)     2,693.8506 (7.61)     109.4182 (18.89)    2,654.8949 (7.50)     78.5693 (13.65)         1;1    371.2158 (0.13)         10        1000
benchmark_sync_bytearray_get[simple-1048576]     5,348.9553 (15.88)    5,540.4025 (14.79)    5,431.8754 (15.35)     58.1692 (10.04)    5,421.8403 (15.31)    67.1182 (11.66)         4;0    184.0985 (0.07)         10        1000
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

----------------------------------------------------------------------------------------------- benchmark 'bytearray_put': 6 tests ----------------------------------------------------------------------------------------------
Name (time in us)                                       Min                   Max                  Mean             StdDev                Median                IQR            Outliers         OPS            Rounds  Iterations
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
benchmark_sync_bytearray_put[simple-1024]          302.6142 (1.0)        319.9626 (1.0)        311.4145 (1.0)       5.0262 (1.0)        312.4305 (1.0)       6.7348 (1.0)           3;0  3,211.1538 (1.0)          10        1000
benchmark_sync_bytearray_put[simple-4096]          336.5186 (1.11)       363.2279 (1.14)       345.9411 (1.11)      8.1892 (1.63)       346.2435 (1.11)     10.8882 (1.62)          2;0  2,890.6654 (0.90)         10        1000
benchmark_sync_bytearray_put[simple-10240]         353.8935 (1.17)       386.4045 (1.21)       369.7172 (1.19)     11.4046 (2.27)       369.4010 (1.18)     15.7267 (2.34)          4;0  2,704.7700 (0.84)         10        1000
benchmark_sync_bytearray_put[simple-102400]        803.0529 (2.65)       836.0773 (2.61)       820.3927 (2.63)     12.1895 (2.43)       821.9846 (2.63)     24.2182 (3.60)          5;0  1,218.9284 (0.38)         10        1000
benchmark_sync_bytearray_put[simple-512000]      2,659.7640 (8.79)     2,774.3517 (8.67)     2,718.6413 (8.73)     29.0787 (5.79)     2,718.5739 (8.70)     24.6571 (3.66)          2;2    367.8308 (0.11)         10        1000
benchmark_sync_bytearray_put[simple-1048576]     5,068.8689 (16.75)    5,316.1806 (16.62)    5,213.2583 (16.74)    77.0344 (15.33)    5,220.9278 (16.71)    80.6719 (11.98)         4;0    191.8186 (0.06)         10        1000
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

{code}

> Putting bytes to cache converted to string by default.
> ------------------------------------------------------
>
>                 Key: IGNITE-14511
>                 URL: https://issues.apache.org/jira/browse/IGNITE-14511
>             Project: Ignite
>          Issue Type: Bug
>          Components: python, thin client
>    Affects Versions: python-0.3.4
>            Reporter: Ivan Daschinsky
>            Assignee: Ivan Daschinsky
>            Priority: Major
>             Fix For: python-0.4.0
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> Currently, when you put {{b'\x01\x02}} to cache without a type hint, you
> will get string {{'\x01\x02'}}. It is very confusing. If you put {{bytes}} with 
> {{value_hint=ByteArrayObject}} you will get {{bytearray}}. As for me, it is quite
> strange to return mutable {{bytearray}} instead of {{bytes}}
> I suggest following:
> 1. By default treat {{bytes}} as {{ByteArrayObject}}
> 2. Method {{to_python}} of {{ByteArrayObject}} to {{bytes}}, not to {{bytearray}}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)