From: Jim Mack on
Jim Mack wrote:

Sorry, that should be a ZIP file:

http://www.microdexterity.com/other/bendian.zip

From: Mike Williams on

"Jim Mack" <jmack(a)mdxi.nospam.com> wrote in message
news:eNIkdjuwKHA.732(a)TK2MSFTNGP06.phx.gbl...
> Jim Mack wrote:
> Sorry, that should be a ZIP file:
> http://www.microdexterity.com/other/bendian.zip

I'm getting very fast times out of that, Jim. It won't run when used as a
declared function, declaring and calling it as Endian4Dec as shown in your
notes, when it crashes the compiled exe and Windows pops up its "app has
stopped working" box, but it runs fine when Typelib-exposed using Project /
References. Here are the relevant timings (per iteration) when using exactly
the same test loop as I used before on the same Celeron laptop.

0.058 microseconds for Nobody's VB code method
0.026 microseconds for wsock32.dll method
0.018 microseconds for the VB code method posted by Donald Lessau
0.005 microseconds for Jim Mack's DLL

Mike


From: Jim Mack on
Mike Williams wrote:
>
> I'm getting very fast times out of that, Jim. It won't run when
> used as a declared function, declaring and calling it as Endian4Dec
> as shown in your notes, when it crashes the compiled exe and
> Windows pops up its "app has stopped working" box, but it runs fine
> when Typelib-exposed using Project / References. Here are the
> relevant timings (per iteration) when using exactly the same test
> loop as I used before on the same Celeron laptop.
>
> 0.058 microseconds for Nobody's VB code method
> 0.026 microseconds for wsock32.dll method
> 0.018 microseconds for the VB code method posted by Donald Lessau
> 0.005 microseconds for Jim Mack's DLL

Hmmm. Well, I wonder if I could track down the earlier thread where
people were seeing slightly slower times for the ASM code vs optimized
VB code. I thought it was the same vbspeed code we're using here, but
maybe there's something even better out there.

As far as the Declare not working... I have no trouble with it here.
Let me cut and paste the actual Declare I used rather than the one I
typed into the text file. I see that one got word-wrapped along the
way:

Private Declare Function Endian4Dec Lib "bendian.dll" _
Alias "Endian4" (ByVal Swapp As Long) As Long

On my machine, it runs 4x faster when exposed via typelib vs a
Declared function. Win 2K, single Celeron @2.2 GHz.

--
Jim Mack
Twisted tees at http://www.cafepress.com/2050inc
"We sew confusion"

From: MM on
On Sat, 13 Mar 2010 14:15:44 -0500, "Jim Mack" <jmack(a)mdxi.nospam.com>
wrote:

>MM wrote:
>> On Sat, 13 Mar 2010 12:41:10 -0500, "Jim Mack"
>> <jmack(a)mdxi.nospam.com> wrote:
>>
>>> Mike Williams wrote:
>>>>
>>>> ?? 18 secs for 1 million ?? Presumably you mean 18 milliseconds?
>>>
>>> Probably not. It's guaranteed to be slower, but not by that much.
>>>
>>> There's simply no way that making 4 external ASM calls, especially
>>> to a Declared function, is going to beat optimized, compiled VB6.
>>> I don't believe it.
>>
>> I did it. It does.
>
>Are you doing this compiled to native code with all optimizations?

No, I was running in the IDE when I ran the comparison speed tests. I
ran them each 3x and each time the result was 18s for the shifts and
19s for the SwapEndian08 (per million iterations = For/Next loop).

>Just for comparison, try this:
>
> http://www.microdexterity.com/other/bendian.dll

I will tomorrow. I'm too tired now. It's bedtime!

>Read the text file first. I don't know what's different this time, but
>I get a 40% speed advantage using the ASM code over the Swap08 code.
>The last time we tried this people reported a 10% disadvantage IIRC.

MM
From: Mike Williams on
"MM" <kylix_is(a)yahoo.co.uk> wrote in message
news:h45op5te0ksqhdm93451apmuqjkvsejbbh(a)4ax.com...

> No, I was running in the IDE when I ran the comparison
> speed tests. I ran them each 3x and each time the result
> was 18s for the shifts and 19s for the SwapEndian08
> (per million iterations = For/Next loop).

You're not going to get much in the way of speed when running "top heavy"
code in the IDE or as pcode. You need to be running it as a native code
compiled exe.

Mike



First  |  Prev  |  Next  |  Last
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Prev: VB 6 & VS?
Next: C:\WINDOWS\system32\ieframe.dll\1