Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:85747 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 65567 invoked from network); 8 Apr 2015 20:55:30 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Apr 2015 20:55:30 -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 209.85.216.45 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 209.85.216.45 mail-vn0-f45.google.com Received: from [209.85.216.45] ([209.85.216.45:43299] helo=mail-vn0-f45.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F7/C2-40877-1C595255 for ; Wed, 08 Apr 2015 16:55:29 -0400 Received: by vnbg7 with SMTP id g7so16933018vnb.10 for ; Wed, 08 Apr 2015 13:55:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=x+7hcWxRLh/2tOZ9wiy5kUeiVJ9ozehySfg3WLkWNVs=; b=KqWstdxiQ5p5NiaMKrdu8SwwjVwHYEZMDurxYTJ8lch5fsAz9EMhK5K6Vj+TlnHV8c beJxqEnURi/OM25xPQA+H1Rix7llsS6+pvdBMJVnFTlXIvtvLchMrySRoLVzb7XAnGog mdiP/M4Ne8sr0CSK++bgY59V2Cgpj904O4ypu7mSegT8Af/q0JSPh3KiCrHCPF4gJPox v7CRhr702Zv+0kqWGbaviuBcMZqlip2kxpOjYiPudGiy+4FLSLsFlqpyDPDn9kfKdcBv FORlikrqrS6i5fPuFREzfJ8ZbToWPKqz3MSx7VHbnaEcsU2HK5ywm+Q0ERafvIYNd/Tj 81GA== X-Gm-Message-State: ALoCoQn0Uh4FTVRWbNysP9ubfIOO07K7uLx0tZJkILy19QukdXM739E+G5K5FCSFV/L7tKpqvB0VSiJCaU6pIgId9zxEuS6TkFWCiBEFnojQ0DGtvzHFKayTlb1TBMIg8NadsbhZkpy8TLKlrkU6UywhmKh0ELLHLw== MIME-Version: 1.0 X-Received: by 10.52.78.35 with SMTP id y3mr20574574vdw.5.1428526526803; Wed, 08 Apr 2015 13:55:26 -0700 (PDT) Received: by 10.52.248.36 with HTTP; Wed, 8 Apr 2015 13:55:26 -0700 (PDT) In-Reply-To: References: Date: Wed, 8 Apr 2015 23:55:26 +0300 Message-ID: To: Anthony Ferrara Cc: "internals@lists.php.net" Content-Type: multipart/alternative; boundary=001a113403822ecc4d05133cc080 Subject: Re: [PHP-DEV] Concern around growing complexity in engine - hash table specifically From: dmitry@zend.com (Dmitry Stogov) --001a113403822ecc4d05133cc080 Content-Type: text/plain; charset=UTF-8 On Fri, Apr 3, 2015 at 9:57 PM, Anthony Ferrara wrote: > All, > > I spent a little bit of time today trying to debug an issue with 7 > that Drupal 8 was facing, specifically regarding an array index not > behaving correctly ($array["key"] returned null, even though the key > existed in the hash table). > > I noticed that the hash table implementation has gotten orders of > magnitude more complex in recent times (since phpng was merged). > > Specifically, that ardata and arhash are now the same block of memory, > and that we're now doing negative indexing into arData to get the hash > map list. From Dmitry's commit message, it was done to keep the data > that's accessed most often in the same CPU cache line. While I am sure > that there are definitive performance gains to doing this, I do worry > about the development and debugging costs of this added complexity. > > As well as the way it increases the busfactor of the project. > > There is definitely a tradeoff there, as the change is pretty well > encapsulated behind macros. But that introduces a new level of > abstraction. But deeper than that it really makes debugging with gdb a > pain in the neck. > > Without hard data on this particular patch, I'm not suggesting we roll > back the change or anything. I more just want to express concern with > the trend lately to increase complexity significantly on developers > for the sake of performance. > > While I'm definitely not saying performance doesn't matter, I also > think performance at all costs is dangerous. And I wonder if some of > the more fundamental (even if isolated) changes such as this should be > way more documented and include the performance justification for > them. I'm definitely not suggesting an RFC, but perhaps some level of > discussion should be required for these sorts of changes... > The idea was described months ago, then implemented part by part. https://www.mail-archive.com/internals@lists.php.net/msg72362.html Thanks. Dmitry. > > Thoughts? > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --001a113403822ecc4d05133cc080--