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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T19:13:28+00:00 2026-06-12T19:13:28+00:00

We have a large number of Python bytearray strings of variable length which need

  • 0

We have a large number of Python bytearray strings of variable length which need to remain in memory. Wrt raw-performance, is a Python dictionary the most efficient in-memory storage for read-only random-access for the bytearray strings? The dictionary keys could be integers or strings. If not, what is better?

  • 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-12T19:13:30+00:00Added an answer on June 12, 2026 at 7:13 pm

    It all depends on how you intend to access them. If you just want to iterate through them, put them in a list. If you want to search for one by a key, use a dict. No matter what you use, you’ve already paid for the space for all of your bytearrays, the difference between list, dict, or something else will probably be minimal. A list will use something like 500,000 references at 4 bytes a piece = 2MB, a dict maybe a few times that.

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

Sidebar

Related Questions

I have a large number of objects which are identified by names (strings). So,
I have a large number of objects I need to store in memory for
I have a large number of files which I need to backup, problem is
I have a large number of data points which are two dimensional coordinates with
I have a python code in which I calculate a quantity for a large
I have a python process that is writing a large number of items into
I need to use Python to download a large number of URLS, but they
I have a Python script that needs to process a large number of files.
I have a large number of python file and I would like to generate
I have a large number of records (10,000, increasing every day) that essentially is

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.