[Top][All Lists]

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

Re: [PATCH]: Add new bytecode op `switch' for implementing branch tables

From: Vibhav Pant
Subject: Re: [PATCH]: Add new bytecode op `switch' for implementing branch tables.
Date: Tue, 7 Feb 2017 19:20:35 +0530

On Tue, Feb 7, 2017 at 12:00 AM, Stefan Monnier
<address@hidden> wrote:
>> The following patch adds support for a new op `switch` to the Emacs
>> bytecode VM and compiler.
> I guess the motivation is to speed up some code.
> Did you make any measurements to see what kind of effect it has?

The attached benchmark code took 9.409541956 seconds when compiled
without switch,
and 0.20807168799999998 seconds (97% speedup) when compiled with switch. It
generates a cond clause with a thousand clauses comparing a variable
with random integer values, with the last clause containing the actual
value. However,
since it's a synthetic benchmark, real world code should be better indicator of
performance improvement.

Vibhav Pant

Attachment: switch-benchmark.el
Description: Text Data

reply via email to

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