From: Ranousse <ran...@gm...> - 2012-02-24 19:14:31
|
I've just noticed that when pressing F2 to launch a terminal, notion creates 3 processes 1) sh 2) xterm 3) zsh (my default shell) In this case it would be better to have only 2) and 3). I compared this to system( "xterm" ) in C, and obtained the same number processes (three). So I guess notion uses system to launch external applications (I did not check). The problem is the same with F3 F3 xpdf => 2 processes (sh and xpdf) F3 :mutt => 3 processes (sh, xterm and mutt) When I discovered this, it surprised me a little since I already did checks like this in the past and never noticed the unnecessary sh processes. And indeed I did not have the problem in the past. A that time I used a Debian etch where sh was a linked to bash. After bash -c xpdf, you only have once process xpdf. But now (Debian squeeze) sh points to dash, and after dash -c xpdf, there are two processes (sh and xpdf). The difference seems to be that bash is able to optimize a little the number of processes in case there's only one process after the -c (adding I guess a king of exec). For information, vim which also allows to run external applications in the same ways as notion F3 key does not create the unecessary processes (even with the change for sh from bash to dash). Not sure it's very important. But maybe it could interest you. (after all it means that the number of processes of a notion user is almost multiplied by 2). |
From: Juri H. <ju...@fa...> - 2012-02-24 21:02:09
|
Hi there, On 02/24/12 at 08:13pm, Ranousse wrote: > > I've just noticed that when pressing F2 to launch a terminal, notion > creates 3 processes > 1) sh > 2) xterm > 3) zsh (my default shell) > > In this case it would be better to have only 2) and 3). > > I compared this to > system( "xterm" ) > in C, and obtained the same number processes (three). > So I guess notion uses system to launch external applications (I did not > check). > > The problem is the same with F3 > F3 xpdf => 2 processes (sh and xpdf) > F3 :mutt => 3 processes (sh, xterm and mutt) Curious, byt I can't confirm an additional sh process while starting an application over F3 without ion-runxterm (:). I also can't confirm any additional sh process if I fire up my terminal over F2: │ ├─ /usr/local/bin/notion │ │ ├─ urxvt │ │ │ └─ zsh However if starting mutt with F3 :mutt (ion-runxterm) I get an sh process. ├─ urxvt -T mutt -e /usr/local/share/notion/ion-runinxterm -phase2 mutt │ │ │ └─ /bin/sh /usr/local/share/notion/ion-runinxterm -phase2 mutt │ │ │ └─ mutt > > When I discovered this, it surprised me a little since I already did > checks like this in the past and never noticed the unnecessary sh > processes. And indeed I did not have the problem in the past. > A that time I used a Debian etch where sh was a linked to bash. > After bash -c xpdf, you only have once process xpdf. > But now (Debian squeeze) sh points to dash, and after dash -c xpdf, > there are two processes (sh and xpdf). > The difference seems to be that bash is able to optimize a little the > number of processes in case there's only one process after the -c > (adding I guess a king of exec). > > For information, vim which also allows to run external applications in > the same ways as notion F3 key does not create the unecessary processes > (even with the change for sh from bash to dash). > > Not sure it's very important. But maybe it could interest you. > (after all it means that the number of processes of a notion user is > almost multiplied by 2). > > > ------------------------------------------------------------------------------ > Virtualization & Cloud Management Using Capacity Planning > Cloud computing makes use of virtualization - but cloud computing > also focuses on allowing computing to be delivered as a service. > http://www.accelacomm.com/jaw/sfnl/114/51521223/ > _______________________________________________ > Notion-devel mailing list > Not...@li... > https://lists.sourceforge.net/lists/listinfo/notion-devel Regards -- Juri Hamburg GnuPG Key-ID: 0x67206E72 |
From: Matthieu M. <Mat...@gr...> - 2012-02-27 09:03:57
|
Juri Hamburg <ju...@fa...> writes: >> I've just noticed that when pressing F2 to launch a terminal, notion >> creates 3 processes >> 1) sh >> 2) xterm >> 3) zsh (my default shell) [...] > Curious, byt I can't confirm an additional sh process while starting > an application over F3 without ion-runxterm (:). I don't find it curious at all. If you run "firefox http://example.com", then someone has to do the word-splitting and tell that the executable "firefox" should be launched with the argument "http://example.com". If you run "foobar > some-file", then someone has to do the redirection on "some-file" If you run "foo; bar", then someone has to run foo and bar in sequence. All these features and done by a shell. Ion could optimize the simple cases by running execvp() directly when there are no special character in the command (space, pipe, semicolon, ...), but for a very little gain. -- Matthieu Moy http://www-verimag.imag.fr/~moy/ |
From: Ranousse <ran...@gm...> - 2012-02-24 23:49:33
|
On Fri, Feb 24, 2012 at 09:44, Juri Hamburg wrote: > Curious, byt I can't confirm an additional sh process while starting > an application over F3 without ion-runxterm (:). > > I also can't confirm any additional sh process if I fire up my terminal over F2: > > │ ├─ /usr/local/bin/notion > │ │ ├─ urxvt > │ │ │ └─ zsh > > > However if starting mutt with F3 :mutt (ion-runxterm) I get an sh process. > > ├─ urxvt -T mutt -e /usr/local/share/notion/ion-runinxterm -phase2 mutt > │ │ │ └─ /bin/sh /usr/local/share/notion/ion-runinxterm -phase2 mutt > │ │ │ └─ mutt Does readlink /bin/sh says dash ? If yes, does sh -c xpdf produces 2 processes (sh and xpdf) or just one (xpdf) ? |
From: Juri H. <ju...@fa...> - 2012-02-25 11:16:31
|
On 02/25/12 at 12:49am, Ranousse wrote: > On Fri, Feb 24, 2012 at 09:44, Juri Hamburg wrote: > > Curious, byt I can't confirm an additional sh process while starting > > an application over F3 without ion-runxterm (:). > > > > I also can't confirm any additional sh process if I fire up my terminal over F2: > > > > │ ├─ /usr/local/bin/notion > > │ │ ├─ urxvt > > │ │ │ └─ zsh > > > > > > However if starting mutt with F3 :mutt (ion-runxterm) I get an sh process. > > > > ├─ urxvt -T mutt -e /usr/local/share/notion/ion-runinxterm -phase2 mutt > > │ │ │ └─ /bin/sh /usr/local/share/notion/ion-runinxterm -phase2 mutt > > │ │ │ └─ mutt > > Does readlink /bin/sh says dash ? sh is a symlink to bash here. > > If yes, does > sh -c xpdf produces 2 processes (sh and xpdf) or just one (xpdf) ? hmm.. ├─ urxvt │ └─ zsh │ └─ xpdf > > > ------------------------------------------------------------------------------ > Virtualization & Cloud Management Using Capacity Planning > Cloud computing makes use of virtualization - but cloud computing > also focuses on allowing computing to be delivered as a service. > http://www.accelacomm.com/jaw/sfnl/114/51521223/ > _______________________________________________ > Notion-devel mailing list > Not...@li... > https://lists.sourceforge.net/lists/listinfo/notion-devel -- Juri Hamburg GnuPG Key-ID: 0x67206E72 |
From: Ranousse <ran...@gm...> - 2012-02-25 13:19:31
|
>> Does readlink /bin/sh says dash ? > sh is a symlink to bash here. >> If yes, does >> sh -c xpdf produces 2 processes (sh and xpdf) or just one (xpdf) ? > hmm.. > urxvt > `- zsh > `-xpdf Actually, I think I would get the same result as you in this case if I had sh pointing to bash. dash -c xpdf produces xterm `-zsh `-dash `-xpdf but bash -c xpdf produces xterm `-zsh `-xpdf That's why I said I thought bash performed a kind of optimization to reduce the number of processes while dash (default for sh on Debian and Ubuntu nowadays) did not. As I think, notion uses the system command to launch external apps, and system calls sh -c, I get a lot of unecessary processes. |