zsh-users
 help / color / mirror / code / Atom feed
* "embedded": tips for a small(er) zsh installation size?
       [not found] <CAHwuDSDEw6u7gcApnVXiH8jjmtdVmZcJoWSWC+_k7uw6H_gnMA@mail.gmail.com>
@ 2013-01-18 10:54 ` Francisco Borges
  2013-01-18 11:29   ` Peter Stephenson
  2013-01-18 17:14   ` Axel Beckert
  0 siblings, 2 replies; 8+ messages in thread
From: Francisco Borges @ 2013-01-18 10:54 UTC (permalink / raw)
  To: zsh-users

[-- Attachment #1: Type: text/plain, Size: 547 bytes --]

Hi,

I created zsh package for OpenWrt. So far so good. I already have an "ipk"
file that installs and runs properly in my router.

My package installs /bin/zsh and /usr/share/zsh/5.0.2/functions.

Right now I am installing all completion functions but that is an overkill.
For instance, I really do not need "Completion/AIX" for one. Is there any
simple way to turn off the installation of these?

I believe running a clever sed on "config.modules" would work, but it looks
like a hack.

Any other tips on shrinking installed size?
-- 
Francisco

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: "embedded": tips for a small(er) zsh installation size?
  2013-01-18 10:54 ` "embedded": tips for a small(er) zsh installation size? Francisco Borges
@ 2013-01-18 11:29   ` Peter Stephenson
  2013-01-18 11:53     ` Peter Stephenson
  2013-01-18 17:14   ` Axel Beckert
  1 sibling, 1 reply; 8+ messages in thread
From: Peter Stephenson @ 2013-01-18 11:29 UTC (permalink / raw)
  To: zsh-users

On Fri, 18 Jan 2013 11:54:11 +0100
Francisco Borges <francisco.borges@gmail.com> wrote:
> I created zsh package for OpenWrt. So far so good. I already have an
> "ipk" file that installs and runs properly in my router.
> 
> My package installs /bin/zsh and /usr/share/zsh/5.0.2/functions.
> 
> Right now I am installing all completion functions but that is an
> overkill. For instance, I really do not need "Completion/AIX" for
> one. Is there any simple way to turn off the installation of these?
> 
> I believe running a clever sed on "config.modules" would work, but it
> looks like a hack.

Editing config.modules is fine; it's designed for that.  Set "auto=no"
in the line you are editing and it will be kept if the file is
regenerated.

pws


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: "embedded": tips for a small(er) zsh installation size?
  2013-01-18 11:29   ` Peter Stephenson
@ 2013-01-18 11:53     ` Peter Stephenson
  2013-01-18 15:54       ` Bart Schaefer
  0 siblings, 1 reply; 8+ messages in thread
From: Peter Stephenson @ 2013-01-18 11:53 UTC (permalink / raw)
  To: zsh-users

On Fri, 18 Jan 2013 11:29:46 +0000
Peter Stephenson <p.stephenson@samsung.com> wrote:
> On Fri, 18 Jan 2013 11:54:11 +0100
> Francisco Borges <francisco.borges@gmail.com> wrote:
> > I created zsh package for OpenWrt. So far so good. I already have an
> > "ipk" file that installs and runs properly in my router.
> > 
> > My package installs /bin/zsh and /usr/share/zsh/5.0.2/functions.
> > 
> > Right now I am installing all completion functions but that is an
> > overkill. For instance, I really do not need "Completion/AIX" for
> > one. Is there any simple way to turn off the installation of these?
> > 
> > I believe running a clever sed on "config.modules" would work, but
> > it looks like a hack.
> 
> Editing config.modules is fine; it's designed for that.  Set "auto=no"
> in the line you are editing and it will be kept if the file is
> regenerated.

For completeness, however, as it says at the top of config.modules you
may need to run "make prep" to regenerate the files needed.  (I haven't
tried this, please do report any difficulties.)

pws


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: "embedded": tips for a small(er) zsh installation size?
  2013-01-18 11:53     ` Peter Stephenson
@ 2013-01-18 15:54       ` Bart Schaefer
  0 siblings, 0 replies; 8+ messages in thread
From: Bart Schaefer @ 2013-01-18 15:54 UTC (permalink / raw)
  To: zsh-users

On Jan 18, 11:53am, Peter Stephenson wrote:
}
} For completeness, however, as it says at the top of config.modules you
} may need to run "make prep" to regenerate the files needed.  (I haven't
} tried this, please do report any difficulties.)

