Friday, 15 April 2011

python - Speed up feedparser -


I am using feedparser to print the top 5 Google News titles. I get all the information from the URL as always.

  x = 'https://news.google.com/news/feeds?pz=1&cf=all&ned = me & amp; HL = N and theme = T & amp; Output = RSS 'feed = FP. PRS (X)   

My problem is that when I start the shell, so that the interval of ~ 2 seconds is quite upset. Is this time mainly due to the communication being delayed by the network or is it parsing the file?

If this is by parsing the file, then do I have to take it only (since this is too little the case)?

If it is in pre-prospect, then is there any way to speed up this process?

I think some delay is increasing:

  • Python interpreter module requires some time to initialize and import
  • network communication bit
  • parsing may only consume a little while but it

    I think there is no direct way to speed things up, especially not the first point. My suggestion is that you can store your feed regularly (you can set a cron job or write a python daemon) and store it anywhere on your disk (somewhere a plain text file) so that you can They need to be displayed on their terminal. Startup (echo would probably be the easiest and fastest).

    I have personally experienced feedback with the feeders, I use it every half hour to download ~ 100 feed with Python Damon.

No comments:

Post a Comment