unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Han-Wen Nienhuys <hanwen@xs4all.nl>
To: guile-devel@gnu.org
Subject: Re: freeing srcprops ?
Date: Tue, 30 Jan 2007 00:31:32 +0100	[thread overview]
Message-ID: <45BE83D4.8000203@xs4all.nl> (raw)
In-Reply-To: <87veiptt2z.fsf@ossau.uklinux.net>

Neil Jerram escreveu:
>>>>> why use a separate storage pool for srcprop objects?
>>>> At a guess, is it because that they're likely to never need freeing,
>>>> hence can be laid down in big blocks.
>>> I'd guess because setting up a srcprops is critical to start-up
>>> performance, and a double cell doesn't have enough slots to store all
>>> the common properties (filename, pos, copy) directly (as your change
>>> makes clear).
>> All this guessing ...  I suspect it was done just because of poor design
>> and/or premature optimization.
> 
> Except you haven't given any objective reasons for why the design is
> poor or the optimization premature.

Any deviation from the standard memory allocation scheme should have a
good reason, or -at least- a documented reason.

This design predates several revisions of the garbage collector, so I
suspect that whatever reason there was for this idea, is no longer
valid.

>> on the factual side: 
>>
>> 1. the GUILE ends up with 1506 srcprops objects.
> 
> Out of interest, in what scenario?

Startup (with --debug), which you brought up earlier. As I indicated
in an earlier message, I did not see any measurable change in startup
time.

>> 2. this is neglible compared to the 431777 total cells that
>> are allocated.
> 
> (Which suggests to me that the decrease in memory from your change
> wasn't that worthwhile.)

That was not the point of the change.

>> I actually think it would be a good idea to generalize from double cells,
>> to cells containing any number between 3 and 8 SCM values.  This would 
>> be a better fit with some datatypes, and obviates the procustes
>> hacking to fit all the information inside some struct.
> 
> Maybe.  I think this would have to be motivated by looking at
> particular cases where we get benefits from moving struct data into a
> multiple cell.  I don't think the srcprops case is clearcut
> (obviously), and I don't see anything wrong with the general approach
> of indirecting to a struct.

I don't mind either, but since the old code was using a struct with
its own 'optimized' memory management scheme, I assumed that an even
better scheme (due to lower memory use) could not be questioned.

>> Because the code made me cringe. It's pointless to have specialized storage
>> for srcprops. it only makes the code more obtuse.
> 
> I disagree.  I believe 

Can we have some measurable data?

Thanks,  

-- 
 Han-Wen Nienhuys - hanwen@xs4all.nl - http://www.xs4all.nl/~hanwen



_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-devel


  reply	other threads:[~2007-01-29 23:31 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-17  0:22 freeing srcprops ? Han-Wen Nienhuys
2007-01-18 14:04 ` Han-Wen Nienhuys
2007-01-18 23:28   ` Kevin Ryde
2007-01-19 10:37     ` Han-Wen Nienhuys
2007-01-19 11:52     ` Han-Wen Nienhuys
2007-01-26 22:15       ` Kevin Ryde
2007-01-26 23:33         ` Han-Wen Nienhuys
2007-01-18 23:20 ` Kevin Ryde
2007-01-28  9:08   ` Neil Jerram
2007-01-29 11:39     ` Han-Wen Nienhuys
2007-01-29 21:35       ` Neil Jerram
2007-01-29 23:31         ` Han-Wen Nienhuys [this message]
2007-01-30 12:40           ` Ludovic Courtès
2007-01-30 19:14             ` Han-Wen Nienhuys
2007-01-30 12:21       ` Mikael Djurfeldt
2007-01-30 12:52         ` Han-Wen Nienhuys

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=45BE83D4.8000203@xs4all.nl \
    --to=hanwen@xs4all.nl \
    --cc=guile-devel@gnu.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).