Here's the correct benchmark script,
https://gist.github.com/isuruf/857e2236d2443ebd9085273b3e6ada3b

Isuru

On Fri, Aug 27, 2021 at 2:14 PM Isuru Fernando <isu...@gmail.com> wrote:

> Hi,
>
> On Fri, Aug 27, 2021 at 1:23 PM William Stein <wst...@gmail.com> wrote:
>
>> Hello Isuru -- thanks for popping in to comment!
>>
>> On Fri, Aug 27, 2021 at 10:56 AM Isuru Fernando <isu...@gmail.com> wrote:
>> >
>> > Hi,
>> >
>> > A SymEngine maintainer here.
>> >
>> > > Pynac has a lot of I think nontrivial efficient hooks back into Sage
>> > for working with various data types, and doing things like equality
>> > testing, fast evaluation of expression (fast_float, etc.),
>> >
>> > With SymEngine, we do have fast evaluation of expressions with
>> > several backends. One backend is LLVM, where we compile the function
>> > using LLVM and generate a callable C function using that.
>>
>> Wow, that's very cool.  Do you know how it compares to Sage's
>> fast_float and fast_callable "compilers" in terms of speed?   Sage's
>> don't actually depend on having LLVM installed (they aren't compiling
>> to machine code), so I assume might be significantly slower, except
>> that the people (=Robert Bradshaw) who wrote them are very clever, so
>> you never know.  It's probably also interesting to benchmark the
>> compile time itself.
>>
>
> I've attached a small script that I put together just now. Note how we can
> pass sage expressions in symbolic ring to symengine functions.
>
> Timings are below. First one is sage and the second is symengine.
>
> one element
> 625 loops, best of 3: 68 μs per loop
> 625 loops, best of 3: 12.9 μs per loop
>
> create an output numpy array of 1000 elements
> 5 loops, best of 3: 175 ms per loop
> 625 loops, best of 3: 18.1 μs per loop
>
> compile time
> 625 loops, best of 3: 478 μs per loop
> 125 loops, best of 3: 2.69 ms per loop
>
> SymEngine LLVM backend has optimization levels (0, 1, 2, 3). 3 is the
> default.
> By setting to optimization level 0, compile time is half with a
> performance penalty
> of around 10%.
>
> Isuru
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/CA%2B01voMGc5aayc%2BuAdjNa-orR%3D0cWjiZqqpFSwsDuk-NDKw%2Bxw%40mail.gmail.com.

Reply via email to