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

make tests run much faster #16

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jw3126
Copy link
Contributor

@jw3126 jw3126 commented Jan 17, 2023

Before

julia> @time include("test/runtests.jl");
Test Summary:       | Pass  Total     Time
CliffordAlgebras.jl | 2511   2511  2m53.5s
197.829084 seconds (8.98 M allocations: 1.078 TiB, 37.20% gc time, 12.09% compilation time)

After

julia> @time include("test/runtests.jl");
Test Summary:       | Pass  Total  Time
CliffordAlgebras.jl | 2511   2511  0.2s
 26.239201 seconds (7.46 M allocations: 637.263 MiB, 1.01% gc time, 97.76% compilation time)

@jw3126
Copy link
Contributor Author

jw3126 commented Jan 17, 2023

The issue was that CliffordAlgebra(9, 6) creates a Tuple of size 2^15. Julia does not like such big tuples.
I think the best solution might be to not store the base indices as a Tuple but as a lazy struct.
This PR at least fixes issues with the big tuple when running the tests.

@ATell-SoundTheory
Copy link
Owner

Thanks, Jan. I was aware of the issue with the big tuples but don't think there's an easy fix. Like you say, evaluation when needed would be one way. But that would require some major code changes.

I'm not sure if fixing it just for the test runs is a good idea. I'll have to understand what you did there, first.

@jw3126
Copy link
Contributor Author

jw3126 commented Jan 17, 2023

I guess most people including me don't actually need these high dimensional algebras. But slow tests affect everybody. The tests only instantiate some big algebras, but do nothing else with them. I made instantiation fast.

@ATell-SoundTheory
Copy link
Owner

I guess I'll try to replace the tuple with something that quacks and walks like a tuple but is really a lazy evaluated expression. Do you happen to know if someone else already has written a library for that?

@jw3126
Copy link
Contributor Author

jw3126 commented Jan 17, 2023

I don't know a library that can help here. If you want we could chat about how to do this or code it together.

@chakravala

This comment was marked as off-topic.

@ATell-SoundTheory

This comment was marked as off-topic.

@ATell-SoundTheory
Copy link
Owner

@jw3126 I'd love to do that. Unfortunately I'm knee-deep into a C++ project at the moment and switching to a Julia context would require some effort. But maybe we could meet for a play date some time and discuss the issue when the kids are busy?

@chakravala

This comment was marked as off-topic.

@ATell-SoundTheory

This comment was marked as off-topic.

@jw3126
Copy link
Contributor Author

jw3126 commented Jan 17, 2023

@jw3126 I'd love to do that. Unfortunately I'm knee-deep into a C++ project at the moment and switching to a Julia context would require some effort. But maybe we could meet for a play date some time and discuss the issue when the kids are busy?

Yeah sounds good!

@chakravala

This comment was marked as off-topic.

@ATell-SoundTheory

This comment was marked as off-topic.

@chakravala

This comment was marked as off-topic.

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

Successfully merging this pull request may close these issues.

3 participants