unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Noah Lavine <noah.b.lavine@gmail.com>
To: Noah Lavine <noah.b.lavine@gmail.com>
Cc: Mark H Weaver <mhw@netris.org>, guile-devel <guile-devel@gnu.org>
Subject: Re: Extremely high overhead of 'par-map'
Date: Fri, 29 Mar 2013 16:27:17 -0400	[thread overview]
Message-ID: <CA+U71=P5TEEGGVXg3Q0dmV_J0nbDXZ8f00G3BAJdQAHJSGqW-w@mail.gmail.com> (raw)
In-Reply-To: <CA+U71=PjPgo-jnL_EFBW0+MBCMsKjs3bBVt9Hq4k_cpDXdyb9Q@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1748 bytes --]

Oh, sorry to email twice so soon, but I have an idea for making par-map
usable in more cases: add a keyword argument called "block-size". Its value
should be a positive integer, and the meaning is to have each thread do
block-size iterations. That should make it easier to use par-map for cases
like this where the cost of each function is very small.

I realize it's not a great solution because you still have to iterate
through the list to get to the later elements. A hypothetical
"vector-par-map" would solve that.

Noah


On Fri, Mar 29, 2013 at 4:24 PM, Noah Lavine <noah.b.lavine@gmail.com>wrote:

> I agree. Do you have any idea what's causing the overhead?
>
> I tried to benchmark it, but got a segmentation fault. I think we have
> plenty of work to do here. :-)
>
> Noah
>
>
> On Fri, Mar 29, 2013 at 2:00 AM, Mark H Weaver <mhw@netris.org> wrote:
>
>> I wrote:
>>
>> > Nala Ginrut <nalaginrut@gmail.com> writes:
>> >> --------------------cut-------------------
>> >> scheme@(guile-user)> ,time (define a (map (lambda (x) (expt x 5))
>> (iota
>> >> 10000)))
>> >> ;; 0.008019s real time, 0.007979s run time.  0.000000s spent in GC.
>> >> scheme@(guile-user)> ,time (define a (par-map (lambda (x) (expt x 5))
>> >> (iota 10000)))
>> >> ;; 6.596471s real time, 6.579375s run time.  1.513880s spent in GC.
>> >> --------------------end-------------------
>> > [...]
>> >> Well, is there any example?
>> >
>> > The timings above suggest that, on your machine, the overhead of
>> > 'par-map' is in the neighborhood of 660 microseconds per thread (that's
>> > the total run time divided by 10000 iterations).
>>
>> I must say that 'par-map' has shockingly poor performance.
>> We really ought to try to improve this.
>>
>>      Mark
>>
>>
>

[-- Attachment #2: Type: text/html, Size: 2784 bytes --]

  reply	other threads:[~2013-03-29 20:27 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1355559152.27310.5.camel@Renee-desktop.suse>
     [not found] ` <87y5d8rclr.fsf@gnu.org>
2013-03-28  2:55   ` Whats' the proper senario of par-map? (Was Re: bug#13188: par-map causes VM stack overflow) Nala Ginrut
2013-03-28  5:05     ` Mark H Weaver
2013-03-28 13:44       ` Ludovic Courtès
2013-03-28 18:00         ` Mark H Weaver
2013-03-28 20:07           ` Ludovic Courtès
2013-03-29  2:36       ` Nala Ginrut
2013-03-29  5:49         ` Mark H Weaver
2013-03-29  6:00           ` Extremely high overhead of 'par-map' Mark H Weaver
2013-03-29 20:24             ` Noah Lavine
2013-03-29 20:27               ` Noah Lavine [this message]
2013-03-29 23:18                 ` Mark H Weaver
2013-03-30 23:37             ` Ludovic Courtès
2013-03-29 16:45           ` Whats' the proper senario of par-map? (Was Re: bug#13188: par-map causes VM stack overflow) Mark H Weaver
2013-04-01 19:10           ` Andy Wingo
2013-03-29  9:52         ` Ludovic Courtès

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='CA+U71=P5TEEGGVXg3Q0dmV_J0nbDXZ8f00G3BAJdQAHJSGqW-w@mail.gmail.com' \
    --to=noah.b.lavine@gmail.com \
    --cc=guile-devel@gnu.org \
    --cc=mhw@netris.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).