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

  • Home
  • SEARCH
  • 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 6677425
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:07:06+00:00 2026-05-26T04:07:06+00:00

I tested writing to a text file simply via shell command or php. Using

  • 0

I tested writing to a text file simply via shell command or php. Using a while loop for 1 million cycles, appending cycle number into the file (as $i\n). I thought this must be fastest way to store data on the disk. Where in shell or php, it took about 40s for 1 million records.

Alternatively, I used fast key/value databases such as QDBM, GDBM, etc. The overall time was even lesser (15-30s). What is the theoretical explanation for faster storage of data via simple database systems? I thought the rate-limiting should be hardware (e.g the speed of hard disk or CPU).

Another Question: When increasing the cycle from 100k to 1M, the overall time was increased 10 times; but when increasing from 1M to 10M, it took 100 times longer. What threshold makes the system slow this way?

  • 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-26T04:07:07+00:00Added an answer on May 26, 2026 at 4:07 am

    The bottleneck for writing data to disk is usually the disk I/O. The fastest continuous output can be achieved when writing contiguous blocks to the disk(s).

    I assume that the file was opened and closed 1 million times in your shell script. Each close issues a synchronization of the file to disk, which probably causes a wait (depending on file system and storage solution).

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

Sidebar

Related Questions

I am writing web portal for mobile phones using .net framework, I have tested
I was writing a pluginable function when I noticed the following behavior (tested in
I have tested the below script on a demo page which is not using
I've been writing a simple text-editor in HTML5 that is supposed to work offline.
I'm writing a web-application for the first time. Everything was tested in Chrome. And
While writing a function in Racket I accidently put two single quotes in front
I am writing a web based application using Ruby on Rails. In one of
I'm writing a very simple text editor and have run into a somewhat minor
I'm writing an application in PHP that uses forms to retrieve the username and
I am using this article of architecture http://blog.extjs.eu/know-how/writing-a-big-application-in-ext/ in my code: I have this

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.