comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Adding x,y events to a 2d array (quickly)
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Adding x,y events to a 2d array (quickly) [message #86441 is a reply to message #86440] Fri, 08 November 2013 08:11 Go to previous message
Dick Jackson is currently offline  Dick Jackson
Messages: 347
Registered: August 1998
Senior Member
Oliver wrote, On 2013-11-08, 6:18am:
> Hi again - thanks for all replies especially Dick's last with all the timings, which allows me to sheepishly admit that I solved the speed problem, but not how I expected to!
>
> Looking at the timings, which I could match in the test program but not in my main data program, it turns out that the single loop over the array contents was taking much longer as the array itself was buried in a structure.
>
> Creating a temporary array and looping over that increased the speed from ~30 seconds to ~2 seconds
>
> The red herring was that using the non looping method, the fact that it was in a structure hadn't affected the speed...
>
> (Although I stand by original message that the += operator doesn't work as you might expect with arrays!)
>
> Thanks again
>
> Oliver

You're most welcome. It is indeed counterintuitive that
array[indicesWithDuplicates] ++

is not equivalent to
array[indicesWithDuplicates] += 1

--

Cheers,
-Dick

Dick Jackson Software Consulting
Victoria, BC, Canada
www.d-jackson.com
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Non-blocking socket
Next Topic: strange !P.multi[0] behavior??

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 18:14:50 PDT 2025

Total time taken to generate the page: 0.00419 seconds