From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22810 invoked by alias); 28 Oct 2015 09:50:08 -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: 36998 Received: (qmail 1650 invoked from network); 28 Oct 2015 09:50:07 -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:from:date:message-id:subject:to:content-type; bh=JS/jY28lpwpZd9t9ApwRZz2fsEOeM616H0y5XXKHrIM=; b=rfGz342lSX1+6L7jr1dA9UBMCP3yDbzhE4RnMXJdvr4Gudbqo5XfSCM2E4L3NpWhS2 RS37Qs7Sj/vpgiSqB/ogQB4oSLY2brplPpZpI2SWhOwTtw6EMnDCGBtFGKXRtCBnn1OU JrkSayCFu+Ez5dtdU0fCrTdahekTLXhYUzTWuOPcOnFeaL2COgvZU1usLkDdZbJrGa47 uu9LrZjfaFEM/NrH4KG65Qk86ryUnIhvlIkcw/L7DjR6DHevSZ32cKVcNJK6n/UKT/Vt 9q7GASZ88iPf2XqbzgiO5hMb3zh2nNkryxCp8BTKHzUMMscm3JUmVvfDiynqDeGjasOx g1sA== X-Received: by 10.112.63.67 with SMTP id e3mr22670243lbs.92.1446025800764; Wed, 28 Oct 2015 02:50:00 -0700 (PDT) MIME-Version: 1.0 From: Sebastian Gniazdowski Date: Wed, 28 Oct 2015 10:49:41 +0100 Message-ID: Subject: mmap on OS X To: Zsh hackers list Content-Type: text/plain; charset=UTF-8 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