Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:71122 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 96388 invoked from network); 14 Jan 2014 14:51:09 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Jan 2014 14:51:09 -0000 Authentication-Results: pb1.pair.com smtp.mail=julienpauli@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=julienpauli@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.214.171 as permitted sender) X-PHP-List-Original-Sender: julienpauli@gmail.com X-Host-Fingerprint: 209.85.214.171 mail-ob0-f171.google.com Received: from [209.85.214.171] ([209.85.214.171:59090] helo=mail-ob0-f171.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 80/F1-18860-BDE45D25 for ; Tue, 14 Jan 2014 09:51:08 -0500 Received: by mail-ob0-f171.google.com with SMTP id wm4so3000710obc.2 for ; Tue, 14 Jan 2014 06:51:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=E/FxIfT02YnlFcwgqdI3wba+scBMXFYgtbHTuLo6YuM=; b=z2Qa8KN8BI6oZZPvmUEiYSIHcEaGIdBLAIzR60mgKbXA8Xt5jbWe+oBcCNl66KZlNA 2VsLjfL4t6cGnhl1Ldu0/3WvyymYkmQXsESSu+zKpiuSHVvDwLQvRRqv4RzKVKqzBRO7 l7A1QQHuTf9LwqK7IEZsLc6RyxauKDckWvX3/own1r3kTYssCW+8vyYoet5Q8xPRSV0w rLRWKSbs3NlWxrl8GzsxLGIQpAdcp9BOqRKNC0LN+XjAI1YfqZv2KLOXLwyBltLK53Q3 IaStg2M3yU5UewDmT0pz7YxTWGofLZAPWFuZMn8b52j5D6OP+qM8Y2TLlLLAayjOhqtv J2qg== X-Received: by 10.60.119.70 with SMTP id ks6mr1358342oeb.45.1389711064652; Tue, 14 Jan 2014 06:51:04 -0800 (PST) MIME-Version: 1.0 Sender: julienpauli@gmail.com Received: by 10.182.235.46 with HTTP; Tue, 14 Jan 2014 06:50:24 -0800 (PST) In-Reply-To: References: Date: Tue, 14 Jan 2014 15:50:24 +0100 X-Google-Sender-Auth: Kh_xB6PjWne7WhMfsZkFqlEkrW8 Message-ID: To: Dmitry Stogov Cc: PHP Internals Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [PHP-DEV] New Memory Manager From: jpauli@php.net (Julien Pauli) On Tue, Jan 14, 2014 at 3:21 PM, Dmitry Stogov wrote: > Hi, > > Recently I took a look into jemalloc and tcmalloc internals and tried to > borrow some ideas. You may check the result at > https://github.com/dstogov/php-src/tree/xx_malloc. It's a dirty prove of > concept implementation of New Memory Manager for PHP. It was tested only on > Linux, release, non-ZTS build. It misses support for debug mode and ZTS > yet. The main advantage is small but consistent speed improvement on > real-life applications. > > I would appreciate if you bench it vs vanilla PHP-5.6 on your applications, > review the code from performance and security points of views, and come > with comments, ideas and criticism. (For example: may be someone would > suggest how to avoid check for USE_ZEND_ALLOC=0 to allow system malloc() > usage on each emalloc() call? How to reduce cost of statistics collection?) > > Currently, I'm not sure if 5% speed improvements costs the effort. > > The results of my benchmarks follow. > > Thanks. Dmitry. > > *PHP-5.6 32-bit* zend_alloc xx_malloc Improvement blog 105.6 109.7 > 3.88% drupal > 1625.0 1667.6 2.62% fw 231.6 286.4 23.66% hello 12048.4 11865.9 -1.51% qdig > 464.4 495.3 6.65% typo3 563.8 584.9 3.74% wordpress 188.9 196.8 4.19% xoops > 132.7 140.0 5.50% scrum 181.6 192.7 6.11% ZF1 Hello 1153.2 1228.4 6.52% ZF2 > Test 263.0 275.5 4.75% Great Dmitry ! We worked on something with Joe few months ago, mainly adding a new ZendMM handler which binds jemalloc(). Anyway, I'm gonna try your code and run it against several Symfony2 applications. I come back to you end of week with some results ;-) Julien