Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:99059 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 45344 invoked from network); 16 May 2017 11:47:42 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 May 2017 11:47:42 -0000 Authentication-Results: pb1.pair.com smtp.mail=dmitry@zend.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=dmitry@zend.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 104.47.33.100 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 104.47.33.100 mail-bn3nam01on0100.outbound.protection.outlook.com Received: from [104.47.33.100] ([104.47.33.100:31568] helo=NAM01-BN3-obe.outbound.protection.outlook.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 4D/F2-15531-AD6EA195 for ; Tue, 16 May 2017 07:47:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=RWSoftware.onmicrosoft.com; s=selector1-zend-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=UiWEwGgD3honDCrWIExFo7UFbekPKvKrNmiloGdRJRc=; b=dJVVLNHniF9VbEJa1TjzcRk1C3fpBGh2H9ZQ4BcZtT87dHxSW9RV6VkTNczHl7Mss0+pzDULaT+lRAogJzpyYKclJ67d4wEAK3/dMybtg07nO2Mo1ZCFcqf3BbgELC8I9Re5NEHniNCS5K2lUqmwrZZZxIv/aoBjzUMYxaeF0Do= Received: from MWHPR02MB2477.namprd02.prod.outlook.com (10.168.204.147) by MWHPR02MB2479.namprd02.prod.outlook.com (10.168.204.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1084.16; Tue, 16 May 2017 11:47:34 +0000 Received: from MWHPR02MB2477.namprd02.prod.outlook.com ([10.168.204.147]) by MWHPR02MB2477.namprd02.prod.outlook.com ([10.168.204.147]) with mapi id 15.01.1084.029; Tue, 16 May 2017 11:47:34 +0000 To: Pawel Por , "internals@lists.php.net" Thread-Topic: [PHP-DEV] Hashtable collision resolution in PHP 7 Thread-Index: AQHSzikzhCZ1IAhxEkOVNioZDJNLT6H21v79 Date: Tue, 16 May 2017 11:47:34 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=none action=none header.from=zend.com; x-originating-ip: [25.173.117.4] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;MWHPR02MB2479;7:Szp5r9stWqa+tH4rO7GfSEqV7jTuNHWELeHq6zYbr0Sv8u6dcROz0+MfLv6+9cLodg3Bm+R/p92NYI3zBRnuQLc10hFSBSbagBO+kJ2rBFrJctegFpHyqmA3MZbwfQU2vF4l7wHejmpPIA8cinf0MW3yf3s6PGabNwVlGZ51Uc5sMFLLZJTtTczxIukvAlTxNd3+2rzUpNpBBQ69ZNJlzaC+Eb0lq5BOGZb4+vMfCag0h8Vh9yXOkzPmc5HBdff0LY59z1ixdretL1bFHCFMzs0WwDHZ7IxSmCVxITmh5HScI4QWw7x9w8vRrt0gywAGkUHgmXeylA6DzGYIkrnVgw== x-ms-office365-filtering-correlation-id: be14df7e-c358-4e81-a1b2-08d49c51580b x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(2017030254075)(201703131423075)(201703031133081);SRVR:MWHPR02MB2479; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(158342451672863)(23657631684272); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040450)(601004)(2401047)(8121501046)(5005006)(10201501046)(93006095)(93001095)(3002001)(6041248)(20161123558100)(20161123555025)(20161123560025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(6072148);SRVR:MWHPR02MB2479;BCL:0;PCL:0;RULEID:;SRVR:MWHPR02MB2479; x-forefront-prvs: 03094A4065 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(39840400002)(39450400003)(39410400002)(39400400002)(377454003)(7906003)(74316002)(5660300001)(2950100002)(7696004)(8936002)(76176999)(54356999)(50986999)(122556002)(6436002)(86362001)(606005)(2501003)(3846002)(77096006)(6506006)(102836003)(6116002)(16799955002)(39060400002)(53936002)(6246003)(2906002)(38730400002)(15188155005)(66066001)(25786009)(53546009)(81166006)(2900100001)(9686003)(7736002)(229853002)(8676002)(33656002)(478600001)(55016002)(3660700001)(99286003)(6306002)(189998001)(236005)(3280700002)(54896002)(966005)(556834004);DIR:OUT;SFP:1102;SCL:1;SRVR:MWHPR02MB2479;H:MWHPR02MB2477.namprd02.prod.outlook.com;FPR:;SPF:None;MLV:ovrnspm;PTR:InfoNoRecords;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: multipart/alternative; boundary="_000_MWHPR02MB24779815821103F0FFB965A5BFE60MWHPR02MB2477namp_" MIME-Version: 1.0 X-OriginatorOrg: zend.com X-MS-Exchange-CrossTenant-originalarrivaltime: 16 May 2017 11:47:34.7512 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 32210298-c08b-4829-8097-6b12c025a892 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR02MB2479 Subject: Re: [PHP-DEV] Hashtable collision resolution in PHP 7 From: dmitry@zend.com (Dmitry Stogov) --_000_MWHPR02MB24779815821103F0FFB965A5BFE60MWHPR02MB2477namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable PHP 7 still uses a kind of linked list for collision resolution (trough zva= l.u2.next) and this is still an expensive operation. ________________________________ From: Pawel Por Sent: Tuesday, May 16, 2017 12:28:36 PM To: internals@lists.php.net Subject: [PHP-DEV] Hashtable collision resolution in PHP 7 Hi I'm trying to understand why PHP 7 hashtables are more efficient than PHP 5 hashtables. I'm confused about hashes that are in collision. In PHP 5 there were a linked lists to resolve collisions. What about PHP 7 ? Are there still linked lists ? I read somewhere that the solution taken in PHP 7 is L1 cache friendly so I conclude PHP 7 cannot resolve collisions using linked lists but rather arrays. If so please write me where the buckets that are in collision are stored in memory I mean by what field the array is pointed to by (e.g. zval.u2.next) and a few words of high level design of how it is implemented. thanks for help -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php --_000_MWHPR02MB24779815821103F0FFB965A5BFE60MWHPR02MB2477namp_--