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

Remove _insight debug flag base.jl or document/improve it #138

Open
akabla opened this issue Aug 18, 2021 · 3 comments
Open

Remove _insight debug flag base.jl or document/improve it #138

akabla opened this issue Aug 18, 2021 · 3 comments

Comments

@akabla
Copy link
Member

akabla commented Aug 18, 2021

There is a default keyword parameter in all objective function call. I suspect this causes a significant overhead.
We should remove it and benchmark the code performance.
A global const debug flag might be used if we really need one there.

@akabla akabla added this to the 0.9.5 milestone Aug 18, 2021
@akabla akabla self-assigned this Aug 18, 2021
@moustachio-belvedere
Copy link
Member

I found it very useful on numerous occasions, especially when fits are not going well I found it it to be invaluable. I think Ale @Ab2425 did too from memory, but we would have to check with her.

If on benchmarking a const global is similar performance then that has some benefits in that it makes the code cleaner and could easily be used in other functions as well. However, a major drawback of being a const global is that it is const, and thus can't be changed by the user. So it becomes enforced as a feature only usable by those comfortable enough with Julia to investigate RHEOS internals and would force recompilation of the module each time it was changed. Both implications are undesirable.

Would be curious to know what overhead it adds. My bet would be that its presence as a parameter is negligible. The branch in the function body may add a little more overhead but this would still be required if we used a const global. Also, I would expect the branch to be negligible compared to mittleff, convolution and any other operation we perform over large arrays. Branches like that can often occur in one CPU instruction Vs many for array operations.

@akabla
Copy link
Member Author

akabla commented Aug 21, 2021

I agree that when a complex function is called, this is probably insignificant. Maybe we should think more broadly about how to assist the user tracking how the optimisation evolves. It is indeed useful. Maybe we could make it feature!

@akabla akabla changed the title Remove _insight debug flag base.jl Remove _insight debug flag base.jl or document/improve it Aug 21, 2021
@moustachio-belvedere
Copy link
Member

moustachio-belvedere commented Nov 13, 2021

Thinking about this again recently:

Maybe we could make it feature

It's a feature already; it's not extensively documented but it is in the API section, which is enough I think. Maybe we could add it to an example.

Maybe we should think more broadly about how to assist the user tracking how the optimisation evolves

I was reading about this the other day -
https://docs.julialang.org/en/v1/stdlib/Logging/
the @info macro could be one way to extend logging as a more general feature. From a 1 minute exploration, I don't like how much extra noise comes with it (2 lines output for each invocation of the macro) because it means more mess when printing out lots parameter iterations. But something to explore further, I'm sure there's room for customization. We should also benchmark.

@akabla akabla modified the milestones: 0.9.5, 0.9.6 Jan 4, 2023
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

2 participants