Two quick pieces of advice: Try
@code_warntype Jakes_Flat( 926, 1e-6, 50000, 0, 1, 0 ) For some reason, the type of the variable "h" is not being inferred tightly (i.e. it has type any). If you can sort things out so that h is typed more concretely, I suspect you'll be able to match matlab's performance. However, if you're going for speed, this code is begging to be devectorized. It creates tons of fairly large intermediate arrays. In Julia, don't be afraid of for loops. It may actually be easier to devectorize the code than it will be to find and fix the typing issue in the original, because the original uses some fairly complicated array concatenation.