Return-Path: X-Original-To: apmail-directory-dev-archive@www.apache.org Delivered-To: apmail-directory-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2A24210641 for ; Thu, 22 Aug 2013 09:44:10 +0000 (UTC) Received: (qmail 1730 invoked by uid 500); 22 Aug 2013 09:44:06 -0000 Delivered-To: apmail-directory-dev-archive@directory.apache.org Received: (qmail 1701 invoked by uid 500); 22 Aug 2013 09:44:06 -0000 Mailing-List: contact dev-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Apache Directory Developers List" Delivered-To: mailing list dev@directory.apache.org Received: (qmail 1694 invoked by uid 99); 22 Aug 2013 09:44:05 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 Aug 2013 09:44:05 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of elecharny@gmail.com designates 74.125.83.47 as permitted sender) Received: from [74.125.83.47] (HELO mail-ee0-f47.google.com) (74.125.83.47) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 Aug 2013 09:43:57 +0000 Received: by mail-ee0-f47.google.com with SMTP id d49so775708eek.20 for ; Thu, 22 Aug 2013 02:43:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=6c78bi3Bo8YQn2+hVnk3iafXDNQz68j0hUVXx3KXcLg=; b=P8fWYca+9845ZZB3kDLSfswrNW3sx4KPuU8CvLfailAF5zOHPiap2+7c/2EocfLon/ fO7HsKz0qfPDuD7i0cDPG4cPOeDmB2UkFVYJkodRHLr4p19I9Em7zcnrm8lFoFjLbbuS 07AvfXtRHjsxcybPlLoJgAdWFJ37XcSfcCizIRbrW35f7Dcadw3qHx/RXy2fyBQ2KqPv YPqn44iu5eaXVjYsjwC+PtHHRtjloe6ZF1xY7PcTw7k8zS6sNITtoltRNKlx97Z1yQx4 zHYX4WUyXDccBie8onJqeVfZC+DIg7howo6tmVAglt23MvU5cTAg2NdnA1ZZU0JhSQ3k Y7Nw== X-Received: by 10.14.211.134 with SMTP id w6mr1069511eeo.68.1377164617361; Thu, 22 Aug 2013 02:43:37 -0700 (PDT) Received: from Emmanuels-MacBook-Pro.local (lon92-10-78-226-4-211.fbx.proxad.net. [78.226.4.211]) by mx.google.com with ESMTPSA id bn13sm16232324eeb.11.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 22 Aug 2013 02:43:36 -0700 (PDT) Message-ID: <5215DD47.5070806@gmail.com> Date: Thu, 22 Aug 2013 11:43:35 +0200 From: =?UTF-8?B?RW1tYW51ZWwgTMOpY2hhcm55?= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 MIME-Version: 1.0 To: Apache Directory Developers List Subject: Re: Strig vs Byte[] for values in the server : some new ideas References: <5215D936.5080105@gmail.com> In-Reply-To: X-Enigmail-Version: 1.5.2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org Le 8/22/13 11:32 AM, Kiran Ayyagari a écrit : > On Thu, Aug 22, 2013 at 2:56 PM, Emmanuel Lécharny wrote: > >> Making the UpValue a byte[] will save us a lot of wasted CPU, and >> probably a bit of space on disk, as a String requires 2 bytes per char >> to be serialized. even the byte[] will be of same size, I don't see where the gain is am I missing something? String are encoded using char[], and a char is 2 bytes. a UTF-8 encoded String will encode the chars on 1 to 6 bytes (well, 1 to 3 in real waorld), and for any char below 0x7F will be encoded as 1 byte. -- Regards, Cordialement, Emmanuel Lécharny www.iktek.com