動態加載APPS的可能性?

3 views
Skip to first unread message

SeedSeek

unread,
Jun 23, 2015, 11:08:24 PM6/23/15
to uli...@googlegroups.com
原本要在settings.ini 設定的apps 有沒有可能在用到時加載,沒用到時run server 不預加載,形成動態加載的模式?
動態加載有沒有需要reload ?

Chunlin Zhang

unread,
Jun 23, 2015, 11:11:37 PM6/23/15
to uli...@googlegroups.com
我猜不行...
预加载有什么问题吗?

On Wed, Jun 24, 2015 at 11:08 AM, SeedSeek <frt5...@gmail.com> wrote:
原本要在settings.ini 設定的apps 有沒有可能在用到時加載,沒用到時run server 不預加載,形成動態加載的模式?
動態加載有沒有需要reload ?

--
-- ----
Project : https://github.com/limodou/uliweb
doc : http://limodou.github.com/uliweb-doc
---
You received this message because you are subscribed to the Google Groups "Uliweb" group.
To unsubscribe from this group and stop receiving emails from it, send an email to uliweb+un...@googlegroups.com.
To post to this group, send email to uli...@googlegroups.com.
Visit this group at http://groups.google.com/group/uliweb.
To view this discussion on the web visit https://groups.google.com/d/msgid/uliweb/e0cafd10-52ed-41c4-9aa3-34b8db747fd2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

cnidance

unread,
Jun 24, 2015, 12:10:33 AM6/24/15
to uli...@googlegroups.com
感覺APPS 項目多的時候runserver 或auto-reload 會有些遲緩。動態加載也比較不占記憶體。


For more options, visit https://groups.google.com/d/optout.



--
~Ten ~

limodou

unread,
Jun 24, 2015, 12:39:01 AM6/24/15
to uliweb
目前是有问题的,因为有些东西象views之类的,要动态扫描获取url还有象settings.ini的处理也要在启动时加载。不过settings.ini只是文本,所以还好。但是url是动态读出来的。除非改为配置文件方式。动态加载也可以理解为延迟加载,不过目前对这个没有特别的考虑。你说的启动慢大概有多慢?是不是因为在views.py或__init__.py中有些特殊的代码造成的呢?我这里启动挺快的。大概137个app,启动不到1分钟。


For more options, visit https://groups.google.com/d/optout.



--
I like python!
UliPad <<The Python Editor>>: http://code.google.com/p/ulipad/
UliWeb <<simple web framework>>: https://github.com/limodou/uliweb
My Blog: http://my.oschina.net/limodou

cnidance

unread,
Jun 26, 2015, 1:02:24 AM6/26/15
to uli...@googlegroups.com
在伺服級的機器上reload 速度是還好,但不是天天都有那種機器可以在上面debug。
uliweb + socketio 會在記憶體上留一些socketio 的每個協程資訊,reload 時資訊會丟失。
能夠動態加載的話,可以省下一些記憶體、省下reload 時間、減少資訊丟失。
如果還能夠動態"卸載"就更棒了。


For more options, visit https://groups.google.com/d/optout.



--
~Ten ~
Reply all
Reply to author
Forward
0 new messages