Re: [precis] Precis Java Implementation

Christian Schudt <> Mon, 21 December 2015 22:08 UTC

Return-Path: <>
Received: from localhost ( []) by (Postfix) with ESMTP id 8103A1ACDCA for <>; Mon, 21 Dec 2015 14:08:23 -0800 (PST)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -2
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 ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id xMuARxxW-xzP for <>; Mon, 21 Dec 2015 14:08:22 -0800 (PST)
Received: from ( []) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by (Postfix) with ESMTPS id B61571ACDC7 for <>; Mon, 21 Dec 2015 14:08:21 -0800 (PST)
Received: from ([]) by (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 <>
In-Reply-To: <>
Date: Mon, 21 Dec 2015 23:08:17 +0100
Content-Transfer-Encoding: quoted-printable
Message-Id: <>
References: <> <>
To: Sam Whited <>
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: <>
Subject: Re: [precis] Precis Java Implementation
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: Preparation and Comparison of Internationalized Strings <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-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