Thread View: borland.public.delphi.language.basm
2 messages
2 total messages
Started by Kevin Urben
Mon, 09 Jun 2008 09:52
Execution time varies with same data ...
Author: Kevin Urben
Date: Mon, 09 Jun 2008 09:52
Date: Mon, 09 Jun 2008 09:52
32 lines
2621 bytes
2621 bytes
Hi, I am writing an application which analyses video data from a monochrome camera. I am using Delphi 5 and 7 but use the built-in assembler to do time-critical stuff. I try to do my calculations in less than 1 frame period, so that the application can keep up with the camera frame rate. In one mode I am having problems - in this mode the calculations are heavily dependant on one procedure, which calculates the integral of intensity along a line joining two points in the image. This procedure uses bilinear interpolation to calculate the intensities along the line based on the values of neighbouring pixels. In other words, it is floating-point intensive. The problem is that this procedure seems to run at two different speeds, depending on the time of day, the weather, and whether the stock market is rising or falling. I have a test loop that calls the procedure 100 times, which is triggered by a button on a form. I get two very different times depending on whether I click the button, or activate it using the spacebar (if it has focus). In one case the execution time is about 1/2 the other case. I use a standard video image to do the benchmarking. I have two versions of this procedure, a high level version and one hand-coded in 80387 code (yes - I have been told that so last-century and SSE is the way to go ...) Both show the timing variations, but the asm one has the largest % difference.. You guys here seem to be experts in timing code - so I wondered if you have any suggestions !! BTW, I am using Windows XP running on a Dell Latitude D830 laptop with Intel Core 2 Duo 2MHz processor (T7300) and 2GB RAM. Thanks in advance for any help !
Re: Execution time varies with same data ...
Author: Kevin Urben
Date: Mon, 09 Jun 2008 10:32
Date: Mon, 09 Jun 2008 10:32
8 lines
1391 bytes
1391 bytes
Sorry, I should clarify: My test loop calls the "recalculate everything" procedure 100 times, but each recalculation calls the LineIntegral function about 400 times. The total elapsed time for the test is about 3.5 seconds when things go quickly, and about 7 seconds on a slow run ! I do not get intermediate times ! (Well, of course, there are small variations around these times depending on other processes.)
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads