I think his question can be rephrased as "is the module scope in Julia a 
global scope?" and "if it is, then do modules share the same global scope, 
or they have there own global scopes?"



On Monday, March 23, 2015 at 3:43:08 PM UTC+1, Stefan Karpinski wrote:
>
> In case you haven't read them already, the usual performance tips are here:
>
> http://julia.readthedocs.org/en/latest/manual/performance-tips/
>
> The first and foremost being that using non-constant globals is a 
> significant trap.
>
> On Mon, Mar 23, 2015 at 3:17 PM, Michael Bullman <[email protected] 
> <javascript:>> wrote:
>
>> Hi All, 
>>
>> So I recently translated a program from Python using PyPy to julia. I was 
>> hoping to see some speed improvements with the move, but instead I have a 
>> seen a fairly significant speed decrease. Which I'm thinking is more user 
>> error than language differences. 
>>
>> for the python program I'm able to call it directly as "pypy 
>> load_balancer_sim.py" and it will run automatically and complete. 
>>
>> With Julia, since I developed it using the suggested Module 
>> method/procedure I open julia then load the module, then call the relevant 
>> method. All from the REPL, then the program runs. I'm noticing this takes 
>> significantly more time to run. I'm thinking two things could be having a 
>> major impact. 
>>
>> 1) it's still inside the module wrapper
>> This should be a relatively easy fix since I should just have to remove 
>> the top and bottom lines of code. 
>>
>> 2) I'm calling it from the REPL. 
>> Initially I didn't think this would have much of a difference, but I'm 
>> wondering if this introduces unnecessary overhead. 
>>
>> Then just sorta related to this general question of calling a script from 
>> the command line directly, does Julia have a way to run a main method? In 
>> python I know you can use syntax similar to 
>>
>> "if __name == '__main__':
>>    code code code
>> "
>>
>> And the script will automatically run that bit of code when called. Is 
>> there a similar syntax in Julia?
>>
>> Thank you all for any help
>>
>
>

Reply via email to