Dear Jonathan,
0. It would be good to benefit from extended CPU instructions
for having faster bitsets.
1. As mentioned in the Cython documentation [1], pxi files are
not the advised way to deal with Cython code. inline functions
are perfectly usable when written in pxd headers. See for
example the header file sage/libs/linbox/conversion.pxd which
has no pyx implementation since everything is inlined.
2. Many people care about efficient bitsets and I doubt that
there is no finely tuned library around. I would rather try
to find an actively maintained open source project focused
on bitsets rather making it part of Sage internals.
3. Depending on the application you have in mind you might
want to distinguish between sparse and dense bitsets. Sparse
could be implemented as sets via has tables or binary trees,
etc
[1]
https://cython.readthedocs.io/en/latest/src/userguide/language_basics.html?highlight=pxi#cython-file-types
Le 16/09/2020 à 11:59, 'jonatha...@googlemail.com' via sage-devel a écrit :
Dear all, I want to redesign the bitset structure of combinatorial
polyhedron and move it to `data_structures/bitset.pxi`. This includes some
changes to bitset.pxi. Please comment, whether the proposed design changes
on the ticket are ok. Mostly they are the following:
1. Define most of the functions in bitset.pxi for fuzed types.
2. Move functions that can be optimized by intrinsics to a seperate file.
3. (Not yet done, but also important.) Optimize some functions in
bitset.pxi by intrinsics. This includes an overalignment condition. One
disadvantage of overalignment is that it makes realloc much more
complicated. Small bitsets also need more memory.
4. Indirect typecast of functions in `bitset.pxi` will no longer be
possible. E.g. you cannot call `bitset_add` with signature `(bitset_t,
PyObject)`, but `(bitset_t, int)` or `(bitset_t, size_t)` or similar are
ok. See https://trac.sagemath.org/ticket/30572.
Eventually, this should go into smaller tickets. But until then it would be
good to know, if the general direction is acceptable or which part is not.
See https://trac.sagemath.org/ticket/30549 for more detail.
--
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/cda3f418-4dde-5d0e-3053-41bb226a14a8%40gmail.com.