From: Sebastian Gniazdowski <psprint3@fastmail.com>
To: Bart Schaefer <schaefer@brasslantern.com>, zsh-workers@zsh.org
Subject: Re: Status of optimiza tions - can have n ative buffers
Date: Sun, 05 Mar 2017 01:32:01 -0800 [thread overview]
Message-ID: <1488706321.1960459.900808664.5940C1B0@webmail.messagingengine.com> (raw)
In-Reply-To: <170304160050.ZM28828@torch.brasslantern.com>
[-- Attachment #1: Type: text/plain, Size: 1116 bytes --]
On Sat, Mar 4, 2017, at 04:00 PM, Bart Schaefer wrote:
> Although the following might help in some cases -- (v->start < 0) can't
> be true very often or arrlen() would have shown up nearly as much as
> arrlen_le(), but maybe this shaves a few unnecessary recounts?
>
> Anyway changing from arrlen_le() to arrlen_gt() removes a couple of
> tail calls, so this might get faster, and will also reveal how many
> of those arrlen_le() are coming through here.
Time is still the same, 25 s. The zrealloc-patch that was pushed helped,
before: 37 s, after: the 25 s. Hashes are 17 s. Attached callgrind
result from with-patch current-head run:
29,965,124,064 arrlen_le [/usr/local/bin/zsh-5.3.1-dev-0_O2_bopt]
29,965,124,049 arrlen_gt [/usr/local/bin/zsh-5.3.1-dev-0_O2_bopt]
6,700,764,538 itype_end [/usr/local/bin/zsh-5.3.1-dev-0_O2_bopt]
6,668,004,434 arrlen [/usr/local/bin/zsh-5.3.1-dev-0_O2_bopt]
4,552,766,774 _platform_memmove$VARIANT$Nehalem
[/usr/lib/system/libsystem_platform.dylib]
2,677,827,871 stringsubst [/usr/local/bin/zsh-5.3.1-dev-0_O2_bopt]
--
Sebastian Gniazdowski
psprint3@fastmail.com
[-- Attachment #2: callgrind_annotate_arrlen_le.txt --]
[-- Type: text/plain, Size: 9927 bytes --]
--------------------------------------------------------------------------------
Profile data file 'callgrind.out.96783' (creator: callgrind-3.12.0)
--------------------------------------------------------------------------------
I1 cache:
D1 cache:
LL cache:
Timerange: Basic block 0 - 33571987355
Trigger: Program termination
Profiled target: zsh-5.3.1-dev-0_O2_bopt ./zmorpho (PID 96783, part 1)
Events recorded: Ir
Events shown: Ir
Event sort order: Ir
Thresholds: 99
Include dirs:
User annotated:
Auto-annotation: off
--------------------------------------------------------------------------------
Ir
--------------------------------------------------------------------------------
140,296,535,115 PROGRAM TOTALS
--------------------------------------------------------------------------------
Ir file:function
--------------------------------------------------------------------------------
29,965,124,064 ???:arrlen_le [/usr/local/bin/zsh-5.3.1-dev-0_O2_bopt]
29,965,124,049 ???:arrlen_gt [/usr/local/bin/zsh-5.3.1-dev-0_O2_bopt]
6,700,764,538 ???:itype_end [/usr/local/bin/zsh-5.3.1-dev-0_O2_bopt]
6,668,004,434 ???:arrlen [/usr/local/bin/zsh-5.3.1-dev-0_O2_bopt]
4,552,766,774 ???:_platform_memmove$VARIANT$Nehalem [/usr/lib/system/libsystem_platform.dylib]
2,677,827,871 ???:stringsubst [/usr/local/bin/zsh-5.3.1-dev-0_O2_bopt]
2,558,606,524 ???:stringsubst'2 [/usr/local/bin/zsh-5.3.1-dev-0_O2_bopt]
2,370,011,695 ???:ingetc [/usr/local/bin/zsh-5.3.1-dev-0_O2_bopt]
1,994,378,494 ???:strcpy [/usr/lib/system/libsystem_c.dylib]
1,975,384,760 ???:strtod_l [/usr/lib/system/libsystem_c.dylib]
1,871,413,725 ???:dquote_parse [/usr/local/bin/zsh-5.3.1-dev-0_O2_bopt]
1,763,948,314 ???:szone_free_definite_size [/usr/lib/system/libsystem_malloc.dylib]
1,651,427,451 ???:zhalloc [/usr/local/bin/zsh-5.3.1-dev-0_O2_bopt]
1,641,937,107 ???:_platform_strcmp [/usr/lib/system/libsystem_platform.dylib]
1,574,721,628 ???:zzlex [/usr/local/bin/zsh-5.3.1-dev-0_O2_bopt]
1,274,353,832 ???:tiny_free_list_add_ptr [/usr/lib/system/libsystem_malloc.dylib]
1,254,904,343 ???:__quorem_D2A [/usr/lib/system/libsystem_c.dylib]
1,226,489,880 ???:__multadd_D2A [/usr/lib/system/libsystem_c.dylib]
1,188,316,071 ???:strlen [/usr/lib/system/libsystem_c.dylib]
1,176,570,715 ???:tiny_malloc_from_free_list [/usr/lib/system/libsystem_malloc.dylib]
1,165,383,862 ???:untokenize [/usr/local/bin/zsh-5.3.1-dev-0_O2_bopt]
1,098,752,923 ???:lexconstant [/usr/local/bin/zsh-5.3.1-dev-0_O2_bopt]
1,069,738,177 ???:fetchvalue [/usr/local/bin/zsh-5.3.1-dev-0_O2_bopt]
983,039,508 ???:remnulargs [/usr/local/bin/zsh-5.3.1-dev-0_O2_bopt]
971,165,723 ???:szone_size [/usr/lib/system/libsystem_malloc.dylib]
965,483,295 ???:paramsubst [/usr/local/bin/zsh-5.3.1-dev-0_O2_bopt]
853,269,280 ???:getarg [/usr/local/bin/zsh-5.3.1-dev-0_O2_bopt]
816,363,124 ???:szone_malloc_should_clear [/usr/lib/system/libsystem_malloc.dylib]
792,748,080 ???:op [/usr/local/bin/zsh-5.3.1-dev-0_O2_bopt]
790,606,736 ???:hasher [/usr/local/bin/zsh-5.3.1-dev-0_O2_bopt]
771,054,754 ???:checkunary [/usr/local/bin/zsh-5.3.1-dev-0_O2_bopt]
763,084,062 ???:setlocale [/usr/lib/system/libsystem_c.dylib]
740,303,435 ???:mathparse'2 [/usr/local/bin/zsh-5.3.1-dev-0_O2_bopt]
690,597,783 ???:__Balloc_D2A [/usr/lib/system/libsystem_c.dylib]
669,049,573 ???:__mult_D2A [/usr/lib/system/libsystem_c.dylib]
645,284,640 ???:paramsubst'2 [/usr/local/bin/zsh-5.3.1-dev-0_O2_bopt]
642,438,873 ???:__lshift_D2A [/usr/lib/system/libsystem_c.dylib]
628,523,356 ???:gethashnode2 [/usr/local/bin/zsh-5.3.1-dev-0_O2_bopt]
622,923,429 ???:addvars [/usr/local/bin/zsh-5.3.1-dev-0_O2_bopt]
596,886,151 ???:__dtoa [/usr/lib/system/libsystem_c.dylib]
588,286,824 ???:__Bfree_D2A [/usr/lib/system/libsystem_c.dylib]
585,163,299 ???:loadlocale [/usr/lib/system/libsystem_c.dylib]
582,074,808 ???:mathparse [/usr/local/bin/zsh-5.3.1-dev-0_O2_bopt]
479,005,053 ???:free [/usr/lib/system/libsystem_malloc.dylib]
478,653,459 ???:getparamnode [/usr/local/bin/zsh-5.3.1-dev-0_O2_bopt]
464,179,856 ???:mathevall [/usr/local/bin/zsh-5.3.1-dev-0_O2_bopt]
457,242,648 ???:add [/usr/local/bin/zsh-5.3.1-dev-0_O2_bopt]
438,807,694 ???:getindex [/usr/local/bin/zsh-5.3.1-dev-0_O2_bopt]
427,244,753 ???:__vfprintf [/usr/lib/system/libsystem_c.dylib]
418,205,697 ???:dupstring [/usr/local/bin/zsh-5.3.1-dev-0_O2_bopt]
406,725,998 ???:fetchvalue'2 [/usr/local/bin/zsh-5.3.1-dev-0_O2_bopt]
392,086,757 ???:tiny_free_list_remove_ptr [/usr/lib/system/libsystem_malloc.dylib]
383,005,195 ???:zstrtol_underscore [/usr/local/bin/zsh-5.3.1-dev-0_O2_bopt]
380,526,825 ???:_platform_strchr$VARIANT$Generic [/usr/lib/system/libsystem_platform.dylib]
379,564,975 ???:__numeric_load_locale [/usr/lib/system/libsystem_c.dylib]
377,953,347 ???:inpoptop [/usr/local/bin/zsh-5.3.1-dev-0_O2_bopt]
316,294,171 ???:__cmp_D2A [/usr/lib/system/libsystem_c.dylib]
303,615,681 ???:hist_context_save [/usr/local/bin/zsh-5.3.1-dev-0_O2_bopt]
298,694,844 ???:malloc_zone_malloc [/usr/lib/system/libsystem_malloc.dylib]
272,071,205 ???:hist_context_restore [/usr/local/bin/zsh-5.3.1-dev-0_O2_bopt]
268,128,151 ???:parse_context_restore [/usr/local/bin/zsh-5.3.1-dev-0_O2_bopt]
263,647,209 ???:execlist'2 [/usr/local/bin/zsh-5.3.1-dev-0_O2_bopt]
260,249,562 ???:hbegin [/usr/local/bin/zsh-5.3.1-dev-0_O2_bopt]
259,535,774 ???:__vsnprintf_chk'2 [/usr/lib/system/libsystem_c.dylib]
256,465,400 ???:_platform_bzero$VARIANT$Merom [/usr/lib/system/libsystem_platform.dylib]
245,406,915 ???:getmathparam [/usr/local/bin/zsh-5.3.1-dev-0_O2_bopt]
242,868,938 ???:prefork [/usr/local/bin/zsh-5.3.1-dev-0_O2_bopt]
240,386,850 ???:prefork'2 [/usr/local/bin/zsh-5.3.1-dev-0_O2_bopt]
237,275,094 ???:__s2b_D2A [/usr/lib/system/libsystem_c.dylib]
236,583,660 ???:parse_context_save [/usr/local/bin/zsh-5.3.1-dev-0_O2_bopt]
234,598,487 ???:__vsnprintf_chk [/usr/lib/system/libsystem_c.dylib]
229,297,192 ???:__diff_D2A [/usr/lib/system/libsystem_c.dylib]
224,754,367 ???:inpush [/usr/local/bin/zsh-5.3.1-dev-0_O2_bopt]
220,048,614 ???:getstrvalue [/usr/local/bin/zsh-5.3.1-dev-0_O2_bopt]
213,354,900 ???:malloc [/usr/lib/system/libsystem_malloc.dylib]
209,424,935 ???:convbase_ptr [/usr/local/bin/zsh-5.3.1-dev-0_O2_bopt]
208,449,767 ???:zalloc [/usr/local/bin/zsh-5.3.1-dev-0_O2_bopt]
203,083,989 ???:get_tiny_free_size [/usr/lib/system/libsystem_malloc.dylib]
202,999,700 ???:dupstrpfx [/usr/local/bin/zsh-5.3.1-dev-0_O2_bopt]
199,346,429 ???:get_tiny_previous_free_msize [/usr/lib/system/libsystem_malloc.dylib]
197,153,050 ???:lex_context_save [/usr/local/bin/zsh-5.3.1-dev-0_O2_bopt]
195,301,367 ???:strncpy [/usr/lib/system/libsystem_c.dylib]
193,209,994 ???:zcontext_save_partial [/usr/local/bin/zsh-5.3.1-dev-0_O2_bopt]
190,435,519 ???:__d2b_D2A [/usr/lib/system/libsystem_c.dylib]
187,954,648 ???:getnumvalue [/usr/local/bin/zsh-5.3.1-dev-0_O2_bopt]
187,239,378 ???:arithsubst [/usr/local/bin/zsh-5.3.1-dev-0_O2_bopt]
185,323,872 ???:zcontext_restore_partial [/usr/local/bin/zsh-5.3.1-dev-0_O2_bopt]
181,385,682 ???:hend [/usr/local/bin/zsh-5.3.1-dev-0_O2_bopt]
181,077,329 ???:assignstrvalue [/usr/local/bin/zsh-5.3.1-dev-0_O2_bopt]
177,453,489 ???:inputsetline [/usr/local/bin/zsh-5.3.1-dev-0_O2_bopt]
176,615,209 ???:assignsparam [/usr/local/bin/zsh-5.3.1-dev-0_O2_bopt]
168,755,279 ???:ecgetstr [/usr/local/bin/zsh-5.3.1-dev-0_O2_bopt]
165,608,562 ???:lex_context_restore [/usr/local/bin/zsh-5.3.1-dev-0_O2_bopt]
165,163,514 ???:execsimple'2 [/usr/local/bin/zsh-5.3.1-dev-0_O2_bopt]
158,197,505 ???:__error [/usr/lib/system/libsystem_kernel.dylib]
155,426,633 ???:__sfvwrite [/usr/lib/system/libsystem_c.dylib]
154,124,892 ???:strcatsub [/usr/local/bin/zsh-5.3.1-dev-0_O2_bopt]
151,322,700 ???:__b2d_D2A [/usr/lib/system/libsystem_c.dylib]
145,111,600 ???:__pow5mult_D2A [/usr/lib/system/libsystem_c.dylib]
140,403,054 ???:parse_subscript [/usr/local/bin/zsh-5.3.1-dev-0_O2_bopt]
132,539,922 ???:zshlex_raw_add [/usr/local/bin/zsh-5.3.1-dev-0_O2_bopt]
131,795,646 ???:filesubstr [/usr/local/bin/zsh-5.3.1-dev-0_O2_bopt]
130,934,661 ???:filesub [/usr/local/bin/zsh-5.3.1-dev-0_O2_bopt]
130,475,899 ???:localeconv_l [/usr/lib/system/libsystem_c.dylib]
114,177,546 ???:watchlog_match [/usr/local/bin/zsh-5.3.1-dev-0_O2_bopt]
110,387,904 ???:pthread_getspecific [/usr/lib/system/libsystem_pthread.dylib]
106,565,100 ???:_os_lock_spin_lock [/usr/lib/system/libsystem_platform.dylib]
106,487,955 ???:inungetc [/usr/local/bin/zsh-5.3.1-dev-0_O2_bopt]
94,891,375 ???:__detect_path_locale [/usr/lib/system/libsystem_c.dylib]
90,138,378 ???:__hi0bits_D2A [/usr/lib/system/libsystem_c.dylib]
87,155,328 ???:parsestrnoerr [/usr/local/bin/zsh-5.3.1-dev-0_O2_bopt]
82,869,602 ???:matheval [/usr/local/bin/zsh-5.3.1-dev-0_O2_bopt]
80,705,915 ???:setunderscore [/usr/local/bin/zsh-5.3.1-dev-0_O2_bopt]
74,920,775 ???:zfree [/usr/local/bin/zsh-5.3.1-dev-0_O2_bopt]
70,977,006 ???:getsparam [/usr/local/bin/zsh-5.3.1-dev-0_O2_bopt]
70,975,062 ???:init_parse_status [/usr/local/bin/zsh-5.3.1-dev-0_O2_bopt]
70,653,912 ???:ugetnode [/usr/local/bin/zsh-5.3.1-dev-0_O2_bopt]
67,451,051 ???:vsprintf_l [/usr/lib/system/libsystem_c.dylib]
63,593,894 ???:isident [/usr/local/bin/zsh-5.3.1-dev-0_O2_bopt]
60,058,960 ???:convfloat [/usr/local/bin/zsh-5.3.1-dev-0_O2_bopt]
59,307,895 ???:spin_lock [/usr/lib/system/libsystem_platform.dylib]
56,113,944 ???:__ratio_D2A [/usr/lib/system/libsystem_c.dylib]
55,202,826 ???:inpop [/usr/local/bin/zsh-5.3.1-dev-0_O2_bopt]
next prev parent reply other threads:[~2017-03-05 9:32 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-04 13:49 Status of optimizations – can have native buffers Sebastian Gniazdowski
2017-03-04 15:33 ` Sebastian Gniazdowski
2017-03-05 0:00 ` Status of optimiza tions - can have n ative buffers Bart Schaefer
2017-03-05 9:32 ` Sebastian Gniazdowski [this message]
2017-03-05 16:29 ` Bart Schaefer
2017-03-13 9:01 ` Status of optimizations – can have native buffers Sebastian Gniazdowski
2017-03-13 10:51 ` Sebastian Gniazdowski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1488706321.1960459.900808664.5940C1B0@webmail.messagingengine.com \
--to=psprint3@fastmail.com \
--cc=schaefer@brasslantern.com \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).