linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* printf() overhead
@ 2005-01-09 19:25 John Richard Moser
  2005-01-09 19:41 ` Andre Tomt
  2005-01-09 20:27 ` Gene Heskett
  0 siblings, 2 replies; 6+ messages in thread
From: John Richard Moser @ 2005-01-09 19:25 UTC (permalink / raw)
  To: linux-kernel

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

using strace to run a program takes aeons.  Redirecting the output to a
file can be a hundred times faster sometimes.  This raises question.

I understand that output to the screen is I/O.  What exactly causes it
to be slow, and is there a possible way to accelerate the process?
- --
All content of all messages exchanged herein are left in the
Public Domain, unless otherwise explicitly stated.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFB4YUhhDd4aOud5P8RAonuAJ0ejEn1+oaiZnJIAGp2kFUyd8pgSwCdFaco
JgKsWYZfEcemGO3mZvL+KZY=
=vWqA
-----END PGP SIGNATURE-----

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

* Re: printf() overhead
  2005-01-09 19:25 printf() overhead John Richard Moser
@ 2005-01-09 19:41 ` Andre Tomt
  2005-01-09 21:16   ` John Richard Moser
  2005-01-09 20:27 ` Gene Heskett
  1 sibling, 1 reply; 6+ messages in thread
From: Andre Tomt @ 2005-01-09 19:41 UTC (permalink / raw)
  To: John Richard Moser; +Cc: linux-kernel

John Richard Moser wrote:
> using strace to run a program takes aeons.  Redirecting the output to a
> file can be a hundred times faster sometimes.  This raises question.
> 
> I understand that output to the screen is I/O.  What exactly causes it
> to be slow, and is there a possible way to accelerate the process?

The terminal is a major factor; gnome-terminal for example can be 
*extremely* slow.

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

* Re: printf() overhead
  2005-01-09 19:25 printf() overhead John Richard Moser
  2005-01-09 19:41 ` Andre Tomt
@ 2005-01-09 20:27 ` Gene Heskett
  1 sibling, 0 replies; 6+ messages in thread
From: Gene Heskett @ 2005-01-09 20:27 UTC (permalink / raw)
  To: linux-kernel; +Cc: John Richard Moser

On Sunday 09 January 2005 14:25, John Richard Moser wrote:
>-----BEGIN PGP SIGNED MESSAGE-----
>Hash: SHA1
>
>using strace to run a program takes aeons.  Redirecting the output
> to a file can be a hundred times faster sometimes.  This raises
> question.
>
>I understand that output to the screen is I/O.  What exactly causes
> it to be slow, and is there a possible way to accelerate the
> process? - --

As to what causes the slow, well fonts have to be rendered, and the 
screen has to be scrolled, both of which take finite pieces of time.
Displaying the file later just shifts the rendering etc time to 
something thats not nearly so noticeable because you can't read that 
fast anyway...

-- 
Cheers, Gene
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
99.31% setiathome rank, not too shabby for a WV hillbilly
Yahoo.com attorneys please note, additions to this message
by Gene Heskett are:
Copyright 2005 by Maurice Eugene Heskett, all rights reserved.

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

* Re: printf() overhead
  2005-01-09 19:41 ` Andre Tomt
@ 2005-01-09 21:16   ` John Richard Moser
  2005-01-10 18:33     ` Denis Vlasenko
  0 siblings, 1 reply; 6+ messages in thread
From: John Richard Moser @ 2005-01-09 21:16 UTC (permalink / raw)
  To: Andre Tomt; +Cc: linux-kernel

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1



Andre Tomt wrote:
| John Richard Moser wrote:
|
|> using strace to run a program takes aeons.  Redirecting the output to a
|> file can be a hundred times faster sometimes.  This raises question.
|>
|> I understand that output to the screen is I/O.  What exactly causes it
|> to be slow, and is there a possible way to accelerate the process?
|
|
| The terminal is a major factor; gnome-terminal for example can be
| *extremely* slow.
|

Is there a way to give the data to the terminal and let the program go
while that happens?  Or is there an execution path (i.e. terminal says
"WTF NO") that can be missed that way?

- --
All content of all messages exchanged herein are left in the
Public Domain, unless otherwise explicitly stated.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFB4Z8hhDd4aOud5P8RAnhBAJ40RgKIcXdCvhnuHlfZyK60xswjGwCdFef2
rmwEL/yAR74Q96VkpEV6Z2s=
=bpD8
-----END PGP SIGNATURE-----

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

* Re: printf() overhead
  2005-01-09 21:16   ` John Richard Moser
@ 2005-01-10 18:33     ` Denis Vlasenko
  0 siblings, 0 replies; 6+ messages in thread
From: Denis Vlasenko @ 2005-01-10 18:33 UTC (permalink / raw)
  To: John Richard Moser, Andre Tomt; +Cc: linux-kernel

On Sunday 09 January 2005 23:16, John Richard Moser wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> 
> 
> Andre Tomt wrote:
> | John Richard Moser wrote:
> |
> |> using strace to run a program takes aeons.  Redirecting the output to a
> |> file can be a hundred times faster sometimes.  This raises question.
> |>
> |> I understand that output to the screen is I/O.  What exactly causes it
> |> to be slow, and is there a possible way to accelerate the process?
> |
> |
> | The terminal is a major factor; gnome-terminal for example can be
> | *extremely* slow.
> |
> 
> Is there a way to give the data to the terminal and let the program go
> while that happens?  Or is there an execution path (i.e. terminal says
> "WTF NO") that can be missed that way?

Buffering is finite. strace output most likely overflow it.

Also while strace may finish already, you won't see it in gnome terminal
until entire strace stdout/stderr is drawn. You will wait anyway. :)
--
vda


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

* Re: printf() overhead
       [not found] <no.id>
@ 2005-01-09 21:24 ` Alan Curry
  0 siblings, 0 replies; 6+ messages in thread
From: Alan Curry @ 2005-01-09 21:24 UTC (permalink / raw)
  To: John Richard Moser; +Cc: Andre Tomt, linux-kernel

John Richard Moser writes the following:
>Andre Tomt wrote:
>| John Richard Moser wrote:
>|> using strace to run a program takes aeons.  Redirecting the output to a
>|> file can be a hundred times faster sometimes.  This raises question.
>|
>| The terminal is a major factor; gnome-terminal for example can be
>| *extremely* slow.
>|
>
>Is there a way to give the data to the terminal and let the program go
>while that happens?  Or is there an execution path (i.e. terminal says
>"WTF NO") that can be missed that way?

strace -o tracefile prog & tail -n +1 -f tracefile


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

end of thread, other threads:[~2005-01-10 18:39 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-01-09 19:25 printf() overhead John Richard Moser
2005-01-09 19:41 ` Andre Tomt
2005-01-09 21:16   ` John Richard Moser
2005-01-10 18:33     ` Denis Vlasenko
2005-01-09 20:27 ` Gene Heskett
     [not found] <no.id>
2005-01-09 21:24 ` Alan Curry

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