Skip to contentSkip to conversation

printf() overhead

DISCUSSION John Richard Moser 4 participants 5 messages Jan 9, 2005 – Jan 10, 2005

lore
Share & tools
lore
#0 lore raw

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

#1 lore raw
Quoted 5 lines · John Richard Moser

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.

#2 lore raw

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

#3 lore raw
Quoted 19 lines · John Richard Moser

-----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.
|
Quoted 3 lines

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

#4 lore raw
In reply to John Richard Moser
Quoted 10 lines · John Richard Moser

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

Signature · 8 lines
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.