Re: String or Numeric Variable?
- From: "Alfie [UK]" <me@xxxxxxxxxxx>
- Date: Fri, 28 Oct 2005 23:59:49 +0100
On Fri, 28 Oct 2005 16:27:55 -0500, "ProfitMaxTrading.com"
<nospam@xxxxxxxxxx> wrote:
>Cool.
>
>Thanks Alfie.
>
You're welcome.
I just did a scratch test [254,000 unit loop, comparing both same and
different datatypes, compiled native ('favour Pentium' off) EXE] and
LONG CONSTs appear to be faster than BYTE or INTEGER (LONG CONSTs being
an average 3% quicker than BYTE CONSTs).
Obviously for best performance you have to compare the same datatype or
VB's type coercion (ETC!) will have an impact (average 5% diff in speed
testing a LONG CONST against a BYTE, as opposed to the faster LONG CONST
against a LONG).
By the way, using an ENUM in the same situation had the same speed as
the LONG CONST method, so that would seem to show that ENUMS are
optimized in the same way as LONG CONSTs (considering ENUMs use LONGs as
their datatype that makes sense - so a variable of an ENUM type is also
optimized).
As an extra aside, the 'favour Pentium Pro' compile option makes a
slightly slower EXE (1% slower) in all cases doing this simple test on
my P4 CPU.
There's obviously some 32-bit system optimization going on for LONGs
even in compares, so as I said before if memory usage isn't an issue use
LONGs by default.
--
Alfie
<http://www.delphia.co.uk/>
Oops? What do you mean Oops?! We're trying to prevent the extinction of the species here! Don't tell me oops!
.
- References:
- String or Numeric Variable?
- From: ProfitMaxTrading.com
- Re: String or Numeric Variable?
- From: ProfitMaxTrading.com
- Re: String or Numeric Variable?
- From: Alfie [UK]
- Re: String or Numeric Variable?
- From: ProfitMaxTrading.com
- String or Numeric Variable?
- Prev by Date: Re: String or Numeric Variable?
- Next by Date: vbPrnDlg: Collate display bug.
- Previous by thread: Re: String or Numeric Variable?
- Next by thread: Re: String or Numeric Variable?
- Index(es):