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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T13:06:15+00:00 2026-05-27T13:06:15+00:00

I am designing, for my A2 Computing project, an application to simulate the response

  • 0

I am designing, for my A2 Computing project, an application to simulate the response of a variety of filters. One problem I’m having is that the export data option is really slow.

Normally, when generating data to show on the display it’s about 40000 – 80000 points/sec. When recording it to a file, it drops to about a fifth of that.

Initially I thought my problem was because I was calling writeln on every data point. So I wrote it such that it queued the data up into a string and every 1000 points it wrote it in one big operation. It made it slightly faster, but still around 4-5x slower as displaying it on the built in form.

Why might this be?

Here’s the export code:

   for xx := 0 to npoints do
   begin
     freq := minfreq + ((xx / npoints) * maxfreq);
     ampl := GetAmplPoint(freq);
     phase := GetPhasePoint(freq);
     tempstr := tempstr + FormatFloat('#.#####', freq) + ',';
     tempstr := tempstr + FormatFloat('#.#####', ampl) + ',';
     tempstr := tempstr + FormatFloat('#.#####', phase) + sLineBreak;
     // Queue up to 1000 points, then write the data in one lump:
     // most of the time is spent in writeln waiting for IO which
     // slows down export.
     if xx mod 1000 = 0 then
     begin
       write(fileptr, tempstr);
       tempstr := '';
       ProgressBar.Position := 4 + Trunc((xx / npoints) * 96);
     end;
   end;
  • 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-27T13:06:16+00:00Added an answer on May 27, 2026 at 1:06 pm

    Disk I/O is one of the slowest bottlenecks today, especially if you use slow disks (i.e. the 4200/5400 rpm disks found on many laptops).

    Better perfomance can be obtained using buffered I/O (old pascal I/O functions were designed long ago, and may use small buffers, better to use one of the buffered streams available today in Delphi) or asynch I/O (you pass the buffer to write to the OS, the call returns immediately and later the OS will tell you when it had written the data).

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

Sidebar

Related Questions

I have a web application that is deployed on WebSphere and that use one
please help, im designing a contact book as a project and i'm having compiling
While designing a table my colleague here says that I should avoid identity column
I have problem designing pseudo-code for these problems. It is not an assignment problem.
Designing my stratified sample library(survey) design <- svydesign(id=~1,strata=~Category, data=billa, fpc=~fpc) So far so good,
A two parter: 1) Say you're designing a new type of application and you're
I seem to enjoy designing new UIViews and UIControls that implement their own -drawRect:
When designing a specialized structured-data document format (perhaps upon XML): part of the requirements
I'm designing a C#/NHibernate website that features a private messaging system. I would like
I'm writing a database front-end that so far relies on a data access layer

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.