Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API needs pagination #25

Open
vsoch opened this issue Jun 2, 2016 · 1 comment
Open

API needs pagination #25

vsoch opened this issue Jun 2, 2016 · 1 comment

Comments

@vsoch
Copy link
Contributor

vsoch commented Jun 2, 2016

There was a post on neurostars about the API, and I checked it out, and it seemed to load pretty slowly. I did a simple test:

  import time
  import requests
  import numpy

  times = []

  for i in range(100):
      print "loop %s of 100" %(i)
      start = time.time() 
      response = requests.get('https://openfmri.org/dataset/api/')
      end = time.time()    
      times.append(end-start)

  print "Average time is %s" %(numpy.mean(times))
  Average time is 5.94425868034

and it takes almost 6 seconds per load! I think this would greatly benefit with the addition of pagination!

@rwblair
Copy link
Collaborator

rwblair commented Jun 3, 2016

Good idea, thats pretty slow. I'll give pagination a try since its built into django rest framework. Looks like some one has made an add on that can cache api responses that I might add if pagination alone isn't good enough.
https://chibisov.github.io/drf-extensions/docs/#caching

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants