Carlos R. Mafra wrote:
>
> I have my GNUstep folder since more than 12 years now. Having a script
> checking whether it exists or not everytime I start wmaker is not
> something I would want to have. The overhead may be negligible, but
> I don't want to have one like this.
So long as there is an exec of the actual wmaker binary at the end, it
really won't be a big deal.
I decided to write up a quick proof of concept:
1) Assume three logins 3
2) A day, every day * 365.2425 [1]
3) For the next one thousand years * 1000
4) And round up the half day + .5
5) Making GNUstep is expensive, so
simulate with a five second sleep.
==> check_GNUstep <==
#!/bin/sh
if [ ! -d $HOME/GNUstep ]; then
sleep 5
fi
==> check_GNUstep.test <==
#!/bin/sh
for i in `seq 1 1095728`; do
/tmp/check_GNUstep
done
[jhriv@chao:/tmp]% time ./check_GNUstep.test
./check_GNUstep.test 3021.35s user 1674.94s system 211% cpu 36:57.68 total
Based upon a previous test[2], the 1,095,728 directory tests took only
three seconds. The rest of the time spent was spawning the shell.
I think about a half hour over the next one thousand years is enough
penalty to pay for XDM users to have a far better experience.
This test did skip the actual spawning of windowmaker, but we can assume
that if we directly call /usr/bin/wmaker or have exec /usr/bin/wmaker at
the end of a shell script takes the same (or nearly the same) amount of
time.
==> check_dir <==
#!/bin/sh
if [ ! -d $HOME/GNUstep ]; then
sleep 5
fi
exec /bin/true
==> check_dir.test <==
#!/bin/sh
for i in `seq 1 ${2-1000}`; do
${1-/bin/true}
done
Shorter tests.
I also added in Debian's wmaker wrapper script, but changed the final
exec line to exec /bin/true
TIME IN SECONDS:
n=1000 n=10000
p=/bin/true 0.713 6.788
p=check_dir 1.531 15.068
p=wmaker 1.829 17.883
Performing a quick spot check of $GNUSTEP_USER_ROOT will take about
.0011095[3] extra seconds. Well within negligible.
Arguments for wmaker wrapper:
*) Things will Just Work
Arguments against wmaker wrapper:
*) ?
-john
[1] http://en.wikipedia.org/wiki/Leap_year
[2] time sh -c 'for i in `seq 1 1095728`; do if [ ! -d $HOME/GNUstep ]; then
sleep 5; fi; done'
2.24s user 0.78s system 101% cpu 2.965 total
[3] dc -e '7 k 17.883 6.788 - 10000 / p'
--
To unsubscribe, send mail to [email protected].