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 6065671
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:24:59+00:00 2026-05-23T09:24:59+00:00

I have a gzip’d pickled file that is 4mb in size. Each time I

  • 0

I have a gzip’d pickled file that is 4mb in size. Each time I open the file and load it the time it takes to unpickle takes longer. The contents of the file never change and the size stays the same.

Test Times:
1st Run: 27.5s
2nd Run: 44.1s
3rd Run: 52.7s

The code I’m using is as follows:

f = gzip.open( filepath, "rb" )
pickleFile = cPickle.Unpickler( f )
paData = pickleFile.load()
f.close()

Any idea why it is taking longer to load each time I run?

  • 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-05-23T09:24:59+00:00Added an answer on May 23, 2026 at 9:24 am

    I created two test pickle file 3MBs and 22MBs, and zipped it.

    I don’t understand what you are doing because I just did a test and this code:

    def get_time():
        return int(time.time())
    
    while(count < 10):    
        filepath='/home/shared/word_out.gz'
        start = get_time()
        f = gzip.open( filepath, "rb" )
        pickleFile = cPickle.Unpickler( f )
        paData = pickleFile.load()
        f.close()
        end = get_time()
    
        print 'Time ellapsed' , end - start
        count+=1
    

    Always prints out the same as I run it.

    3 MB File:

    Time ellapsed 1
    Time ellapsed 1
    Time ellapsed 0
    Time ellapsed 1
    Time ellapsed 1
    Time ellapsed 0
    Time ellapsed 1
    Time ellapsed 1
    Time ellapsed 0
    Time ellapsed 1
    

    22MB File:

    Time ellapsed 5
    Time ellapsed 4
    Time ellapsed 2
    Time ellapsed 2
    Time ellapsed 3
    Time ellapsed 2
    Time ellapsed 3
    Time ellapsed 2
    Time ellapsed 2
    Time ellapsed 2 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a text file that is 310MB in size (uncompressed). When using PerlIO::gzip
I have a gzip file that is in memory, and I would like to
I want to use GZIP files to reduce the page load time. I have
I have a gzip file and I am trying to read it via Python
I have a simple function to create a gzip file. This function work fine
I have gigabytes of data that would be nice to compress with gzip for
I have an script that will show some compress options to the user (gzip,
I have method to compress file with GZip: public static void CompressFile(string filePath) {
I have a web service that is willing to output gzip/deflated data. I've verified
How can we GZip every file separately? I don't want to have all of

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.