From: Marko Rauhamaa <marko@pacujo.net>
To: Linas Vepstas <linasvepstas@gmail.com>
Cc: "guile-user@gnu.org" <guile-user@gnu.org>
Subject: Re: out-of-control GC
Date: Mon, 11 Sep 2017 01:38:30 +0300 [thread overview]
Message-ID: <877ex6qivt.fsf@elektro.pacujo.net> (raw)
In-Reply-To: <CAHrUA36y0QoSTPZ72jo2WNJrMsMZrGDBhC3VydWCqSYr=JLKow@mail.gmail.com> (Linas Vepstas's message of "Sun, 10 Sep 2017 16:47:09 -0500")
Linas Vepstas <linasvepstas@gmail.com>:
> On Sun, Sep 10, 2017 at 3:36 PM, Marko Rauhamaa <marko@pacujo.net> wrote:
>
>> Linas Vepstas <linasvepstas@gmail.com>:
>> > which suggests that the vast majority of time is spent in GC, and not
>> > in either scheme/guile, or my wrapped c++ code.
>>
>> That may well be normal.
>
> It might be "normal", but its objectionable. If 90% of the cpu time is
> spent in GC, and almost nothing at all was actually collected, then
> its too much.
Hard to say. I don't know how much garbage Guile generates as part of
its normal execution model, but for example Python generates garbage
with each method call. It is very natural for each application of a Lisp
function to create a throw-away data structure through substitution.
> On the Amazon cloud, you get to pay by the minute. On laptops with
> batteries, people complain. Especially when they are apple users, not
> linux users.
GC overhead is like RAM cache overhead or C function call overhead. Its
the price of doing business.
> If the compute job takes a week, and your user has discovered this GC
> thing, then the user will conclude that it should take less than 24
> hours, and will tell you that you are stupid, and that guile sucks. I
> have been told I'm stupid, and that guile sucks too many times.
>
> CPU cycles aren't free.
I have no idea how good Guile's performance is. Python's performance is
probably about 100 times worse than C, yet it's the fast becoming the
most popular programming language in the world.
Not everything in the world is done for performance. The #1 purpose for
a programming language is managing complexity. Relatively few
computation tasks require excellent performance, and there are other
programming languages for that: C, C++, Java, C#, go
Note that Java, C# and go are performant despite GC. GC generally
doesn't have to be all that costly throughput-wise. The biggest
performance drain for high-level programming languages such as Scheme or
Python is the absence of compile-time typing. In fact, Python is adding
optional static type annotation (which I'm afraid might be a big
mistake).
> However, guile uses gc_malloc_atomic for these strings, and so GC
> should never-ever peer into the contents of them. So I don't think its
> "accidental heap addresses". Its probably fragmentation, and the very
> heavy churn of large malloc chunks.
You aren't thrashing by any chance...?
> So let me redirect: is there some central spot within guile, where the
> decision to run GC is made? If so, what file would that be in? If not,
> is there some string I should grep for?
I believe that decision is left for GC_malloc(1L):
GC_malloc will attempt to reclaim inaccessible space automatically by
invoking a conservative garbage collector at appropriate points.
Marko
next prev parent reply other threads:[~2017-09-10 22:38 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-09 19:47 out-of-control GC Linas Vepstas
2017-09-10 4:14 ` Linas Vepstas
2017-09-10 16:50 ` Arne Babenhauserheide
2017-09-10 18:03 ` David Kastrup
2017-09-10 20:23 ` Linas Vepstas
2017-09-10 20:36 ` Marko Rauhamaa
2017-09-10 21:47 ` Linas Vepstas
2017-09-10 22:38 ` Marko Rauhamaa [this message]
2017-09-11 16:17 ` Arne Babenhauserheide
2017-09-14 18:31 ` Linas Vepstas
2017-09-14 18:58 ` Marko Rauhamaa
2017-09-14 20:15 ` Linas Vepstas
2017-09-14 20:36 ` David Kastrup
2017-09-14 20:45 ` Arne Babenhauserheide
2017-09-11 8:22 ` tomas
2017-09-14 20:19 ` Linas Vepstas
2017-09-13 17:13 ` David Kastrup
2017-09-10 22:17 ` Arne Babenhauserheide
2017-09-10 22:36 ` Arne Babenhauserheide
2017-09-14 7:44 ` Mark H Weaver
2017-09-10 16:53 ` Arne Babenhauserheide
2017-09-13 2:24 ` Mark H Weaver
2017-09-13 19:38 ` Arne Babenhauserheide
2017-09-13 19:57 ` David Kastrup
2017-09-13 20:37 ` Arne Babenhauserheide
2017-09-14 19:14 ` Linas Vepstas
2017-09-11 18:13 ` Hans Åberg
-- strict thread matches above, loose matches on Subject: below --
2017-09-11 7:42 Kjetil Matheussen
2017-09-14 18:41 ` Linas Vepstas
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=877ex6qivt.fsf@elektro.pacujo.net \
--to=marko@pacujo.net \
--cc=guile-user@gnu.org \
--cc=linasvepstas@gmail.com \
/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).