Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:96630 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 2821 invoked from network); 27 Oct 2016 19:40:07 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Oct 2016 19:40:07 -0000 Authentication-Results: pb1.pair.com header.from=ben.coutu@zeyos.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=ben.coutu@zeyos.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zeyos.com designates 89.163.237.165 as permitted sender) X-PHP-List-Original-Sender: ben.coutu@zeyos.com X-Host-Fingerprint: 89.163.237.165 mx.zeyos.com Received: from [89.163.237.165] ([89.163.237.165:34814] helo=mx.zeyos.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C4/56-46126-31852185 for ; Thu, 27 Oct 2016 15:40:07 -0400 Received: from mx.zeyos.com (localhost [127.0.0.1]) by mx.zeyos.com (Postfix) with ESMTP id 1CDFF5FAAC for ; Thu, 27 Oct 2016 21:40:01 +0200 (CEST) Authentication-Results: mx.zeyos.com (amavisd-new); dkim=pass reason="pass (just generated, assumed good)" header.d=zeyos.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=zeyos.com; h= content-transfer-encoding:content-type:content-type:mime-version :to:subject:subject:from:from:date:date; s=dkim; t=1477597200; x=1478461201; bh=nV84JvVqxp3+ZnbBINg1k1ZMcXZpTWUTCHRJGG5YIuI=; b= aVztBul8x/1engL3zz4h6ML4hUuHBfuZAl3KLgOp8rzndAq4jJ74JsoJRMetouau D0+CfonTGdsgiwYUJhTF8115nzOlxHsGJx71uoAYnYaR1b+bj5Kj9dekY+sIDAPo zc2QLRfnyXjeND7JwzdJuXmQ6gE/7PVVO1cwSoEDOUk= X-Virus-Scanned: Debian amavisd-new at mx.zeyos.com Received: from mx.zeyos.com ([127.0.0.1]) by mx.zeyos.com (mx.zeyos.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 2JuSp3WnYz9N for ; Thu, 27 Oct 2016 21:40:00 +0200 (CEST) Received: from 127.0.0.1 (srv32.dedicated.server-hosting.expert [89.163.135.32]) by mx.zeyos.com (Postfix) with ESMTPSA id 81B5F5FAA8; Thu, 27 Oct 2016 21:40:00 +0200 (CEST) Date: Thu, 27 Oct 2016 21:40:00 +0200 To: Lauri =?UTF-8?Q?Kentt=C3=A4?= Cc: PHP Internals , Dmitry Stogov , Nikita Popov , Xinchen Hui MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Message-ID: <20161027194001.1CDFF5FAAC@mx.zeyos.com> Subject: Re: [PHP-DEV] Directly embed small strings in zvals From: ben.coutu@zeyos.com (Benjamin Coutu) Ouch, forgot my powers of two there during a weak moment - what a careless = mistake. Sorry about that!=0A=0AGiven the low entropy I highly doubt this t= o be of much benefit.=0A=0A=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Original =3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=0AFrom: Lauri Kentt=C3=A4 = =0ATo: Benjamin Coutu =0ADate: Thu, 27 Oct 2016 17:12:= 15 +0200=0ASubject: Re: [PHP-DEV] Directly embed small strings in zvals=0A= =0A>=20 >=20 > 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 =3D 28 characters in those > > available 7-bytes plus 1 byte (minus pointer tag bit) for the length. >=20 > That's wrong. 256 =3D 2**8, and 64 =3D 2**6, so you get 8/6*7 =3D 9 chars= . > Not really better than 7 chars, especially considering that all > operations on single characters would be slower than usual. >