Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Speedup adding horizontal and vertical border strips #34339

Closed
tscrim opened this issue Aug 11, 2022 · 11 comments
Closed

Speedup adding horizontal and vertical border strips #34339

tscrim opened this issue Aug 11, 2022 · 11 comments

Comments

@tscrim
Copy link
Collaborator

tscrim commented Aug 11, 2022

We can be better about the number of conjugations involved.

CC: @trevorkarn @anneschilling @nthiery @darijgr @zabrocki

Component: performance

Keywords: combinat, partition

Author: Travis Scrimshaw

Branch/Commit: 5e52832

Reviewer: Frédéric Chapoton

Issue created by migration from https://trac.sagemath.org/ticket/34339

@tscrim tscrim added this to the sage-9.7 milestone Aug 11, 2022
@tscrim
Copy link
Collaborator Author

tscrim commented Aug 11, 2022

comment:1

With my branch, this is now

sage: %timeit Partition([2,2]).add_vertical_border_strip(2)
57.9 µs ± 484 ns per loop (mean ± std. dev. of 7 runs, 10,000 loops each)
sage: %timeit Partition([3,2,2]).add_vertical_border_strip(2)
101 µs ± 1.02 µs per loop (mean ± std. dev. of 7 runs, 10,000 loops each)
sage: %timeit Partition([7,4,2,2,2,1,1]).add_vertical_border_strip(5)  # 43 partitions
871 µs ± 6.03 µs per loop (mean ± std. dev. of 7 runs, 1,000 loops each)

sage: %timeit Partition([2,2]).add_horizontal_border_strip(2)
54.6 µs ± 388 ns per loop (mean ± std. dev. of 7 runs, 10,000 loops each)
sage: %timeit Partition([3,2,2]).add_horizontal_border_strip(2)
99.3 µs ± 1.01 µs per loop (mean ± std. dev. of 7 runs, 10,000 loops each)
sage: %timeit Partition([7,4,2,2,2,1,1]).add_horizontal_border_strip(5)  # 43 partitions
908 µs ± 3.09 µs per loop (mean ± std. dev. of 7 runs, 1,000 loops each)
sage: %timeit Partition([5,4,3,2,1]).add_horizontal_border_strip(5)  # 32 partitions
769 µs ± 2.95 µs per loop (mean ± std. dev. of 7 runs, 1,000 loops each)

versus before:

109 µs ± 650 ns per loop (mean ± std. dev. of 7 runs, 10,000 loops each)
170 µs ± 1.31 µs per loop (mean ± std. dev. of 7 runs, 10,000 loops each)
1.32 ms ± 5.69 µs per loop (mean ± std. dev. of 7 runs, 1,000 loops each)

99.2 µs ± 773 ns per loop (mean ± std. dev. of 7 runs, 10,000 loops each)
158 µs ± 559 ns per loop (mean ± std. dev. of 7 runs, 10,000 loops each)
1.15 ms ± 4.29 µs per loop (mean ± std. dev. of 7 runs, 1,000 loops each)
997 µs ± 4.7 µs per loop (mean ± std. dev. of 7 runs, 1,000 loops each)

The output order of the add_horizontal_border_strip() has changed, but this should be inconsequential.


New commits:

6ccd9e4Optimization of add_*_border_strip() and doctest update.

@tscrim
Copy link
Collaborator Author

tscrim commented Aug 11, 2022

Commit: 6ccd9e4

@tscrim
Copy link
Collaborator Author

tscrim commented Aug 11, 2022

@fchapoton
Copy link
Contributor

comment:2

pathbot reports a failing doctest in src/sage/tests/book_schilling_zabrocki_kschur_primer

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Aug 12, 2022

Branch pushed to git repo; I updated commit sha1. New commits:

5e52832Fixing order of k_atoms in k-Schur book.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Aug 12, 2022

Changed commit from 6ccd9e4 to 5e52832

@tscrim
Copy link
Collaborator Author

tscrim commented Aug 12, 2022

comment:4

Fixed.

@fchapoton
Copy link
Contributor

Reviewer: Frédéric Chapoton

@fchapoton
Copy link
Contributor

comment:5

ok, let's move on

@tscrim
Copy link
Collaborator Author

tscrim commented Aug 13, 2022

comment:6

Thank you.

@vbraun
Copy link
Member

vbraun commented Aug 30, 2022

Changed branch from public/combinat/speedup_adding_strips-34339 to 5e52832

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants