Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 6B001200C22 for ; Tue, 21 Feb 2017 09:29:43 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 697AA160B68; Tue, 21 Feb 2017 08:29:43 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 8BCA3160B3E for ; Tue, 21 Feb 2017 09:29:42 +0100 (CET) Received: (qmail 14390 invoked by uid 500); 21 Feb 2017 08:29:41 -0000 Mailing-List: contact dev-help@ignite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.apache.org Delivered-To: mailing list dev@ignite.apache.org Received: (qmail 14373 invoked by uid 99); 21 Feb 2017 08:29:41 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Feb 2017 08:29:41 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id E7B7F1A9597 for ; Tue, 21 Feb 2017 08:29:40 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 5.11 X-Spam-Level: ***** X-Spam-Status: No, score=5.11 tagged_above=-999 required=6.31 tests=[DEAR_SOMETHING=1.731, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_REPLY=1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id fg_n5-WUBd8W for ; Tue, 21 Feb 2017 08:29:38 +0000 (UTC) Received: from mail-vk0-f42.google.com (mail-vk0-f42.google.com [209.85.213.42]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 454015FBCE for ; Tue, 21 Feb 2017 08:29:38 +0000 (UTC) Received: by mail-vk0-f42.google.com with SMTP id t8so75166631vke.3 for ; Tue, 21 Feb 2017 00:29:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=gSKPXP0VkimfXW3oxR+Ur8AM4hs3RNk7AATQoWN3keY=; b=c2FuzLwzZmJFV6u8Vfa9fysU4eqPhiZWME0IWFfsEu+ww/x4jx0g3UTdrj1PdUmt2+ QQQdDEgQfILPxlIbpDK5u0epE2FnckrrBhdAtngQFN4XOmYTEiz7ewyY1VZP4qA0sEre Tf4BV3+nNngN18/J7WtsE7wmilFcWxvBi/SW1xVXJ36/9uKDy9TphO3Um1mgYvRk3RL+ rAHuO7P99qXJsVFy9lpy7BV1I1w8ut5fChBi8fBlazPDHWHEJCZZs4XkK8piBd+Pi8ie WWAAfpfPliJi/jBOdR1Mzx3J2V2X6yU9sO/v6CbMmAv7VMmHB1kaqvQj1sijw+th23cq FLng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=gSKPXP0VkimfXW3oxR+Ur8AM4hs3RNk7AATQoWN3keY=; b=dIGP3ikB8CUT+AGTxuvzFVT/rKmpozYCQESIqoUtDQQYYr/2LpekXNi2ix/5Dxv6Ag CAOEuDAFvbCnartatZ805icMHuXhsClbFa2p02gisb8z7W6UHP9Ab2uoz9RBOOoCjuYH ZRrkU0ff/bZX4tVB+/PhKOvzzlK8N/coRCsg3AjyOmct2cEgeFYX/vnAbYZGI01/fyDP MElsuJI4/sCzmc3AbwQbpNZAT8/XlI5Z9XAb4otDyGHyEK6K2/WYxGBsxm9H4FWl5UWK hnw0/4OU+IlQhM6JJJa+u0Qc8yLkWvaOrZAeyd/kER/Xp0KeeHCFO6MTnCGo1r2DeldC gw9Q== X-Gm-Message-State: AMke39ladXpTBAY6fp0dWo01fUJzcdKw4R/3QU1km30fAtx+3kNaJ+CSZzTNcfQXaksKPDdtbGva+W0oZ91ewg== X-Received: by 10.31.186.131 with SMTP id k125mr12966279vkf.147.1487665767453; Tue, 21 Feb 2017 00:29:27 -0800 (PST) MIME-Version: 1.0 Received: by 10.103.27.7 with HTTP; Tue, 21 Feb 2017 00:28:46 -0800 (PST) In-Reply-To: References: From: =?UTF-8?B?0JLQsNC00LjQvCDQntC/0L7Qu9GM0YHQutC40Lk=?= Date: Tue, 21 Feb 2017 11:28:46 +0300 Message-ID: Subject: Re: IGNITE-13 To: Valentin Kulichenko Cc: Vladimir Ozerov , dev@ignite.apache.org Content-Type: multipart/alternative; boundary=001a11440f029d20ff0549062d2f archived-at: Tue, 21 Feb 2017 08:29:43 -0000 --001a11440f029d20ff0549062d2f Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi Valentin! I compare speed of different methods how to get byte from string and push it to outputstream. Third method is the fastest. Ok, I'm creating a benchmark for BinaryWriterExImpl#doWriteString method, and making the change described in the ticket. https://issues.apache.org/jira/browse/IGNITE-13 Vadim 2017-02-21 1:06 GMT+03:00 Valentin Kulichenko : > Hi Vadim, > > I'm not sure I understand your benchmarks and how they verify the > optimization discussed here. Basically, here is what needs to be done: > > 1. Create a benchmark for BinaryWriterExImpl#doWriteString method. > 2. Run the benchmark with current implementation. > 3. Make the change described in the ticket. > 4. Run the benchmark with these changes. > 5. Compare results. > > Makes sense? Let me know if anything is unclear. > > -Val > > On Mon, Feb 20, 2017 at 8:51 AM, =D0=92=D0=B0=D0=B4=D0=B8=D0=BC =D0=9E=D0= =BF=D0=BE=D0=BB=D1=8C=D1=81=D0=BA=D0=B8=D0=B9 > wrote: > >> Hello everybody! >> >> https://issues.apache.org/jira/browse/IGNITE-13 >> >> Valentin, I just have finished benchmark (with JMH) - >> https://github.com/javaller/MyBenchmark.git >> >> It collect data about time working of serialization. >> >> For instance - https://github.com/javaller/My >> Benchmark/blob/master/out200217.txt >> >> To start it you have to do next: >> >> 1) clone it - git colne https://github.com/javaller/MyBenchmark.git >> >> 2) install it - mvn install >> >> 3) run benchmarks - java -Xms1024m -Xmx4096m -jar target\benchmarks.jar >> >> Vadim Opolski >> >> >> >> >> >> 2017-02-15 0:52 GMT+03:00 Valentin Kulichenko < >> valentin.kulichenko@gmail.com>: >> >>> Vladimir, >>> >>> I think we misunderstood each other. My understanding of this >>> optimization is the following. >>> >>> Currently string serialization is done in two steps (see >>> BinaryWriterExImpl#doWriteString): >>> >>> strArr =3D BinaryUtils.strToUtf8Bytes(val); // Encode string into byte >>> array. >>> out.writeByteArray(strArr); // Write byte array >>> into stream. >>> >>> What this ticket suggests is to write directly into stream while string >>> is encoded, without intermediate array. This both reduces memory >>> consumption and eliminates array copy step. >>> >>> I updated the ticket and added this explanation there. >>> >>> Vadim, can you create a micro benchmark and check if it gives any >>> improvement? >>> >>> -Val >>> >>> On Sun, Feb 12, 2017 at 10:38 PM, Vladimir Ozerov >>> wrote: >>> >>>> Hi, >>>> >>>> It is hard to say whether it makes sense or not. No doubt, it could >>>> speed up marshalling process at the cost of 2x memory required for str= ings. >>>> From my previous experience with marshalling micro-optimizations, we w= ill >>>> hardly ever notice speedup in distributed environment. >>>> >>>> But, there is another sied - it could speedup our queries, because we >>>> will not have to unmarshal string on every field access. So I would tr= y to >>>> make this optimization optional and then measure query performance wit= h >>>> classes having lots of strings. It could give us interesting results. >>>> >>>> On Mon, Feb 13, 2017 at 5:37 AM, Valentin Kulichenko < >>>> valentin.kulichenko@gmail.com> wrote: >>>> >>>>> Vladimir, >>>>> >>>>> Can you please take a look and provide your thoughts? Can this be >>>>> applied to binary marshaller? From what I recall, it serializes strin= g a >>>>> bit differently from optimized marshaller, so I'm not sure. >>>>> >>>>> -Val >>>>> >>>>> On Fri, Feb 10, 2017 at 5:16 PM, Dmitriy Setrakyan < >>>>> dsetrakyan@apache.org> wrote: >>>>> >>>>>> On Thu, Feb 9, 2017 at 11:26 PM, Valentin Kulichenko < >>>>>> valentin.kulichenko@gmail.com> wrote: >>>>>> >>>>>> > Hi Vadim, >>>>>> > >>>>>> > I don't think it makes much sense to invest into >>>>>> OptimizedMarshaller. >>>>>> > However, I would check if this optimization is applicable to >>>>>> > BinaryMarshaller, and if yes, implement it. >>>>>> > >>>>>> >>>>>> Val, in this case can you please update the ticket? >>>>>> >>>>>> >>>>>> > >>>>>> > -Val >>>>>> > >>>>>> > On Thu, Feb 9, 2017 at 11:05 PM, =D0=92=D0=B0=D0=B4=D0=B8=D0=BC = =D0=9E=D0=BF=D0=BE=D0=BB=D1=8C=D1=81=D0=BA=D0=B8=D0=B9 < >>>>>> vaopolskij@gmail.com> >>>>>> > wrote: >>>>>> > >>>>>> > > Dear sirs! >>>>>> > > >>>>>> > > I want to resolve issue IGNITE-13 - >>>>>> > > https://issues.apache.org/jira/browse/IGNITE-13 >>>>>> > > >>>>>> > > Is it actual? >>>>>> > > >>>>>> > > Vadim Opolski >>>>>> > > >>>>>> > >>>>>> >>>>> >>>>> >>>> >>> >> > --001a11440f029d20ff0549062d2f--