I don't think this is actually necessary, because the "all" target has
config.modules as a dependency and "make all" will run the same commands
as "make prep".


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: "embedded": tips for a small(er) zsh installation size?
  2013-01-18 10:54 ` "embedded": tips for a small(er) zsh installation size? Francisco Borges
  2013-01-18 11:29   ` Peter Stephenson
@ 2013-01-18 17:14   ` Axel Beckert
  2013-01-18 18:00     ` Bart Schaefer
  2013-01-18 20:56     ` Francisco Borges
  1 sibling, 2 replies; 8+ messages in thread
From: Axel Beckert @ 2013-01-18 17:14 UTC (permalink / raw)
  To: zsh-users

Hi,

On Fri, Jan 18, 2013 at 11:54:11AM +0100, Francisco Borges wrote:
> I created zsh package for OpenWrt. So far so good. I already have an "ipk"
> file that installs and runs properly in my router.
> 
> My package installs /bin/zsh and /usr/share/zsh/5.0.2/functions.
> 
> Right now I am installing all completion functions but that is an overkill.
> For instance, I really do not need "Completion/AIX" for one. Is there any
> simple way to turn off the installation of these?

Nice idea.

I tried that with the Debian zsh package. Using the following sed
oneliner helped to remove stuff very likely not needed on Debian:

sed -e 's:Completion/\(AIX\|Darwin\|Solaris\|Cygwin\|Mandriva\|openSUSE\)/\*/\* ::g' -i config.modules

But the gain in free disk space inside /usr/share/zsh was just about
5% as most of the disk space is needed for Completion/Unix.

> Any other tips on shrinking installed size?

I don't know, but depending on your installation it may help to just
install the .zwc files and not the source and the .zwc files. As I
have been told on IRC, it should suffice for running zsh to have the
.zwc files instead of their source around.

Then again, in my case the Unix.zwc is bigger than the Unix directory
contents it's generated from, but I suspect a performance penalty if
you just install the source instead of the .zwc files. :-)

ncdu shows nice where the disk space is going to:

--- /usr/share/zsh/functions/Completion --------------------------------
                               /..
    3.0MiB [ 33.9% ##########]  Unix.zwc
    2.3MiB [ 26.5% #######   ] /Unix
  380.0KiB [  4.2% #         ] /Zsh
  284.0KiB [  3.1%           ] /Base
  256.0KiB [  2.8%           ] /Debian
  252.0KiB [  2.8%           ]  Base.zwc
  248.0KiB [  2.7%           ] /X
  244.0KiB [  2.7%           ]  Linux.zwc
  236.0KiB [  2.6%           ]  Debian.zwc
  220.0KiB [  2.4%           ]  Zsh.zwc
  212.0KiB [  2.3%           ]  X.zwc
  200.0KiB [  2.2%           ] /Linux
  172.0KiB [  1.9%           ]  Solaris.zwc
  164.0KiB [  1.8%           ] /Solaris
   76.0KiB [  0.8%           ]  Darwin.zwc
   76.0KiB [  0.8%           ] /BSD
   68.0KiB [  0.8%           ]  compinstall
   64.0KiB [  0.7%           ] /Darwin
   60.0KiB [  0.7%           ]  BSD.zwc
   52.0KiB [  0.6%           ] /Cygwin
   48.0KiB [  0.5%           ] /AIX
   44.0KiB [  0.5%           ]  Redhat.zwc
   36.0KiB [  0.4%           ]  Cygwin.zwc
   32.0KiB [  0.4%           ]  Mandriva.zwc
   28.0KiB [  0.3%           ] /Redhat
   28.0KiB [  0.3%           ] /openSUSE
   24.0KiB [  0.3%           ] /Mandriva
   20.0KiB [  0.2%           ]  openSUSE.zwc
   16.0KiB [  0.2%           ]  compinit
   16.0KiB [  0.2%           ]  AIX.zwc
    8.0KiB [  0.1%           ]  bashcompinit
    8.0KiB [  0.1%           ]  compaudit
    4.0KiB [  0.0%           ]  compdump

		Kind regards, Axel
-- 
/~\  Plain Text Ribbon Campaign                   | Axel Beckert
\ /  Say No to HTML in E-Mail and News            | abe@deuxchevaux.org  (Mail)
 X   See http://www.asciiribbon.org/              | abe@noone.org (Mail+Jabber)
/ \  I love long mails: http://email.is-not-s.ms/ | http://noone.org/abe/ (Web)


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: "embedded": tips for a small(er) zsh installation size?
  2013-01-18 17:14   ` Axel Beckert
