#13352: Running time improvement of the bitset_len method
-------------------------------------------------+-------------------------
Reporter: dcoudert | Owner: jason
Type: enhancement | Status: closed
Priority: major | Milestone: sage-5.13
Component: misc | Resolution: fixed
Keywords: | Merged in:
Authors: David Coudert, Jeroen Demeyer | sage-5.13.rc0
Report Upstream: N/A | Reviewers: David
Branch: | Coudert
Dependencies: | Work issues:
| Commit:
| Stopgaps:
-------------------------------------------------+-------------------------
Old description:
> This patch improves the running time of the {{{bitset_len}}} method by
> using {{{__builtin_popcount()}}}.
>
> Before:
> {{{
> sage: B = Bitset('10'*10000)
> sage: len(B)
> 10000
> sage: %timeit len(B)
> 1000 loops, best of 3: 245 us per loop
> }}}
>
> After:
> {{{
> sage: B = Bitset('10'*10000)
> sage: len(B)
> 10000
> sage: %timeit len(B)
> 100000 loops, best of 3: 2.52 us per loop
> }}}
>
> This patch also reorganizes the bitset files, including deleting the
> `sage/misc/bitset_pxd.pxi` file.
>
> APPLY:
>
> * [attachment:trac_13352_bitset_len_v4.patch]
New description:
This patch improves the running time of the {{{bitset_len}}} method by
using {{{mpn_popcount()}}}.
Before:
{{{
sage: B = Bitset('10'*10000)
sage: len(B)
10000
sage: %timeit len(B)
1000 loops, best of 3: 245 us per loop
}}}
After:
{{{
sage: B = Bitset('10'*10000)
sage: len(B)
10000
sage: %timeit len(B)
100000 loops, best of 3: 2.52 us per loop
}}}
This patch also reorganizes the bitset files, including deleting the
`sage/misc/bitset_pxd.pxi` file.
APPLY:
* [attachment:trac_13352_bitset_len_v4.patch]
--
Comment (by dcoudert):
I changed the description since we use {{{mpn_popcount}}} and not
{{{___builtin_popcount}}}
--
Ticket URL: <http://trac.sagemath.org/ticket/13352#comment:50>
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/groups/opt_out.