PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.lang.cplus > Program Running Time
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Program Running Time

Réponse
 
LinkBack Outils de la discussion
Vieux 15/01/2008, 02h18   #1
cplusplusquestion@gmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Program Running Time

# time ./a.out test.data

the output:

real 0m49.172s
user 0m5.638s
sys 0m4.850s

Why real time and user time have big difference? I've tried to change
a code: for example disable print() function, the real time and user
time closer. How to improve the real time in a program?
  Réponse avec citation
Vieux 15/01/2008, 03h37   #2
Jerry Coffin
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Program Running Time

In article <f7db0716-0e06-4caa-95fc-284130408b44
@l32g2000hse.googlegroups.com>, cplusplusquestion@gmail.com says...
> # time ./a.out test.data
>
> the output:
>
> real 0m49.172s
> user 0m5.638s
> sys 0m4.850s
>
> Why real time and user time have big difference? I've tried to change
> a code: for example disable print() function, the real time and user
> time closer. How to improve the real time in a program?


This basically means your program is I/O bound. Without knowing more
about how that's occurring it's impossible to suggest improvements.
Sometimes, it's just the nature of that particular program (e.g. cat
will almost always be heavily I/O bound).

--
Later,
Jerry.

The universe is a figment of its own imagination.
  Réponse avec citation
Vieux 15/01/2008, 03h44   #3
jonnyothan@gmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Program Running Time

On Jan 14, 6:18 pm, cplusplusquest...@gmail.com wrote:
> # time ./a.out test.data
>
> the output:
>
> real 0m49.172s
> user 0m5.638s
> sys 0m4.850s
>
> Why real time and user time have big difference? I've tried to change
> a code: for example disable print() function, the real time and user
> time closer. How to improve the real time in a program?


http://www.google.com/search?hl=en&q...=Google+Search

The first result would probably be a good place to start.

I wouldn't do anything without a profiler though.
  Réponse avec citation
Vieux 15/01/2008, 04h41   #4
cplusplusquestion@gmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Program Running Time

On Jan 15, 1:44 pm, jonnyot...@gmail.com wrote:
> On Jan 14, 6:18 pm, cplusplusquest...@gmail.com wrote:
>
> > # time ./a.out test.data

>
> > the output:

>
> > real 0m49.172s
> > user 0m5.638s
> > sys 0m4.850s

>
> > Why real time and user time have big difference? I've tried to change
> > a code: for example disable print() function, the real time and user
> > time closer. How to improve the real time in a program?

>
> http://www.google.com/search?hl=en&q...2B%2B+code&btn...
>
> The first result would probably be a good place to start.
>
> I wouldn't do anything without a profiler though.


Thanks. It's really ful.
  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 03h53.


Édité par : vBulletin® version 3.7.3
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 ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,09829 seconds with 12 queries