Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > microsoft.public.scripting.vbscript > #11589

Re: VbScript and .NET objects

From "Mayayana" <mayayana@invalid.nospam>
Newsgroups microsoft.public.scripting.vbscript
Subject Re: VbScript and .NET objects
Date 2017-03-15 21:38 -0400
Organization A noiseless patient Spider
Message-ID <oacq66$u4v$1@dont-email.me> (permalink)
References <55e1a84f.4061562@nntp.aioe.org> <mrsftt$lp0$1@dont-email.me> <aba91193-4e25-4433-9610-524fda5dee28@googlegroups.com> <oac1ll$cvj$1@dont-email.me>

Show all headers | View raw


"Mayayana" <mayayana@invalid.nospam> wrote

Woops. I had a typo in my code sample.

UB = 100000
 ReDim A1(i2)

  should have been

UB = 100000
Redim A1(UB)

  So that the array would start out at 100000.
The way I had written it the array started out
full size (6 million) and didn't need to be redimmed.
That was the same as my original code that you
questioned.

  Interestingly, I get almost the exact same
result with 60 Redim Preserve as I did with a
single Redim. The time was 6.187 seconds.

   I think what this demonstrates is just how
wasteful it is to concatenate repeatedly. But
joining an array is quick. An array is a natural
string builder. With concatenation or the method
you suggested, there will be 6 million
allocations of memory. With Redim A1(6000000)
there's only one allocation. With the gradual
building, 100K at a time, there are 60 allocations,
which is still a very small number.

   I expect the .Net methods are probably not too
inefficient, once they get going. But .Net itself
is a pig and none of it is known for speed. Like
Java, that's not the intended strength of .Net.
Rather, sandboxing and  ease of coding are the
intention. If .Net provided things that script can't
do, like a window component or maybe graphics
functions, that would be different. Unfortunately,
.Net breaks COM, making it mainly incompatible with
VBS. (What the heck were the Microsofties thinking
with that decision?!) As far as I know, .Net offers
nothing of value to script to offset the disadvantage
and sheer distastefulness of loading a barrel of slop
in order to run a script.


Back to microsoft.public.scripting.vbscript | Previous | NextPrevious in thread | Find similar


Thread

VbScript and .NET objects noone@no.void (Reventlov) - 2015-08-29 12:40 +0000
  Re: VbScript and .NET objects "Mayayana" <mayayana@invalid.nospam> - 2015-08-29 10:39 -0400
    Re: VbScript and .NET objects "Mayayana" <mayayana@invalid.nospam> - 2015-08-29 10:55 -0400
      Re: VbScript and .NET objects GS <gs@v.invalid> - 2015-08-30 12:25 -0400
        Re: VbScript and .NET objects "Mayayana" <mayayana@invalid.nospam> - 2015-08-30 12:55 -0400
          Re: VbScript and .NET objects GS <gs@v.invalid> - 2015-08-30 13:02 -0400
            Re: VbScript and .NET objects GS <gs@v.invalid> - 2015-08-30 13:10 -0400
              Re: VbScript and .NET objects "Mayayana" <mayayana@invalid.nospam> - 2015-08-30 13:42 -0400
                Re: VbScript and .NET objects GS <gs@v.invalid> - 2015-08-30 14:04 -0400
                Re: VbScript and .NET objects "Mayayana" <mayayana@invalid.nospam> - 2015-08-30 17:05 -0400
                Re: VbScript and .NET objects GS <gs@v.invalid> - 2015-08-30 17:14 -0400
          Re: VbScript and .NET objects "Dave \"Crash\" Dummy" <invalid@invalid.invalid> - 2015-08-30 21:45 -0400
            Re: VbScript and .NET objects "Mayayana" <mayayana@invalid.nospam> - 2015-08-30 23:09 -0400
              Re: VbScript and .NET objects "Dave \"Crash\" Dummy" <invalid@invalid.invalid> - 2015-08-31 07:40 -0400
                Re: VbScript and .NET objects "Mayayana" <mayayana@invalid.nospam> - 2015-08-31 09:50 -0400
    Re: VbScript and .NET objects johnbeschler@gmail.com - 2017-03-15 10:24 -0700
      Re: VbScript and .NET objects "Mayayana" <mayayana@invalid.nospam> - 2017-03-15 14:40 -0400
        Re: VbScript and .NET objects "Mayayana" <mayayana@invalid.nospam> - 2017-03-15 21:38 -0400

csiph-web