Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:85715 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 50240 invoked from network); 3 Apr 2015 18:57:18 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Apr 2015 18:57:18 -0000 Authentication-Results: pb1.pair.com header.from=ircmaxell@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=ircmaxell@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.215.45 as permitted sender) X-PHP-List-Original-Sender: ircmaxell@gmail.com X-Host-Fingerprint: 209.85.215.45 mail-la0-f45.google.com Received: from [209.85.215.45] ([209.85.215.45:36446] helo=mail-la0-f45.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 4D/E2-23347-C82EE155 for ; Fri, 03 Apr 2015 13:57:17 -0500 Received: by lagv1 with SMTP id v1so8644693lag.3 for ; Fri, 03 Apr 2015 11:57:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=c0KMiA9YAvsOGZyaW4Sw3rZihbOkIJBwOHWCO9h3u78=; b=BVd1/f1I3Dk2GI5KK8WpxbT8lSFCYs6ECnmaANf7A7VirfD2/glXAxu+SsQb12pOJD gkhICbvKjuPbFtNfr4FCy7Iv388lDlhpYFJxNJdghBM0HzI+2aO+m04n2xcmPteTI/zQ cya0U011mtXooek811RFIDfkMymyiqrSfu8Z7xGbnmkvhPNjlndnSv8CXvQt3EB9GM4K JdUGTB/IVghdHINobVFpjiPSzqh2C75cV4cZ9SfdhJfoHsKmjiH0XVdl7QM9/A5KrKLO xNPin9h8dgqquQ88Rs2/SmB9JI51Jh5sRCxM5hPIcCiHFNzJIZYDAP7DwD4ntEWz4K1P 2jTA== MIME-Version: 1.0 X-Received: by 10.152.234.139 with SMTP id ue11mr3301215lac.28.1428087432250; Fri, 03 Apr 2015 11:57:12 -0700 (PDT) Received: by 10.25.144.15 with HTTP; Fri, 3 Apr 2015 11:57:12 -0700 (PDT) Date: Fri, 3 Apr 2015 14:57:12 -0400 Message-ID: To: "internals@lists.php.net" Content-Type: text/plain; charset=UTF-8 Subject: Concern around growing complexity in engine - hash table specifically From: ircmaxell@gmail.com (Anthony Ferrara) 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... Thoughts?