From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20129 invoked by alias); 28 Oct 2015 10:02:29 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 36999 Received: (qmail 28238 invoked from network); 28 Oct 2015 10:02:28 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=K8gOiTUbWarbBNi04q82njo9Z1ZeCdzRY4LzbEoAi2g=; b=ZlPkYG7Q9jfWEa2EVdPYSCD77aKRwQY9ckkkvbYky8OCLO9vAtrd5fr88DBuAnphIh joTbTyUjYHZmzeAxwFzlUiLRa4YmDTn9Nkc1vMJ9eRhA9xTz9NDG9azMqbPt6XuyBXpC llgYgMKzhpB3vVenvMH11SayCT10Km8STwZxdqlpzTNR1afgAxYhjRe8bRs9X3FH6Ijz Dbd9lybRYXDo+6Gp5q7aeHRFds1YD6ia8nsldHpDsbSm7MSqQiqm3UqD79WhVp9c8t8t /c/ZL2j1+IVAKhrD/XS62i8JsYCJJxVptsLYm00VInXMBJRM17G6DwICXS3PEms5M+CY j/QA== X-Received: by 10.112.168.138 with SMTP id zw10mr23247607lbb.12.1446026546736; Wed, 28 Oct 2015 03:02:26 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: From: Sebastian Gniazdowski Date: Wed, 28 Oct 2015 11:02:07 +0100 Message-ID: Subject: Re: mmap on OS X To: Zsh hackers list Content-Type: text/plain; charset=UTF-8 PS. The result: ... Running [zsh-first-mmap]: string_test 127042,96 Running [zsh-before-first-mmap]: string_test 75629,60 Shows that mmap is not necessarily "faster for big data". It is safer to say that in combination with recent optimizations mmap is beneficial. Best regards, Sebastian Gniazdowski On 28 October 2015 at 10:49, Sebastian Gniazdowski wrote: > Hello, > the patch 1f62d8d (34451) introduced mmap on OS X. This caused a > slowdown which I and Bart identified. Then the patch has been recently > reverted with 8934007 (36956), however before that a few optimizations > have been introduced. It turned out that they smoothed out effect of > 34451. Starting from 9f8e3e8 (36834) mmap was no longer slowing things > down. I also checked the update of 36834, which is patch 506d592 > (36943), and it's the same. > > With the patch reverted the situation is as follows: > - for small data there is no change > - for large data reverted version is slower > > So the whole thing is like this: > - OS X mmap is slower for smaller data > - recent optimizations smooth this out > - OS X mmap is faster for large data > > So by restoring mmap use we have all cases covered and full performance. > > > Results for big data (max string size 1350000): > *Running [zsh-withmmap]: string_test 57625,00 > Running [zsh-withoutmmap]: string_test 85235,24 > Running [zsh-first-mmap]: string_test 127042,96 > Running [zsh-before-first-mmap]: string_test 75629,60 > > Results for small data (max string size 225000): > Running [zsh-withmmap]: string_test 1496,85 > Running [zsh-withoutmmap]: string_test 1595,89 > **Running [zsh-first-mmap]: string_test 3790,70 > Running [zsh-before-first-mmap]: string_test 1496,02 > > It can be seen that for small data the slowdown of ** is smoothed out > in recent Zsh, while for large data mmap in recent Zsh gives speed up > (*). > > Best regards, > Sebastian Gniazdowski