Re: Coverage Calculation Speed in VBA, VB, C# and C++
- From: Honest John <kestrel.super@xxxxxxxxxxxx>
- Date: Mon, 04 May 2009 13:42:22 +0100
fairbros@xxxxxxxxxxx wrote:
Nigel
The usual mistake I've come across even with programmers who should
know better is to declare an array that has say, 13,983,616 elements
as long when if the values it holds is less than 256 then byte or
short is OK.
I have noticed Excel users declaring double variables for no good
reason when only integers are involved. I put it down to force of
habit dealing with cents or pennies. If it has not much effect on the
timing of the routine then it doesn't really matter.
With Michael' s code I will add an array or vector to flag the blocks
as covered or not which takes up a bit of memory, when I do the
timings for the other languages and there are a couple of minor
optimizations I will include which reduce the time for calculating
lower blocks. Definitely, we must now measure in micro seconds maybe
even nano.
I was in a state of shock when I made the last post so I read the
wrong figure - instead of 2.6 secs it should have been 6.52 sec down
from 31 mins for VBA. Let me just spell that out - FROM 1860 secs TO
6.52 secs or 285 times better in Excel or Access. I confidently
predict that the crown for King of Coverage Speed Calculation will
pass from John Rawson, Esquire to Michael Harrington, a fellow
Australian, photons or no photons.
Give over :-)
CM checks the single 44,45,46,47,48,49 in a fraction of a second (about 0.2 seconds here). And that's using code to check any number of tickets. With respect to Michael, the code he's given only checks one line, which is what you asked for.
Modify it to check any wheel and see what you think of the speed. Then you can modify your prediction :-)
John
.
- Follow-Ups:
- Re: Coverage Calculation Speed in VBA, VB, C# and C++
- From: fairbros
- Re: Coverage Calculation Speed in VBA, VB, C# and C++
- From: fairbros
- Re: Coverage Calculation Speed in VBA, VB, C# and C++
- References:
- Coverage Calculation Speed in VBA, VB, C# and C++
- From: fairbros
- Re: Coverage Calculation Speed in VBA, VB, C# and C++
- From: Michael
- Re: Coverage Calculation Speed in VBA, VB, C# and C++
- From: nigel
- Re: Coverage Calculation Speed in VBA, VB, C# and C++
- From: fairbros
- Coverage Calculation Speed in VBA, VB, C# and C++
- Prev by Date: Re: Coverage Calculation Speed in VBA, VB, C# and C++
- Next by Date: Re: How Wheeling Works
- Previous by thread: Re: Coverage Calculation Speed in VBA, VB, C# and C++
- Next by thread: Re: Coverage Calculation Speed in VBA, VB, C# and C++
- Index(es):
Relevant Pages
|