Return-Path: X-Original-To: apmail-fleece-dev-archive@minotaur.apache.org Delivered-To: apmail-fleece-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4457D11D98 for ; Sat, 5 Jul 2014 08:11:48 +0000 (UTC) Received: (qmail 43875 invoked by uid 500); 5 Jul 2014 08:11:48 -0000 Delivered-To: apmail-fleece-dev-archive@fleece.apache.org Received: (qmail 43858 invoked by uid 500); 5 Jul 2014 08:11:48 -0000 Mailing-List: contact dev-help@fleece.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@fleece.incubator.apache.org Delivered-To: mailing list dev@fleece.incubator.apache.org Received: (qmail 43846 invoked by uid 99); 5 Jul 2014 08:11:47 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 05 Jul 2014 08:11:47 +0000 X-ASF-Spam-Status: No, hits=-0.5 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of hendrikdev22@gmail.com designates 209.85.215.49 as permitted sender) Received: from [209.85.215.49] (HELO mail-la0-f49.google.com) (209.85.215.49) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 05 Jul 2014 08:11:43 +0000 Received: by mail-la0-f49.google.com with SMTP id gf5so1604686lab.8 for ; Sat, 05 Jul 2014 01:11:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=EMT6CofTmDpYON/+vMyIzfs8BXn80ta6Q6ya/daakRs=; b=GkPOxwTPpOHTJkHGY8aVNF7JdCvZOHkiw0S7A1hec1JHaFAvQG6dhRI1boXk+Q2UyK m/Wq2eorJoUmRcdMn6S9WGIJOqDGMVkO59nBwnxWkeovyv4t8qQsDUulVruq+5cEiWv9 5WTHz1tgZzfJTswsyuZiFM7jgD68/mtZNbCQHJ+O10imGb1HebIsQRhMB7c/kWMOaU+b 67ST7MAMklsHArY8ZlCnf6vXuKcXOi5aVFLwjGvCuXdZxc7NDQAcRa/kyoP0OxKH4qbE lO+p3+5njxgx+fROMnZ3vC5xgjDrYNu0jJdL0GhNtc4l01EuMb+l/p+MAo0dCVsLRxaj CUvg== MIME-Version: 1.0 X-Received: by 10.112.180.225 with SMTP id dr1mr11352910lbc.51.1404547882151; Sat, 05 Jul 2014 01:11:22 -0700 (PDT) Received: by 10.114.74.175 with HTTP; Sat, 5 Jul 2014 01:11:22 -0700 (PDT) In-Reply-To: References: Date: Sat, 5 Jul 2014 10:11:22 +0200 Message-ID: Subject: Re: Some suggestions for Strings.java and JsonLongImpl.java From: Hendrik Dev To: "dev@fleece.incubator.apache.org" Content-Type: text/plain; charset=UTF-8 X-Virus-Checked: Checked by ClamAV on apache.org The Strings.java JMH based benchmark i did can be found here https://github.com/salyh/fleece_tmp/tree/benchmark-streamparser/fleece-core avg_benchmark_jmh_result_f2_t16_w3_i5.txt for example shows Benchmark Mode Samples Score Score error Units o.a.f.c.j.b.BenchmarkStringsCompact.normalWithUnicode avgt 10 117411,047 6748,646 us/op o.a.f.c.j.b.BenchmarkStringsCompact.normalWithoutUnicode avgt 10 118481,121 10540,816 us/op o.a.f.c.j.b.BenchmarkStringsCompact.optimizedWithUnicode avgt 10 102078,601 7623,861 us/op o.a.f.c.j.b.BenchmarkStringsCompact.optimizedWithoutUnicode avgt 10 125038,896 8359,245 us/op There is no real improvement if i read the figures correctly. @romain: BTW what do exactly mean with "slow hashcode computation"? hashcode of what? Implementations: https://github.com/salyh/fleece_tmp/blob/benchmark-streamparser/fleece-core/src/main/java/org/apache/fleece/core/Strings_Optimized.java https://github.com/salyh/fleece_tmp/blob/benchmark-streamparser/fleece-core/src/main/java/org/apache/fleece/core/Strings.java Thanks Hendrik On Sat, Jun 28, 2014 at 11:58 PM, Romain Manni-Bucau wrote: > Ok, > > thanks a lot for the jira + patch (I know it looks too much for 1 word > but makes obvious you contributed the patch ;)). > > Waiting to read the result of your tests ;) > > > > Romain Manni-Bucau > Twitter: @rmannibucau > Blog: http://rmannibucau.wordpress.com/ > LinkedIn: http://fr.linkedin.com/in/rmannibucau > Github: https://github.com/rmannibucau > > > 2014-06-28 23:36 GMT+02:00 Hendrik Dev : >> jira issue opened >> >> regarding the figures: i have some measurements on my own and the code >> shows a slight speedup, but i will look into >> https://github.com/RichardHightower/json-parsers-benchmark >> >> On Sat, Jun 28, 2014 at 11:16 PM, Romain Manni-Bucau >> wrote: >>> second fix is ok (please open a jira and attach a patch) >>> >>> the first one need figures (I used >>> https://github.com/RichardHightower/json-parsers-benchmark ), last >>> time I tried such a thing computing hashcode was too slow. >>> >>> >>> Romain Manni-Bucau >>> Twitter: @rmannibucau >>> Blog: http://rmannibucau.wordpress.com/ >>> LinkedIn: http://fr.linkedin.com/in/rmannibucau >>> Github: https://github.com/rmannibucau >>> >>> >>> 2014-06-28 23:01 GMT+02:00 Hendrik Dev : >>>> only constants in escape() method, unicode cache, clean up of possibly >>>> unnecessary code >>>> https://github.com/salyh/fleece_tmp/commit/a8d852bc3beeddc9607af1005a2cfdde2f252230 >>>> >>>> long is integral >>>> https://github.com/salyh/fleece_tmp/commit/03dc2df406d171ded8db5199d4618786d29e5298 >>>> >>>> Thanks >>>> Hendrik -- Hendrik Saly (salyh, hendrikdev22) @hendrikdev22 PGP: 0x22D7F6EC