November 2017
Beginner
316 pages
6h 40m
English
Let's discuss some other tips for performance enhancements in Julia code:
Always try breaking a big function with multiple definitions (aka compound functions) into smaller functions with a clearer and more modular approach.
Write functions that must always return the value of a given data type, that is, their return type should always be one and shouldn't change with the change in input. A quick example of this can be as follows:
julia> function check_bigger(x:: Int64, y::Int64) if x < y return y elseif y < x return x else return "Both are equal" end end WARNING: Method definition check_bigger(Int64, Int64) in module Main at REPL[7]:2 overwritten at REPL[15]:2. check_bigger (generic function with 1 ...
Read now
Unlock full access