Optimize Julia version of ktruss#6
Open
andreasnoack wants to merge 2 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Some of these optimizations are Julia specific but some of them are storage specific so they might also benefit the Matlab version. I've also cleaned the code for most Matlabisms. I've tried to keep the overall style of the code and avoided e.g. preallocating memory. The might be a significant saving in preallocation and it is a feature where Julia shines relative to Matlab so it might be worth doing. I timed this with Julia 0.6 which is in beta and will be released soon. It is slightly faster than Matlab for the small benchmark. Much of the time is spent in sparse matrix multiplication so it might also be worthwhile to consider https://github.com/JuliaSparse/MKLSparse.jl since it would give mulithreaded sparse matvec (and is probably what Matlab does) but I haven't tried that.