PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Serveur - Sécurité et techniques > linux.debian.user > Re: Slow bash script
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
linux.debian.user debian-user@lists.debian.org.

Re: Slow bash script

Réponse
 
LinkBack Outils de la discussion
Vieux 10/09/2007, 15h40   #1
Thomas Jollans
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Slow bash script

On Sunday 09 September 2007, Andrew Sackville-West wrote:
> On Sun, Sep 09, 2007 at 05:35:12PM -0400, Marty wrote:
> > Andrew Sackville-West wrote:
> >> On Sun, Sep 09, 2007 at 04:23:42PM -0400, Marty wrote:
> >>> The following script seems to run abnormally slow on a 400Mhz Sarge
> >>> system, getting only about one iteration per second in the while loop.
> >>> It extracts md5sums from a 180k Packages file and makes an indices
> >>> file. I've narrowed down the slowdown to the lines in the while loop
> >>> starting with "search=..."
> >>
> >> how have you determined this?

> >
> > I checked the output rate by outputing to stdout (instead of piping to
> > gzip after the "done" statement). I also timed it with the "time"
> > command.

>
> but, That only tells you how long it takes to iterate through the loop
> to get to the gzip command, not how much time is spent in each
> statement.
>
> smth like:
>
> while read inputline
> do echo "input line is " $inputline
> search=`grep...`
> echo "search is " $search"
> if...
> echo "we got a good search"
> fi
> ...
> done


how about ``set -x'' and let the shell do it for you ?


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
  Réponse avec citation
Vieux 10/09/2007, 18h00   #2
Andrew Sackville-West
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Slow bash script

On Mon, Sep 10, 2007 at 04:30:26PM +0200, Thomas Jollans wrote:
>
> how about ``set -x'' and let the shell do it for you ?


d'oh...

A

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFG5XcnaIeIEqwil4YRAuAeAJsGTI8qK3CcQC9KtxdwR7 d2lXfdNQCfXdY5
tG0xKyajIRG+AtP+omuYaKI=
=uX0K
-----END PGP SIGNATURE-----

  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 05h48.


Édité par : vBulletin® version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,07161 seconds with 10 queries