Re: [precis] Precis Java Implementation

Sam Whited <> Wed, 23 December 2015 15:03 UTC

Return-Path: <>
Received: from localhost ( []) by (Postfix) with ESMTP id 7365D1A017E for <>; Wed, 23 Dec 2015 07:03:00 -0800 (PST)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -1.379
X-Spam-Status: No, score=-1.379 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FM_FORGED_GMAIL=0.622, SPF_PASS=-0.001] autolearn=no
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id 9yxLda4pKs00 for <>; Wed, 23 Dec 2015 07:02:59 -0800 (PST)
Received: from ( [IPv6:2607:f8b0:400d:c04::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by (Postfix) with ESMTPS id 257CF1A017F for <>; Wed, 23 Dec 2015 07:02:59 -0800 (PST)
Received: by with SMTP id 6so735907qgy.1 for <>; Wed, 23 Dec 2015 07:02:59 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=swgoo; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; bh=/8sZqEsLXJTIgLkm7VW1XSiqLcu0f3Mdx1DPo8PBBt4=; b=utYe7zt6iBZExmAUt38VEGdwFPefg2/oZ3gefW576bo3oyfdkYv8jD1X6/ZQXHfCYr 2Z+rmdH7K+90kv23oX9NMcmL1PxhuEzhHkPFMjF7POO2DiYSCojYrwEnfFZ0MfKmZ+MZ jU8r410yfbEjdNJSYgAHrBThAhROnXkKvBsUY=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type:content-transfer-encoding; bh=/8sZqEsLXJTIgLkm7VW1XSiqLcu0f3Mdx1DPo8PBBt4=; b=b/2D5P6pDQ3lg7ggXQOXYu7oa+ozVUharpy7L90UgLcmAjoIQou7hb3lYvJF45LfAS ccnbQQqxkCb+6lX1EcO095wnqLIZX+1IsCSR8V48a0D9YAFxeUC+ZxJiXdTzyXz04eT7 WCXqqf36QTJ6v1EhTEM6HHV4qe5z/4JyuKYvPQg2gOlkyPVGe5qb1ahmQPMSpnhs4APM Lq0jO+Npa6FoxoTpFdW05SOAGOTmg6SeFIRgfUS3NpsJqnUjaCz4l2/TRDvuLfM7QTJv lp5FRM34RhDyh7PCR6fpbPnauSOY31ZzGSP8CjOOXRusMTgBnSIDtHBWD6tJkU2XamoK vFXQ==
X-Gm-Message-State: ALoCoQnyq5q6fCoORk7t8l/X8hjoWDwR64hVlYN23ezPjF7XrioDzid3EOd+4M5kuOZuAgSKKplXWvE01shSapLGhj/8g3u0FQ==
X-Received: by with SMTP id f17mr43951375qhc.19.1450882978290; Wed, 23 Dec 2015 07:02:58 -0800 (PST)
MIME-Version: 1.0
Received: by with HTTP; Wed, 23 Dec 2015 07:02:18 -0800 (PST)
X-Originating-IP: []
In-Reply-To: <>
References: <> <> <> <> <>
From: Sam Whited <>
Date: Wed, 23 Dec 2015 09:02:18 -0600
Message-ID: <>
To: Christian Schudt <>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
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: Wed, 23 Dec 2015 15:03:00 -0000

On Wed, Dec 23, 2015 at 3:16 AM, Christian Schudt
<> wrote:
> If you are interested, in Java getting the character type (property) is even a bit slower, but it’s of course machine dependent:
> java.lang.Character.getType(codepoint) is constantly 39 ns/op on 300000000 iterations on my machine, no matter if it’s an ascii or a fullwidth character. (Oracle JDK 8 SE).
> Java uses huge Unicode arrays internally to lookup the code point, I doubt that there’s much room for optimization and even if, probably nobody cares when saving a few nano seconds.

Thanks! I actually am really interested; I used to do a lot of work on
Conversations (Android XMPP client) and was the one who originally
wrote the JID class / stringprep stuff for it. I'm planning on
updating it to use your library at some point, and my work roster is
rather large (several thousand people) which makes things incredibly
slow with the current stringprep implementation; I'm hoping this will
be a lot faster!

Thanks again for all your hard work on this.


Sam Whited
pub 4096R/54083AE104EA7AD3