[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] extend map-into
From: |
Andrea Corallo |
Subject: |
Re: [PATCH] extend map-into |
Date: |
Wed, 09 Oct 2019 15:35:00 +0000 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.2 (berkeley-unix) |
Stefan Monnier <address@hidden> writes:
>> I can tell you what I did just now and you tell me if it makes sense.
>> I've created a function with as body an unrolled loop that calls 10000
>> times (map-into nil 'alist).
>> Once byte compiled I've run it with the current map.el and then with the
>> new one loaded.
>
> That sounds about right. Tho, you can also use something like
> `benchmark` for that.
>
>> On my machine both versions runs in about the same time (~0.04-0.03
>> secs), if there's some difference for this simple test is just noise.
>
> 0.03 seconds is too small for a meaningful measure, in my experience,
> I recommend you add 2 zeroes to the number of iterations to bring it
> into the realm of "a few seconds".
>
> But, yes, there's a chance the difference is negligible (more time is
> spent in the funcall/apply machinery itself and/or the hash lookup than
> the specific computation of the "tag" used to index the hash-table,
> which is the part that depends on the set of specializers used on
> a particular argument of a generic function).
>
>
> Stefan
I've repeated the same test going up two magnitude orders (1000000
iterations). Still the execution time (~1.7secs) seems not distinguishable
between the old and the implementation.
For my curiosity I've also tried to run it using
`benchmark-run-compiled' with a very similar execution time as result. I
would have expected to have the unrolled version faster but apparently
funcall is not the bottle-neck here.
As usual when profiling guessing proves to be not a good idea.
Bests
Andrea
--
address@hidden
- Re: new function proposal alist-to-hash, (continued)
- [PATCH] extend map-into (was: new function proposal alist-to-hash), Andrea Corallo, 2019/10/05
- Re: [PATCH] extend map-into, Stefan Monnier, 2019/10/06
- Re: [PATCH] extend map-into, Andrea Corallo, 2019/10/06
- Re: [PATCH] extend map-into, Stefan Monnier, 2019/10/08
- Re: [PATCH] extend map-into, Andrea Corallo, 2019/10/08
- Re: [PATCH] extend map-into, Stefan Monnier, 2019/10/08
- Re: [PATCH] extend map-into,
Andrea Corallo <=
- Re: [PATCH] extend map-into, Stefan Monnier, 2019/10/09
- Re: [PATCH] extend map-into, Andrea Corallo, 2019/10/09
- Re: [PATCH] extend map-into, Nicolas Petton, 2019/10/10
- Re: [PATCH] extend map-into, Nicolas Petton, 2019/10/10
- Re: [PATCH] extend map-into, Andrea Corallo, 2019/10/10
- Re: [PATCH] extend map-into, Nicolas Petton, 2019/10/10
- Re: [PATCH] extend map-into, Stefan Monnier, 2019/10/11
- Re: [PATCH] extend map-into, Andrea Corallo, 2019/10/11