@ 2013-01-18 18:00     ` Bart Schaefer
  2013-01-18 18:34       ` Axel Beckert
  2013-01-18 20:56     ` Francisco Borges
  1 sibling, 1 reply; 8+ messages in thread
From: Bart Schaefer @ 2013-01-18 18:00 UTC (permalink / raw)
  To: zsh-users

On Jan 18,  6:14pm, Axel Beckert wrote:
}
} Then again, in my case the Unix.zwc is bigger than the Unix directory
} contents it's generated from

Yeah, ZWC format isn't compressed -- it stores nearly all the raw text
as well as the "compilation" linkage so that the XTRACE option and the
functions command can continue to work.  The only thing removed is the
inconsequential whitespace.

} but I suspect a performance penalty if
} you just install the source instead of the .zwc files. :-)

The penalty probably isn't much if you aren't using very many of the
functions packed in the ZWC.  In fact if your use is sparse enough it
may actually be more expensive to compile.
 


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: "embedded": tips for a small(er) zsh installation size?
  2013-01-18 18:00     ` Bart Schaefer
@ 2013-01-18 18:34       ` Axel Beckert
  0 siblings, 0 replies; 8+ messages in thread
From: Axel Beckert @ 2013-01-18 18:34 UTC (permalink / raw)
  To: zsh-users

Hi Bart,

On Fri, Jan 18, 2013 at 10:00:20AM -0800, Bart Schaefer wrote:
> On Jan 18,  6:14pm, Axel Beckert wrote:
> } Then again, in my case the Unix.zwc is bigger than the Unix directory
> } contents it's generated from
> 
> Yeah, ZWC format isn't compressed -- it stores nearly all the raw text
> as well as the "compilation" linkage so that the XTRACE option and the
> functions command can continue to work.  The only thing removed is the
> inconsequential whitespace.

I see. Thanks for the explanation!

> } but I suspect a performance penalty if
> } you just install the source instead of the .zwc files. :-)
> 
> The penalty probably isn't much if you aren't using very many of the
> functions packed in the ZWC.  In fact if your use is sparse enough it
> may actually be more expensive to compile.

I guess that counts for just-in-time compiling as it IIRC happens for
per-user files.

At least with regards to the Debian packages: We compile the .zwc for
the completions in the source tar ball already at build time, not at
install or use time. So they're delivered precompiled in the package
anyway.

		Kind regards, Axel
-- 
/~\  Plain Text Ribbon Campaign                   | Axel Beckert
\ /  Say No to HTML in E-Mail and News            | abe@deuxchevaux.org  (Mail)
 X   See http://www.asciiribbon.org/              | abe@noone.org (Mail+Jabber)
/ \  I love long mails: http://email.is-not-s.ms/ | http://noone.org/abe/ (Web)


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: "embedded": tips for a small(er) zsh installation size?
  2013-01-18 17:14   ` Axel Beckert
  2013-01-18 18:00     ` Bart Schaefer
@ 2013-01-18 20:56     ` Francisco Borges
  1 sibling, 0 replies; 8+ messages in thread
From: Francisco Borges @ 2013-01-18 20:56 UTC (permalink / raw)
  To: zsh-users

[-- Attachment #1: Type: text/plain, Size: 770 bytes --]

Hello,

On Fri, Jan 18, 2013 at 6:14 PM, Axel Beckert <abe@deuxchevaux.org> wrote:
[...]

> sed -e
> 's:Completion/\(AIX\|Darwin\|Solaris\|Cygwin\|Mandriva\|openSUSE\)/\*/\*
> ::g' -i config.modules
>
> But the gain in free disk space inside /usr/share/zsh was just about
> 5% as most of the disk space is needed for Completion/Unix.
>

I can also delete Debian, Redhat and X ;-) then I gain about 1 MB in space.

But to be honest, in OpenWrt users are likely to be running a compressed
file system so it may not matter that much. Others (like me) will be
running the root FS on top of a USB stick and then space is not that much
of a concern.

Thanks for the ncdu tip, nice to know about it.

(BTW, thanks to everyone for all the answers!)

Kind regards,
-- 
Francisco

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-01-18 20:56 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CAHwuDSDEw6u7gcApnVXiH8jjmtdVmZcJoWSWC+_k7uw6H_gnMA@mail.gmail.com>
2013-01-18 10:54 ` "embedded": tips for a small(er) zsh installation size? Francisco Borges
2013-01-18 11:29   ` Peter Stephenson
2013-01-18 11:53     ` Peter Stephenson
2013-01-18 15:54       ` Bart Schaefer
2013-01-18 17:14   ` Axel Beckert
2013-01-18 18:00     ` Bart Schaefer
2013-01-18 18:34       ` Axel Beckert
2013-01-18 20:56     ` Francisco Borges

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).