Skip to content

Instantly share code, notes, and snippets.

@flavioamieiro
Created October 22, 2015 15:18
Show Gist options
  • Save flavioamieiro/89d9ea3e0f386e0bf353 to your computer and use it in GitHub Desktop.
Save flavioamieiro/89d9ea3e0f386e0bf353 to your computer and use it in GitHub Desktop.
Wrote profile results to benchmarking.py.lprof
Timer unit: 1e-06 s
Total time: 0.815547 s
File: pypln/backend/celery_task.py
Function: run at line 48
Line # Hits Time Per Hit % Time Line Contents
==============================================================
48 @profile
49 def run(self, document_id):
50 """
51 This method is called by Celery, and should not be overridden.
52 It will call the `process` method with a dictionary containing all the
53 document information and will update de database with results.
54 """
55 100 38361 383.6 4.7 document = document_collection.find_one({"_id": document_id})
56 100 679170 6791.7 83.3 result = self.process(document)
57 100 97895 979.0 12.0 document_collection.update({"_id": document_id}, {"$set": result})
58 100 121 1.2 0.0 return document_id
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment