Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • GraceDB Client GraceDB Client
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 6
    • Issues 6
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 1
    • Merge requests 1
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • IGWN Computing and Software
  • GraceDB
  • GraceDB ClientGraceDB Client
  • Merge requests
  • !10

Introduce an experimental rewrite using requests module

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Leo P. Singer requested to merge leo-singer/gracedb-client:requests into master Feb 02, 2017
  • Overview 7
  • Commits 2
  • Changes 5

(Note: please merge !9 (merged) first.)

This is an experimental, partial rewrite of the REST client that uses the Python requests module, which brings performance gains due to connection pooling and generally cleaner implementation. The speedup is impressive:

In [2]: old, new = rest.GraceDb(), requests.GraceDb()

In [3]: %timeit old.event('G211117')
1 loop, best of 3: 391 ms per loop

In [4]: %timeit new.event('G211117')
1 loop, best of 3: 88.5 ms per loop

In [5]: %timeit old.writeLog('T271297', 'foobar')
1 loop, best of 3: 688 ms per loop

In [6]: %timeit new.writeLog('T271297', 'foobar')
1 loop, best of 3: 286 ms per loop

In [7]: %timeit old.writeLog('T271297', 'foobar',
   ...: filename='bayestar.fits.gz')
1 loop, best of 3: 5.22 s per loop

In [8]: %timeit new.writeLog('T271297', 'foobar',
   ...: filename='bayestar.fits.gz')
1 loop, best of 3: 1.31 s per loop
Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: requests