#15950: Consider using a faster malloc()
-------------------------------+-----------------------------
Reporter: mmezzarobba | Owner:
Type: enhancement | Status: new
Priority: major | Milestone: sage-wishlist
Component: performance | Resolution:
Keywords: | Merged in:
Authors: | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Commit:
Dependencies: | Stopgaps:
-------------------------------+-----------------------------
Description changed by mmezzarobba:
Old description:
> Some unscientific experiments suggesting that sage may benefit from using
> a custom malloc(), at lest on Linux/glibc:
>
> {{{
> $ sage
> ┌────────────────────────────────────────────────────────────────────┐
> │ Sage Version 6.2.beta4, Release Date: 2014-03-11 │
> │ Type "notebook()" for the browser-based notebook interface. │
> │ Type "help()" for help. │
> └────────────────────────────────────────────────────────────────────┘
> ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
> ┃ Warning: this is a prerelease version, and it may be unstable. ┃
> ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
> sage: P.<a,b,c> = PolynomialRing(QQ)
> sage: %timeit d=(a+b+c+1)^100
> 1 loops, best of 3: 5.42 s per loop
> sage: m = random_matrix(QQ, 1000)
> sage: %timeit m**2
> 1 loops, best of 3: 957 ms per loop
> }}}
>
> {{{
> $ LD_PRELOAD="libjemalloc.so.1" sage
> ┌────────────────────────────────────────────────────────────────────┐
> │ Sage Version 6.2.beta4, Release Date: 2014-03-11 │
> │ Type "notebook()" for the browser-based notebook interface. │
> │ Type "help()" for help. │
> └────────────────────────────────────────────────────────────────────┘
> ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
> ┃ Warning: this is a prerelease version, and it may be unstable. ┃
> ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
> sage: P.<a,b,c> = PolynomialRing(QQ)
> sage: %timeit d=(a+b+c+1)^100
> 1 loops, best of 3: 3.98 s per loop
> sage: m = random_matrix(QQ, 1000)
> sage: %timeit m**2
> 1 loops, best of 3: 1.07 s per loop
> }}}
>
> {{{
> $ LD_PRELOAD="/usr/lib/libtcmalloc.so.4" sage
> ┌────────────────────────────────────────────────────────────────────┐
> │ Sage Version 6.2.beta4, Release Date: 2014-03-11 │
> │ Type "notebook()" for the browser-based notebook interface. │
> │ Type "help()" for help. │
> └────────────────────────────────────────────────────────────────────┘
> ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
> ┃ Warning: this is a prerelease version, and it may be unstable. ┃
> ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
> sage: P.<a,b,c> = PolynomialRing(QQ)
> sage: %timeit d=(a+b+c+1)^100
> 1 loops, best of 3: 3.85 s per loop
> sage: m = random_matrix(QQ, 1000)
> sage: %timeit m**2
> 1 loops, best of 3: 840 ms per loop
> }}}
New description:
Some unscientific experiments suggesting that sage may benefit from using
a custom malloc(), at least on Linux/glibc:
{{{
$ sage
┌────────────────────────────────────────────────────────────────────┐
│ Sage Version 6.2.beta4, Release Date: 2014-03-11 │
│ Type "notebook()" for the browser-based notebook interface. │
│ Type "help()" for help. │
└────────────────────────────────────────────────────────────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Warning: this is a prerelease version, and it may be unstable. ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
sage: P.<a,b,c> = PolynomialRing(QQ)
sage: %timeit d=(a+b+c+1)^100
1 loops, best of 3: 5.42 s per loop
sage: m = random_matrix(QQ, 1000)
sage: %timeit m**2
1 loops, best of 3: 957 ms per loop
}}}
{{{
$ LD_PRELOAD="libjemalloc.so.1" sage
┌────────────────────────────────────────────────────────────────────┐
│ Sage Version 6.2.beta4, Release Date: 2014-03-11 │
│ Type "notebook()" for the browser-based notebook interface. │
│ Type "help()" for help. │
└────────────────────────────────────────────────────────────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Warning: this is a prerelease version, and it may be unstable. ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
sage: P.<a,b,c> = PolynomialRing(QQ)
sage: %timeit d=(a+b+c+1)^100
1 loops, best of 3: 3.98 s per loop
sage: m = random_matrix(QQ, 1000)
sage: %timeit m**2
1 loops, best of 3: 1.07 s per loop
}}}
{{{
$ LD_PRELOAD="/usr/lib/libtcmalloc.so.4" sage
┌────────────────────────────────────────────────────────────────────┐
│ Sage Version 6.2.beta4, Release Date: 2014-03-11 │
│ Type "notebook()" for the browser-based notebook interface. │
│ Type "help()" for help. │
└────────────────────────────────────────────────────────────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Warning: this is a prerelease version, and it may be unstable. ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
sage: P.<a,b,c> = PolynomialRing(QQ)
sage: %timeit d=(a+b+c+1)^100
1 loops, best of 3: 3.85 s per loop
sage: m = random_matrix(QQ, 1000)
sage: %timeit m**2
1 loops, best of 3: 840 ms per loop
}}}
--
--
Ticket URL: <http://trac.sagemath.org/ticket/15950#comment:1>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.