Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:87017 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 88426 invoked from network); 4 Jul 2015 20:57:34 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Jul 2015 20:57:34 -0000 Authentication-Results: pb1.pair.com smtp.mail=jpixton@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=jpixton@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.213.178 as permitted sender) X-PHP-List-Original-Sender: jpixton@gmail.com X-Host-Fingerprint: 209.85.213.178 mail-ig0-f178.google.com Received: from [209.85.213.178] ([209.85.213.178:33078] helo=mail-ig0-f178.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 86/D0-02984-DB848955 for ; Sat, 04 Jul 2015 16:57:33 -0400 Received: by igcur8 with SMTP id ur8so165208897igc.0 for ; Sat, 04 Jul 2015 13:57:30 -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=XCKjHRrbb2qvVGnnVWJEiKKcP5pJ0otGfcpKxjAOCWU=; b=edbxycVrLIwKlZR/90SHFhtPQRDlTuxPy0Zs16Kei7XEJKYxkxOgjHqiIdNNS1uqM8 gLcM8ADuyBieAwI8FKGyZHa15vuzuwgE4keqUS3Ok8uZ2TOhXBG2Q6pozagnjq5L9t4O 16Lr9VfEaM4x16MBPab0Tmngvoa7tYIc2sFOp3Q630O5wTplbhjAw3834fM83mQdrRAM ZStIlkNbY7MyQBXa8S8vxs9qJb0TZFQEUlhIR/Vv+FLivQRXKBMupIgRVNBmAX+RD9HH oxa0QElLLVNgCIhticuVvJGpYEOrjvQnDxA7UQebP+0dEvEvAfpnrAr/H1vkPHVkOWDS pGYg== MIME-Version: 1.0 X-Received: by 10.107.169.16 with SMTP id s16mr60883083ioe.74.1436043450425; Sat, 04 Jul 2015 13:57:30 -0700 (PDT) Received: by 10.107.59.4 with HTTP; Sat, 4 Jul 2015 13:57:30 -0700 (PDT) Date: Sat, 4 Jul 2015 21:57:30 +0100 Message-ID: To: internals@lists.php.net Content-Type: text/plain; charset=UTF-8 Subject: 2x speedup for hash_pbkdf2 From: jpixton@gmail.com (Joseph Birr-Pixton) Hi folks, I've just filed PR #1387: https://github.com/php/php-src/pull/1387 This moves invariant parts of the HMAC calculation out of the inner PBKDF2 loop. That means half the compression function applications are needed; performance is ~doubled as a result. A non-scientific comparison for doing 2**23 iterations with SHA1: - Python 3.4: 7.67s - OpenSSL 1.0.1f: 7.95s - PHP 5.6.10: 12.74s - PHP 5.6.10 (with this change): 6.71s Thanks, Joe