Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7775695
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T17:41:53+00:00 2026-06-01T17:41:53+00:00

I’ve a HTTP server written in Python that accepts a large binary file (>50MB)

  • 0

I’ve a HTTP server written in Python that accepts a large binary file (>50MB) and performs some file related computation (decryption, decompression …) on the file. I want to get a good estimate of the the amount of time it takes to execute these operations. My python server is running on a multi CPU and multi core server on Ubuntu 11.10.

Currently I’m just doing a time diff of (date.now() to get the execution times for various operations. I know there are couple of Python modules that provide profiling capabilities. However, my understanding is they are limited to small code snippets only.

What are my other options ?

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T17:41:54+00:00Added an answer on June 1, 2026 at 5:41 pm

    I’d say that cProfile is pretty solid, and definitely an improvement on using something like date.now(). Here is what cProfile produces for a comparison of a useless and slightly less useless fibonacci generator.

    $ python -m cProfile script.py
             4113777 function calls (1371305 primitive calls) in 1.337 seconds
    
       Ordered by: standard name
    
       ncalls  tottime  percall  cumtime  percall filename:lineno(function)
            1    0.000    0.000    0.000    0.000 cProfile.py:5(<module>)
            1    0.000    0.000    0.000    0.000 cProfile.py:66(Profile)
            1    0.009    0.009    1.337    1.337 script.py:1(<module>)
    2692508/30    1.069    0.000    1.268    0.042 script.py:3(fib)
    74994/25000    0.058    0.000    0.058    0.000 script.py:9(fibber)
      1346269    0.200    0.000    0.200    0.000 {max}
            1    0.000    0.000    0.000    0.000 {method 'disable' of '_lsprof.Profiler' objects}
            2    0.001    0.000    0.001    0.000 {range}
    

    Here is the code I used:

    import cProfile
    
    def fib(num):
        if num < 3:
            return max(num, 1)
        return fib(num - 1) + fib(num - 2)
    
    fibdict = {0:1, 1:1, 2:2}
    def fibber(num):
        if num not in fibdict:
            n = fibber(num - 1) + fibber(num - 2)
            fibdict[num] = n
        return fibdict[num]
    
    a = [fib(i) for i in range(30)]
    b = [fibber(i) for i in range(25000)]
    

    cProfile pretty clearly tells me how slow fib is running, and gives me nice data on time per call / number of calls, as well as how much total time was spent in the method. Obviously this is trivial/toy code, but I regularly use cProfile to get a feel for where my code is spending the most time, and I have found it very effective for non-trivial code. I would imagine it would give you the data that you need.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have just tried to save a simple *.rtf file with some websites and
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I want use html5's new tag to play a wav file (currently only supported
I have a French site that I want to parse, but am running into
In my XML file chapters tag has more chapter tag.i need to display chapters

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.