From: Lynn Winebarger <owinebar@free-expression.org>
Subject: Re: expensive backtraces.
Date: Sat, 15 Feb 2003 14:49:33 -0500 [thread overview]
Message-ID: <03021514493308.22223@locke.free-expression.org> (raw)
In-Reply-To: <15950.35281.669014.657068@blauw.xs4all.nl>
On Saturday 15 February 2003 13:41, Han-Wen Nienhuys wrote:
>
> and the rest, is approximately 8 seconds. I think this is exorbitant
> on a 400mhz machine. When tracing this with GDB, it seems that a lot
> of memory is filled and GC-ed again for printing enormous structures,
> which are later folded into '#' marks again.
> [...]
> Other than trimming my "print_smob()" routines, does anyone see a
> solution to this problem from the GUILE side? Ideally, the printing of
> a large structure should be interrupted once the length of its output
> exceeds a certain size. It seems that right now, first the entire
> object is printed (taking a lot of time), and then all that printout
> is replaced by "#" if too large.
>
There is a standard solution. First keep track of how deep in the
structure you are and allow (not require) a limit on the recursion depth.
The second is to then notice that lists should be treated like arrays
and not as nested datastructures, and allow a limit on the length of both
of them.
If you try to determine both those limits to constrain the actual total
output length, you will find yourself backtracking.
There's also now an extra bit in cons cells that could be used to tell
if the printer has seen it already. Or not. It's not clear some better
use wouldn't come along.
Lynn
_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel
prev parent reply other threads:[~2003-02-15 19:49 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-02-15 18:41 expensive backtraces Han-Wen Nienhuys
2003-02-15 19:49 ` Lynn Winebarger [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=03021514493308.22223@locke.free-expression.org \
--to=owinebar@free-expression.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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 read-only IMAP folder(s) and NNTP newsgroup(s).