I move functions declared in models... Since all my models files seems to
be executed (looking to models_to_run), these functions are accessible from
everywhere (globals)...

Now I import all the moved functions in the same models they were
commenting the old declarations and I get some speed improvement... So I
guess they (functions) are imported only once as you said Niphold...

@Jose, not exactly, more this :

[*Slow*]
models/
  global_functions.py (functions declared old implementation)

[*Faster*]
models/
  global_functions.py (import from modules/global_functions.py)

modules/
  global_functions.py (functions are declared here now)

Richard

On Sun, Mar 29, 2015 at 7:53 PM, Jose <[email protected]> wrote:

> Hi
>
> [*1*]
> models/
>     model1.py
>     model2.py
>     model3.py
>     model4.py
>
> vs
>
> [*2*]
> modules/
>     model1.py
>     model2.py
>     model3.py
>     model4.py
>
> models/
>     model0.py (import model1, model2, model3, model4)
>
>
> You say [2] is more efficient than [1]?
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to