From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/5670 Path: news.gmane.org!not-for-mail From: Szabolcs Nagy Newsgroups: gmane.linux.lib.musl.general Subject: Re: Non-stub gettext API functions committed, ready for testing Date: Mon, 28 Jul 2014 16:01:52 +0200 Message-ID: <20140728140151.GL10402@port70.net> References: <20140727084633.GA22355@brightrain.aerifal.cx> <53D4CF09.1050209@gmx.de> <20140727141417.GG10402@port70.net> <20140727164921.GY4038@brightrain.aerifal.cx> <20140727172308.GH10402@port70.net> <20140727173605.GZ4038@brightrain.aerifal.cx> <20140727175125.GI10402@port70.net> <20140727180041.GA4038@brightrain.aerifal.cx> <20140728101829.GJ10402@port70.net> <20140728130017.GK10402@port70.net> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1406556133 14413 80.91.229.3 (28 Jul 2014 14:02:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 28 Jul 2014 14:02:13 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-5675-gllmg-musl=m.gmane.org@lists.openwall.com Mon Jul 28 16:02:07 2014 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1XBlV7-0007qf-Hl for gllmg-musl@plane.gmane.org; Mon, 28 Jul 2014 16:02:05 +0200 Original-Received: (qmail 21543 invoked by uid 550); 28 Jul 2014 14:02:04 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 21535 invoked from network); 28 Jul 2014 14:02:04 -0000 Mail-Followup-To: musl@lists.openwall.com Content-Disposition: inline In-Reply-To: <20140728130017.GK10402@port70.net> User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:5670 Archived-At: * Szabolcs Nagy [2014-07-28 15:00:17 +0200]: > * Szabolcs Nagy [2014-07-28 12:18:30 +0200]: > > the parser and eval code is about 2k now, i can try to do it > > without a separate parsing step (my approach requires a 100-200 > > byte buffer to store the parsed expr now) > > > > attached a simpler solution without separate parsing > (code is about 1.4k now, and it is more compatible > with gnu gettext) > using a complex plural expression (arabic): "(n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 ? 4 : 5);" the runtime of my preparsed vs interpreted implementation is 0.1-0.5us vs 3us testing on a few small n.