Re: working with byte arrays

From: Mark Alexander Bertenshaw (mark.bertenshaw_at_virgin.net)
Date: 11/13/04


Date: Sat, 13 Nov 2004 14:51:08 -0000

J French wrote:
> On Sat, 13 Nov 2004 10:31:29 +0100, "Peter" <-> wrote:
>
>> Thanks, Rick
>> I like this solution because it is simple and easy, Thanks again
>> I haven't make any performance tests yet but I could think that it
>> would be faster than my current solution because the whole
>> comparisson is done inside InstrB(no VB loop is running).
>> Thanks for the hint to check the size of the arrays, in my project
>> all bytearrays start at index 0 therefore I just need to concentrate
>> on Ubound.
>
> One thing you will find is that when compiled (not in the IDE) VB
> Loops on Byte Arrays are /astonishingly/ fast
>
> I found this when comparing timing on my Delphi file sorting DLLs, to
> my amazement using callbacks to VB was pretty much the same speed as
> pure Delphi - and Delphi is often virtually unbeatable, even in ASM as
> it uses an optimizing compiler.

And in addition to what J French said, if you go to Advanced Compile options
and check "Remove Array Bounds check", then array access will be even faster
(you *do* check bounds when necessary in your code, don't you?).

--
Mark Bertenshaw
Kingston upon Thames
UK


Relevant Pages

  • Re: ruby programming best practice
    ... is there a way to find out these spots in my program, like a compiler do in Delphi/C. ... I will naturally assume arr is an array. ... In delphi, for example, such error is detected while compile, e.g.. ... I know Ruby works differently, but is there a way exists, like a normal compiler, or something like FxCop for the C# language? ...
    (comp.lang.ruby)
  • Dynamic Out of Bounds checking for array operator.
    ... Delphi has no way to access this via a dynamic array. ... the only problem is the compiler does not yet know the ... At compile time because the SetArrayBounds was not found for the array. ...
    (alt.comp.lang.borland-delphi)
  • [ANN] paxCompiler, v1.5
    ... Version 1.5 of the paxCompiler has been released. ... Array and record constant initializers. ... The compiler generates machine code for Intel compatible processors. ... The compiler was initially written in Borland Delphi as a set of Delphi ...
    (borland.public.delphi.thirdpartytools.general)
  • Re: StrPas question
    ... Actually now that I think about this, this could be seen as a bug;) ... I told delphi to copy "Hello" into an array and I did not tell delphi to ... >> When I talk about what the compiler does and does not do, ...
    (alt.comp.lang.borland-delphi)
  • Re: #NAME?
    ... If you are putting formulas in a french version, ... cells with an array and expect them to be translated as they would if you ... they are then interpreted by Excel. ... > them first in an array, then the array on a range... ...
    (microsoft.public.excel.programming)