Re: [precis] Precis Java Implementation

Christian Schudt <christian.schudt@gmx.de> Mon, 21 December 2015 22:08 UTC

Return-Path: <christian.schudt@gmx.de>
X-Original-To: precis@ietfa.amsl.com
Delivered-To: precis@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 8103A1ACDCA for <precis@ietfa.amsl.com>; Mon, 21 Dec 2015 14:08:23 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2
X-Spam-Level:
X-Spam-Status: No, score=-2 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, FREEMAIL_FROM=0.001, J_CHICKENPOX_62=0.6, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001] autolearn=ham
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xMuARxxW-xzP for <precis@ietfa.amsl.com>; Mon, 21 Dec 2015 14:08:22 -0800 (PST)
Received: from mout.gmx.net (mout.gmx.net [212.227.15.18]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id B61571ACDC7 for <precis@ietf.org>; Mon, 21 Dec 2015 14:08:21 -0800 (PST)
Received: from christihudtsmbp.fritz.box ([95.117.197.21]) by mail.gmx.com (mrgmx003) with ESMTPSA (Nemesis) id 0LkOeR-1aj5rt3O5D-00cMOI; Mon, 21 Dec 2015 23:08:18 +0100
Content-Type: text/plain; charset=utf-8
Mime-Version: 1.0 (Mac OS X Mail 9.1 \(3096.5\))
From: Christian Schudt <christian.schudt@gmx.de>
In-Reply-To: <CAHbk4RLPP4LeLgM=aigNLXnbUJ0gQ+Lcsji66huFXpu5qu2fQQ@mail.gmail.com>
Date: Mon, 21 Dec 2015 23:08:17 +0100
Content-Transfer-Encoding: quoted-printable
Message-Id: <A295CC65-6A47-45DB-8539-A25E9A8361B7@gmx.de>
References: <3012FFC8-1FAD-4C30-8D85-175F4180BC02@gmx.de> <CAHbk4RLPP4LeLgM=aigNLXnbUJ0gQ+Lcsji66huFXpu5qu2fQQ@mail.gmail.com>
To: Sam Whited <sam@samwhited.com>
X-Mailer: Apple Mail (2.3096.5)
X-Provags-ID: V03:K0:9Rf85zrvf6UOuK97pw07UXnma1SH6o2itYqMkNmRuo1e8uFEGHL rrLOxsi7/LOzo6LgxbcLHG72UUcHY7P0/bXFy6SBBIjq+eB9yTuhA3jAHpL7kqCkXIpSrWh TYA8ZSQXxReeiUlyOREkFKNH6Ubm5Y5TOUNJFNNrVVmmJtQcrVMP+IjoY7f/aJxRXGjhtdN c6O4NbTjvNO8nlbG6AvoA==
X-UI-Out-Filterresults: notjunk:1;V01:K0:medsbbpjsLc=:ukd29WVH5xILryKRoWV3E6 Kw8awMdKUeTqXFzELyzdQ6kk1sxmrbuvbxiJLJOpqkovT0TblUdHHzBlqFIomXg9/Yz+/PKAK 61FtAlEwxeGF46Gh6tr5cURp6QOQ9nYeHjqHx3l+zWgSJa6h5KzCJ03r/3X5Zr/hfskapMfWl LiPZIFkaW2UHyM/2qwtq396L/+8hf53XcYEImihlku4UVHn+uKn/Ze28VBfHlWpbpb/CqPi0s angnUtAC6mkV5iq8EV3zSjgblCeKidfzYIt+wfz6BuJxRQHNcPwYcTlN3HnOwa6vTm5oSfmic mdKbXhDnD7in1x0+/l5NGnOQZHVdj5//f2hlN1p7HWhsCunc/8vkvuUbW+xmvWmQMtR/SaeLF txL6EuQyHaQ6jw6bt4927hwVJ5tfjZkgogPynU6FWcEfGdlxP/KVyINM7TvTnCc4CKtFmX6c4 RYEtJ8IpzL4dYP2MpjMg0TVp5+YZOXl8L6wTEcATUOaxcpggwaiCsBIYMarCteYNCwn7KOHb4 9uy7gfo1JPGXjdDFBXfumJJqPN5v3vvGa/lC6ADZcyvcvaNVcrG0DfxClCOfXoJ5UzgIgjh1k k7qgCbbpY9C6bxAUNH0Ge6J4FhmFSY8Dea/GaNVA6NIymgNZfEQTDRepZ8zQgebSH1J4nQ2pi l5hbR0EsAgHtSk5VXwaMMIvLTt1d2fb5HFF1xuQ/fzY1DQgDJd2dOOykXN0irW3UddRUHMIgq BS9ARTaKVxRp4Z19ULnf4r2OXX/k0Onf8A2Hmd8I2p2QXBSzroqcYtVJc8Kgn3PUEIruNSTgI Bwsacgm
Archived-At: <http://mailarchive.ietf.org/arch/msg/precis/K3jy9TeD3oUx0LZkR7wVQiY46LQ>
Cc: precis@ietf.org
Subject: Re: [precis] Precis Java Implementation
X-BeenThere: precis@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: Preparation and Comparison of Internationalized Strings <precis.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/precis>, <mailto:precis-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/precis/>
List-Post: <mailto:precis@ietf.org>
List-Help: <mailto:precis-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/precis>, <mailto:precis-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 21 Dec 2015 22:08:23 -0000


> I'm curious, what made you decide to calculate the derived properties
> on prepare instead of precomputing them? Have you done any
> benchmarking of this? I'd love to see the performance difference
> between this way and pre-computing a big trie or something of derived
> properties.

Thanks for your review and suggestion!
I am not sure what you mean by "pre-computing them“. Most of these derived properties (methods) are based on the java.lang.Character class and are similarly designed as e.g. Character.isDigit(int cp).
If you mean having a huge code point table, like in your tables.go file: I think Java already has such tables internally.
What could be improved here, is that Character.getType(cp) could only be invoked once. I haven’t done any benchmark for this, but I don’t expect a significant performance benefit.

— Christian