This is exactly the problem with Julia, to achieve those (soo much vaunted) c-like-speeds you need quite a few contortions.
Sometimes, a function really is performance critical so you spend a ton of time fiddling with it to make it blazing fast, other times you write something non-optimal but straightforward. It's all the same language though, and unlike tools like Cython, you don't lose all your nice high level language features when you drop down to 'high performance julia code'.