chicken-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-hackers] [PATCH] Make (time) annonce the maximum heap size


From: Peter Bex
Subject: Re: [Chicken-hackers] [PATCH] Make (time) annonce the maximum heap size used
Date: Sun, 18 Sep 2016 14:32:51 +0200
User-agent: Mutt/1.5.23 (2014-03-12)

On Sat, Sep 17, 2016 at 04:21:24PM +0200, Kooda wrote:
> Hi!
> 
> I’ve been discussing this on the IRC channel for some time, and
> sjamaan created a ticket about it: http://bugs.call-cc.org/ticket/1318
> so I gave it a go.
> 
> This will be useful for our benchmark runs, among other things.
> 
> What this patch basically does is recording the amount of heap used
> after a major GC.
> 
> It’s my first time looking at the GC code so it took me a little while
> to understand what to do. I hope it’s clear.

Hi Kooda,

Good job!  I have made a few minor tweaks:

- C_number() is a bit of a strange function that we should probably
    get rid of.  I've replaced it with C_unsigned_int_to_num, which,
    despite its name, accepts a C_uword and converts it to a fixnum or
    flonum (or in CHICKEN 5, a bignum).
- Printing a very large number in bytes is not very user-friendly so
    I've added a quick and dirty conversion to KiB/MiB/GiB.
    This will make parsing it a bit more difficult for chicken-benchmarks,
    but it's worthwhile, I think, because time is useful on its own.
- Added a NEWS entry.

In CHICKEN 5, the C_number function is only used for the "number" foreign
type specifier, for which the documentation says:

  A floating-point number. Similar to double, but when used as a result
  type, then either an exact integer or a floating-point number is
  returned, depending on whether the result fits into an exact integer
  or not.

We might want to consider getting rid of that, because it makes very
little sense to do that in a Scheme with bignums.  And if it's truly
a floating-point number that is returned, it makes more sense to put
it in a flonum.  Objections, anyone?

Cheers,
Peter

Attachment: 0001-Make-time-show-the-maximum-heap-usage.master.patch
Description: Text Data

Attachment: 0001-Make-time-show-the-maximum-heap-usage.chicken-5.patch
Description: Text Data

Attachment: signature.asc
Description: Digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]