In order to reproduce we would actually need the script main.jl.
However,
The problem might be just that.
You should move what you are doing in main.jl to a function:
function main(w,i,j,k,c)
...
end
for instance.
In this case you only need to include("main.jl") once, and outside the loop.
In the loop you just call the main(w,i,j,k,c) function.
This section in the manual is very good for performance tips: Performance Tips · The Julia Language
Following performance tips, you might want to put your loops inside another function as well.