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

performance suggestion make trees more type stable #155

Closed
oscardssmith opened this issue Feb 9, 2021 · 5 comments
Closed

performance suggestion make trees more type stable #155

oscardssmith opened this issue Feb 9, 2021 · 5 comments

Comments

@oscardssmith
Copy link

If you use Array{T<Anode,1} instead of Array{Anode}, the performance should be much better as the Array will have a concrete type. I'm not sure how much this would help performance, but it should be a free win.

@cecileane
Copy link
Member

Yes indeed. So Edge would be a parametric type then: Edge{T}. @crsl4 : this is worth a try, and see how it affects performance. After the concrete Node type is defined, we could define an Edge() constructor that creates an Edge{Node} by default. And other changes to avoid a big refactoring of the entire package.

@oscardssmith
Copy link
Author

One way around this would be to define EdgeT{T} and then alias Edge to EdgeT{Node} once Node is defined.

@crsl4
Copy link
Member

crsl4 commented Feb 9, 2021

Yes, I agree! This is definitely worth trying to see how it affects performance. Are you in the midst of any changes so that you can add this, or do you prefer if I make this change on my end?

@cecileane
Copy link
Member

There are 3 open pull-requests... so yes, definitely working on things. But git is here for us. You could make the changes on a branch, run examples locally to see how performance is affected, and then decide!

@crsl4
Copy link
Member

crsl4 commented Feb 9, 2021

sounds good!

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

No branches or pull requests

3 participants