On Mon, Mar 12, 2018 at 11:21 PM, Christian Brabandt <cbli...@256bit.org> wrote:
>
> On So, 11 Mär 2018, Tony Mechelynck wrote:
>
>> In order to decide whether or not it is actually "a small thing" in
>> terms of executable bloat I would like to see figures: let's say the
>> size of two Huge executables for the same OS, word size (32/64) and
>> GUI, differing only in inclusion or not of the variable-tabs feature.
>> (I assume that that feature, if and when part of "standard" Vim, would
>> be "ifdeffable" at compile time, via configure on the OSes where
>> configure is used; and this means that it would routinely be
>> ifdeffed-out in Tiny builds.)
>
> Here we go:
>
> With vartabs:
> VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Mar 12 2018 23:10:47)
> Included patches: 1-1600
> Extra patches: variable tabstops
> Compiled by Christian Brabandt <c...@256bit.org>
> Huge version without GUI.  Features included (+) or not (-):
> +acl               +farsi             +mouse_sgr         -tag_any_white
> +arabic            +file_in_path      -mouse_sysmouse    -tcl
> +autocmd           +find_in_path      +mouse_urxvt       +termguicolors
> -autoservername    +float             +mouse_xterm       +terminal
> -balloon_eval      +folding           +multi_byte        +terminfo
> +balloon_eval_term -footer            +multi_lang        +termresponse
> -browse            +fork()            -mzscheme          +textobjects
> ++builtin_terms    +gettext           +netbeans_intg     +timers
> +byte_offset       -hangul_input      +num64             +title
> +channel           +iconv             +packages          -toolbar
> +cindent           +insert_expand     +path_extra        +user_commands
> +clientserver      +job               +perl              +vartabs
> +clipboard         +jumplist          +persistent_undo   +vertsplit
> +cmdline_compl     +keymap            +postscript        +virtualedit
> +cmdline_hist      +lambda            +printer           +visual
> +cmdline_info      +langmap           +profile           +visualextra
> +comments          +libcall           +python/dyn        +viminfo
> +conceal           +linebreak         +python3/dyn       +vreplace
> +cryptv            +lispindent        +quickfix          +wildignore
> +cscope            +listcmds          +reltime           +wildmenu
> +cursorbind        +localmap          +rightleft         +windows
> +cursorshape       +lua               -ruby              +writebackup
> +dialog_con        +menu              +scrollbind        +X11
> +diff              +mksession         +signs             +xfontset
> +digraphs          +modify_fname      +smartindent       -xim
> -dnd               +mouse             +startuptime       -xpm
> -ebcdic            -mouseshape        +statusline        +xsmp_interact
> +emacs_tags        +mouse_dec         -sun_workshop      +xterm_clipboard
> +eval              +mouse_gpm         +syntax            -xterm_save
> +ex_extra          -mouse_jsbterm     +tag_binary
> +extra_search      +mouse_netterm     +tag_old_static
>    system vimrc file: "$VIM/vimrc"
>      user vimrc file: "$HOME/.vimrc"
>  2nd user vimrc file: "~/.vim/vimrc"
>       user exrc file: "$HOME/.exrc"
>        defaults file: "$VIMRUNTIME/defaults.vim"
>   fall-back for $VIM: "/home/chrisbra/local/share/vim"
> Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H     -g -O2 -U_FORTIFY_SOURCE 
> -D_FORTIFY_SOURCE=1
> Linking: gcc   -Wl,-E   -L/usr/local/lib -Wl,--as-needed -o vim    -lSM -lICE 
> -lXpm -lXt -lX11 -lXdmcp -lSM -lICE  -lm -ltinfo -lnsl  -lselinux   -lacl 
> -lattr -lgpm -ldl  -L/usr/lib -llua5.2 -Wl,-E  -fstack-protector-strong 
> -L/usr/local/lib  -L/usr/lib/x86_64-linux-gnu/perl/5.26/CORE -lperl -ldl -lm 
> -lpthread -lcrypt
> ,----
> | chrisbra@debian ~/code/git/vim-src/src (git)-[vartabs]- % ls -l vim
> | -rwxr-xr-x 1 chrisbra chrisbra 12264088 Mar 12 23:10 vim
> `----
>
>
>
> Without vartabs
> ,----
> | chrisbra@debian ~/code/git/vim-src/src (git)-[vartabs]- % ls -l vim
> | -rwxr-xr-x 1 chrisbra chrisbra 12234272 Mar 12 23:11 vim
> `----
> VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Mar 12 2018 23:11:52)
> Included patches: 1-1600
> Compiled by Christian Brabandt <c...@256bit.org>
> Huge version without GUI.  Features included (+) or not (-):
> +acl               +farsi             +mouse_sgr         -tag_any_white
> +arabic            +file_in_path      -mouse_sysmouse    -tcl
> +autocmd           +find_in_path      +mouse_urxvt       +termguicolors
> -autoservername    +float             +mouse_xterm       +terminal
> -balloon_eval      +folding           +multi_byte        +terminfo
> +balloon_eval_term -footer            +multi_lang        +termresponse
> -browse            +fork()            -mzscheme          +textobjects
> ++builtin_terms    +gettext           +netbeans_intg     +timers
> +byte_offset       -hangul_input      +num64             +title
> +channel           +iconv             +packages          -toolbar
> +cindent           +insert_expand     +path_extra        +user_commands
> +clientserver      +job               +perl              +vertsplit
> +clipboard         +jumplist          +persistent_undo   +virtualedit
> +cmdline_compl     +keymap            +postscript        +visual
> +cmdline_hist      +lambda            +printer           +visualextra
> +cmdline_info      +langmap           +profile           +viminfo
> +comments          +libcall           +python/dyn        +vreplace
> +conceal           +linebreak         +python3/dyn       +wildignore
> +cryptv            +lispindent        +quickfix          +wildmenu
> +cscope            +listcmds          +reltime           +windows
> +cursorbind        +localmap          +rightleft         +writebackup
> +cursorshape       +lua               -ruby              +X11
> +dialog_con        +menu              +scrollbind        +xfontset
> +diff              +mksession         +signs             -xim
> +digraphs          +modify_fname      +smartindent       -xpm
> -dnd               +mouse             +startuptime       +xsmp_interact
> -ebcdic            -mouseshape        +statusline        +xterm_clipboard
> +emacs_tags        +mouse_dec         -sun_workshop      -xterm_save
> +eval              +mouse_gpm         +syntax
> +ex_extra          -mouse_jsbterm     +tag_binary
> +extra_search      +mouse_netterm     +tag_old_static
>    system vimrc file: "$VIM/vimrc"
>      user vimrc file: "$HOME/.vimrc"
>  2nd user vimrc file: "~/.vim/vimrc"
>       user exrc file: "$HOME/.exrc"
>        defaults file: "$VIMRUNTIME/defaults.vim"
>   fall-back for $VIM: "/home/chrisbra/local/share/vim"
> Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H     -g -O2 -U_FORTIFY_SOURCE 
> -D_FORTIFY_SOURCE=1
> Linking: gcc   -Wl,-E   -L/usr/local/lib -Wl,--as-needed -o vim    -lSM -lICE 
> -lXpm -lXt -lX11 -lXdmcp -lSM -lICE  -lm -ltinfo -lnsl  -lselinux   -lacl 
> -lattr -lgpm -ldl  -L/usr/lib -llua5.2 -Wl,-E  -fstack-protector-strong 
> -L/usr/local/lib  -L/usr/lib/x86_64-linux-gnu/perl/5.26/CORE -lperl -ldl -lm 
> -lpthread -lcrypt
>
> Not sure, why the vartabs enabled Vim is actually smaller then the
> unpatched Vim. That is certainly unexpected, I might have messed
> something up. Not sure, I really need to get some sleep now :(

Apparently you erased the first one by writing the second one over it
so you will need to recompile one or both of them to make other
comparisons on them.

"file vim", without the quotes, and after cd to the executable's
directory, will tell you some additional info (but not the file
length). For my Huge and Tiny builds respectively I get the following:

linux-2iyu:~ # ls -l `which vim`
-rwxr-xr-x 1 root root 3002624 Mar 12 23:46 /usr/local/bin/vim
linux-2iyu:~ # file `which vim`
/usr/local/bin/vim: ELF 64-bit LSB executable, x86-64, version 1
(SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2,
for GNU/Linux 3.0.0,
BuildID[sha1]=dea14a86e3957e73cf34c5b339a26683f345cb33, stripped
linux-2iyu:~ # ls -l `which vi`
-rwxr-xr-x 1 root root 863008 Mar 12 23:45 /usr/local/bin/vi
linux-2iyu:~ # file `which vi`
/usr/local/bin/vi: ELF 64-bit LSB executable, x86-64, version 1
(SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2,
for GNU/Linux 3.0.0,
BuildID[sha1]=813bdc09d8d22030e883e53ad299bdb6a8c7bd9a, stripped

or for the outputs of the linker before stripping:

linux-2iyu:~ # pushd ~/.build/vim/vim-hg/src
~/.build/vim/vim-hg/src ~
linux-2iyu:~/.build/vim/vim-hg/src # ls -l shadow-huge/vim
-rwxr-xr-x 1 root root 3335248 Mar 12 23:45 shadow-huge/vim
linux-2iyu:~/.build/vim/vim-hg/src # file shadow-huge/vim
shadow-huge/vim: ELF 64-bit LSB executable, x86-64, version 1 (SYSV),
dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for
GNU/Linux 3.0.0,
BuildID[sha1]=dea14a86e3957e73cf34c5b339a26683f345cb33, not stripped
linux-2iyu:~/.build/vim/vim-hg/src # ls -l shadow-tiny/vi
-rwxr-xr-x 1 root root 970376 Mar 12 23:45 shadow-tiny/vi
linux-2iyu:~/.build/vim/vim-hg/src # file shadow-tiny/vi
shadow-tiny/vi: ELF 64-bit LSB executable, x86-64, version 1 (SYSV),
dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for
GNU/Linux 3.0.0,
BuildID[sha1]=813bdc09d8d22030e883e53ad299bdb6a8c7bd9a, not stripped
linux-2iyu:~/.build/vim/vim-hg/src # popd
~
linux-2iyu:~ #

If one of your executables is "stripped" and the other not (but I
don't think this is the case), or if one is 32-bit and the other
64-bit (but I don't think this is the case either) it could of course
explain a size difference. Also if they were from different source
changesets (but they aren't). Otherwise I don't know. In _my_ case the
fact that "vi" (the Tiny build without GUI and with nothing I could
easily exclude) is much smaller than "vim" (the Huge build with
GTK2/Gnome GUI and several interpreted-language interfaces) is of
course expected.

>
> BTW: maintaining that patch has been becoming a PITA since several
> changes to Vim happened in the past that I need to manually reapply to
> the patch (e.g. the gui_beval.h -> beval.h rename some time ago).

IMHO this is an additional argument in favour of bringing it into the
"standard" Vim codebase, in addition to those already mentioned.

And BTW, if the code size _reduction_ is not an artefact (and, for
instance, if it applies to both "not stripped" and "stripped"
executables) then the argument that "it is a big change" may still
apply in terms of lines of code but of course not in terms of
executable bloat. Since in my experience stripping makes Vim
executables (both Huge and Tiny) smaller by something like 10% I don't
expect the code bloat, if any, to be a significant percentage of the
executable size.

>
> And I do not feel like rebasing that patch to every new Vim patch again,
> so I usually do it only once I notice that it does not apply anymore.

Something perfectly understandable. I have a few "user changes" (not
many of them) in .hgignore and src/feature.h myself and I let
Mercurial (with the fetch extension) merge them again whenever I pull
a new batch of changesets; I had only to intervene manually (because
of failure of the automatic merge) maybe twice since the Vim source
was put on a Mercurial server. Maybe I'm lucky, or maybe my changes
are "safely out of the way". But there is one caveat: having a line in
.hgignore for runtime/doc/tags requires manually deleting that file
just before pulling (fetching) a changeset which modifies it (i.e.
most of the "runtime files updates").
>
> Best,
> Christian


Best regards,
Tony.

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui