django - Python - Can a web server avoid imporing for every request? -


i'm working on python project, using django, quite bit of nlp work in form post process. i'm using nltk package, , profiling code , experimenting i've realised majority of time code takes performing import process of nltk , various other packages. question is, there way can have server start up, these imports , wait requests, passing them function uses imported packages? faster , less wasteful performing such imports on every request. if has ideas avoid importing large packages on every request, it'd great if me out!

thanks, callum

django, under deployment mechanism, not import modules every request. development server reloads code when changes. don't know how you're verifying imports re-run each time, shouldn't happening.


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -