[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Chicken-users] Need help to figure out where this strange performance i
From: |
Jörg F . Wittenberger |
Subject: |
[Chicken-users] Need help to figure out where this strange performance impact is coming from |
Date: |
Wed, 13 Jan 2016 12:37:52 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux armv7l; rv:38.0) Gecko/20100101 Icedove/38.4.0 |
Hi Chickeneers,
yesterday I found that simply having a (use mailbox) in some code had a
huge impact (more than a factor of 3) at the performance of the
resulting executable. Without using the mailbox stuff at all.
Meanwhile I figured out that this has nothing at all to do with the
mailbox egg. But _all_ with the use of srfi-1.
But how is this possible?
Attached some test code. As I ran into it from mailbox I prepared a
stripped down version of it to play with. Towards the end of the file
there is a (use srfi-1) which makes all the difference.
So far I found (compiling the code with -O5 but similar things happen
with less aggressive optimization):
a) Using chicken 4.9.1 there is absolutely no difference. Using srfi-1
or not I get roughly 100 messages passed per ms on my machine. (But I
have to include the forced gc; see comment in the code.)
b) A slightly different version which avoids allocations in the queue
runs without the forced gc and yields about 160 ms^-1 on chicken 4.9.1
Again no difference whether or not I (use srfi-1) anywhere.
Now the interesting bits:
c) On master (built almost two weeks ago) I get - when (use srfi-1) is
included - about 180 ms^-1. Those ~5% faster sound about right to me.
d) Comment out the (use srfi-1) at line 163 and it goes down to about
_50_ per millisecond!
e) The same happens for the alternative, allocation free version (not
attached), which uses vectors instead of pairs.
Speculating: The code I wrote has nothing to do with the difference.
But I'm confused. Neither scheduler.scm nor srfi-18 seem to have any
dependency on srfi-1. Also srfi-1 seems not to overwrite any global
bindings.
Should we simply always (use srfi-1) if we also (use srfi-18). Looks
like a workaround, but not like the right thing to do.
How could I boil this down to the real reason?
Best
/Jörg
simple3.scm
Description: Text Data
- [Chicken-users] Need help to figure out where this strange performance impact is coming from,
Jörg F . Wittenberger <=