Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:96629 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 91813 invoked from network); 27 Oct 2016 15:12:33 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Oct 2016 15:12:33 -0000 Authentication-Results: pb1.pair.com header.from=lauri.kentta@gmail.com; sender-id=softfail Authentication-Results: pb1.pair.com smtp.mail=lauri.kentta@gmail.com; spf=softfail; sender-id=softfail Received-SPF: softfail (pb1.pair.com: domain gmail.com does not designate 188.117.41.47 as permitted sender) X-PHP-List-Original-Sender: lauri.kentta@gmail.com X-Host-Fingerprint: 188.117.41.47 mailgateway.locotech.fi Linux 2.6 Received: from [188.117.41.47] ([188.117.41.47:34185] helo=mailgateway.locotech.fi) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 37/55-46126-F5912185 for ; Thu, 27 Oct 2016 11:12:31 -0400 Received: from localhost (mailgateway [127.0.0.1]) by mailgateway.locotech.fi (Postfix) with ESMTP id 6F779A35D49; Thu, 27 Oct 2016 18:12:28 +0300 (EEST) X-Virus-Scanned: amavisd-new at locotech.fi X-Spam-Flag: NO X-Spam-Score: -1.998 X-Spam-Level: X-Spam-Status: No, score=-1.998 tagged_above=-9998 required=5 tests=[ALL_TRUSTED=-1, BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001, FREEMAIL_FROM=0.001, NML_ADSP_CUSTOM_MED=0.9] autolearn=no autolearn_force=no Received: from mailgateway.locotech.fi ([127.0.0.1]) by localhost (mailgateway.locotech.fi [127.0.0.1]) (amavisd-new, port 10024) with LMTP id fTRKJ_Mc9b7S; Thu, 27 Oct 2016 18:12:16 +0300 (EEST) Received: from posti.fimnet.fi (posti.fimnet.fi [172.16.1.44]) by mailgateway.locotech.fi (Postfix) with ESMTP id EE9E0A35F7E; Thu, 27 Oct 2016 18:12:15 +0300 (EEST) Received: from k-piste.dy.fi (unknown [172.16.1.39]) by posti.fimnet.fi (Postfix) with ESMTPSA id C732710199E; Thu, 27 Oct 2016 18:12:15 +0300 (EEST) Received: from localhost.localdomain ([::1] helo=k-piste.dy.fi) by k-piste.dy.fi with esmtp (Exim 4.87) (envelope-from ) id 1bzmLn-0000Jn-HH; Thu, 27 Oct 2016 18:12:15 +0300 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Date: Thu, 27 Oct 2016 18:12:15 +0300 To: Benjamin Coutu Cc: PHP Internals , Dmitry Stogov , Nikita Popov , Xinchen Hui In-Reply-To: <20161027150201.8557A5FAAC@mx.zeyos.com> References: <20161027150201.8557A5FAAC@mx.zeyos.com> Message-ID: X-Sender: lauri.kentta@gmail.com User-Agent: Roundcube Webmail/1.2.2 Subject: Re: [PHP-DEV] Directly embed small strings in zvals From: lauri.kentta@gmail.com (=?UTF-8?Q?Lauri_Kentt=C3=A4?=) On 2016-10-27 18:02, Benjamin Coutu wrote: > Limiting ourselves to these common 64 characters ([a-zA-Z0-9_.]) would > allow us to effectively store (256 / 64) * 7 = 28 characters in those > available 7-bytes plus 1 byte (minus pointer tag bit) for the length. That's wrong. 256 = 2**8, and 64 = 2**6, so you get 8/6*7 = 9 chars. Not really better than 7 chars, especially considering that all operations on single characters would be slower than usual. -- Lauri Kenttä