-
Notifications
You must be signed in to change notification settings - Fork 308
It takes a really long time to get a list of members for the gittip team #1417
Comments
Yep, |
Addressing scaling problems with the Infrastructure milestone as per IRC. |
I've decided to remove performance issues from the Infrastructure milestone (#1491, #1495, cf. #1585). Of course we need to address these, but we need to start getting Infrastructure over the hump, and we've got to cut weight from somewhere to do it. After Infrastructure is done, we can include related performance improvements in any focus on a specific part of the app (this one would fit under a focus on teams, for example), or in a specific focus on performance. |
Haven't benchmarked it but I suspect |
#!/usr/bin/env python
from gittip import wireup
from gittip.models.participant import Participant
wireup.db(wireup.env())
member = Participant.from_username('whit537')
team = Participant.from_username('Gittip')
print len(team.get_memberships(member)) |
Yeah. If I stub out |
Sorry, those were counting heroku config time. New numbers:
New script: #!/usr/bin/env python
import time
from gittip import wireup
from gittip.models.participant import Participant
env = wireup.env()
wireup.db(env)
member = Participant.from_username('whit537')
team = Participant.from_username('Gittip')
start = time.time()
print "{} members".format(len(team.get_memberships(member)))
print "{} ms".format(int((time.time() - start) * 1000)) |
So that would suggest a view materialization over |
@whit537 I'm reasonably sure the bottleneck is that we're not indexing the table properly. I can't verify it though, since fake data doesn't generate quality fake data :P In my tests, this reduces the cost for _mixin_team.py#L67-L72 from CREATE INDEX transfers_tipper_tippee_timestamp_idx
ON transfers
USING btree
(tipper, tippee, timestamp DESC); Should I submit a PR for someone to play with? I don't really know how changes to the database are handled. |
@rummik Sure, give us a PR. Make a |
@rummik That did it. :-) I applied the index in production and the page is much faster now: |
@whit537 Ah. Yeah, I wasn't sure where to put it. I probably have a couple more to add to the list, so I'll make a note of what file that all goes in when I'm working on that :) |
…o dockerfile * 'master' of https://github.com/gittip/www.gittip.com: Modify Vagrantfile to use a custom gittip image. Keep manual exchanges out of payday self-check Append index to schema.sql; gratipay#1417 Fix incorrect cd added to .profile in Vagrant provisioning. Give devs a little pointer re: branch.sql Remove os.environ from error handling test page Conflicts: README.md
Compared to:
That is more that 3 seconds spent somewhere in the backend. Both measurements where taken from the same network within a couple of seconds apart. I believe it is not a network problem because:
The text was updated successfully, but these errors were encountered: