Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Writing Type-Stable Code in Julia (johnmyleswhite.com)
5 points by antimora on Dec 8, 2013 | hide | past | favorite | 1 comment


Nice blog post. One thing I would add is that we could optimize the performance problem by peeling one iteration off the front of the loop, thereby making the rest of the loop type-stable. However, this exposes another problem with this code – the return type of the function depends on the value of n: for n ≤ 0 it returns an Int, while for n > 0 it returns a Float64. Thus, even though we could make this code run faster, any code calling this function would have to code with its poor type behavior in turn.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: