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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T01:13:32+00:00 2026-05-18T01:13:32+00:00

Is there any way to create Map or Set type data structures at compile

  • 0

Is there any way to create Map or Set type data structures at compile time?

The reason I ask this is because I’m working with App Engine and I have some data structures that need to be sorted and searched, but they’re constant, so I’d like to avoid the time cost of creating them at start-up.

  • 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-18T01:13:33+00:00Added an answer on May 18, 2026 at 1:13 am

    As with any kind of performance optimization, the first thing to ask yourself is whether the time taken to set up these structures at run time is really affecting performance. How big area your structures? How long do they take to set up? If you haven’t measured this you are engaging in premature optimization, which as we know is the root of all evil.

    Assuming you have done this, then let’s look at the options. How much time can you really save? Your best bet is to use some form of serialization, but you are going to have to write that yourself; even if you define a file format to hold the content, the file is going to have to be parsed, and the in-memory data structures will have to be created. That’s going to take time, and it’s unlikely to be substantially faster than just creating the Maps or Sets and populating them. In some languages you could theoretically save the bit pattern of the memory for these structures, but even if you can do that you are making yourself vulnerable to any little change in compiler version, and any errors you make will be virtually impossible to debug.

    In short, don’t do this unless you are sure you need to. Even then, you probably shouldn’t do this. The only time you should is if the (probably very small) saving of time will absolutely mean the difference between success and failure of your project.

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

Sidebar

Related Questions

Is there any way to create a virtual drive in (My) Computer and manipulate
Is there any way to create the query parameters for doing a GET request
Is there any way to create C# 3.0 anonymous object via Reflection at runtime
Is there any way to manually create fold points in code in Eclipse? I
Is there any easy way to create a class that uses IFormatProvider that writes
Is there any easy way to create an acronym from a string? First_name Middle_name
Is there any way in JavaScript to create a "weak reference" to another object?
Is there any way that I can programmatically create (and I guess access) hidden
If I create an application on my Mac, is there any way I can
Is there any feasible way of using generics to create a Math library that

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.