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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T16:13:52+00:00 2026-06-11T16:13:52+00:00

I have written a c++ prog to query a 100 GB dictionary. I have

  • 0

I have written a c++ prog to query a 100 GB dictionary. I have split the dictionary into n number of files of equal size. All split-files are placed in the same dir. The dictionary is fully indexed, i.e., once a query comes I know which spit-file to open and where to seek. My question is for better performance, which split will be better:
(a) Small number of large files or (b) Large number of small files?
Also, what would be an ideal split?

  • 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-11T16:13:54+00:00Added an answer on June 11, 2026 at 4:13 pm

    I don’t think there’s a direct answer to that question. only experimenting can tell you. The cost of opening a file for read should be constant regardless of the size, reading the contents of the file is then of course dependant on the file size.

    There are other hints though
    I will assume that when you get a query, you open the file, parse/read it completly or until you find the word then close the file and return the result, in this case there are many enhancements to do, maybe you have them, maybe not, but here goes

    1. If you get alot of queries, opening files can be expensive, in this
      case you might need to cache your files, or your search queries for
      better performance
    2. When you open a file and read it, you are doing so sequentially, and this means that more or less the file is being loaded into the memory, I came once across a sax xml parser for java, which is able to load only the desired chunks of xml into memory, for handling really huge xml files, maybe there’s somehing similar for c++. SAX project

    check when is a file loaded into memory

    A total different approach would be to use a database with index. this problem you don’t have to deal with file opening problems

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

Sidebar

Related Questions

I have written a bash script which installs a number of packages, however for
I have written a java program generates lots of files (say txt files) in
I have written a very simple CTE expression that retrieves a list of all
I have written a raw binary image file into a buffer which is an
Have written the following code: m_selectCategoryTableWidget = new QTableWidget; m_selectCategoryTableWidget->setRowCount(0); m_selectCategoryTableWidget->setColumnCount(2); m_selectCategoryTableWidget->setHorizontalHeaderLabels(QStringList()<<tr(Category)<<tr(Number of items));
I have written a database query to extract information in ColdFusion and I want
I have written two queries. query 1: select stock_id from_id, nvl(lead(stock_id, 1, null) over
Have written all the code in a silverlight class library (dll) and linked this
I have the following query: var query = db.Prog .Where (a => a.Prog !=
I have written a simple random number generator in C. int l is the

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.