SpringtideCollectiveOrg / openhousens.ca

Easily track what's said in Nova Scotia's Legislature
http://openhousens.ca/
MIT License
8 stars 4 forks source link

common words is slow #51

Closed johnfelipe closed 9 years ago

johnfelipe commented 9 years ago

https://github.com/mysociety/sayit/issues/488, answer is: https://github.com/mysociety/sayit/issues/488#issuecomment-104872264, how fix that slow issue?

jpmckinney commented 9 years ago

It's exactly as Matthew Somerville wrote in that issue. Don't do Speech.objects.all(). Take a subset of all speeches if you want to create the word cloud in a web request. This repository takes only one hansard: https://github.com/SpringtideCollectiveOrg/openhousens.ca/blob/master/legislature/views.py#L59 Or instead, as Matthew suggests, build the word cloud outside a web request.