![]() | |
![]() |
| | Thread Tools | Display Modes |
#11
| |||
| |||
|
|
Mike Preece wrote: Well gee. If you compare code that works with 50,000 individually addressable memory locations with one that works with a delimited infinite-length string wouldn't you expect to see a wee difference? SteveB wrote: Sorry mate you totally missed the point. Someone suggested that I use dynamic arrays. This was a response that they are useless by a factor of more than 2000. What cant I use a dimensioned array you ask? Maybe take the time to read the rest of the thread. |
#12
| |||
| |||
|
|
Homer L. Hazel wrote: Steve, Your code samples appear to be identical except for the word Dynamic or Dimensioned at the top? SteveB wrote: Umm, yeah. Sorry. Here is the dynamic array version cut and pasted from my test program. YY='ABCDEFGHIJK' NI=1000 NJ=50 ZZ='' STARTTIME=SYSTEM(1020) FOR II=1 TO NI FOR JJ=1 TO NJ ZZ<RND(NI)+1,RND(NJ)+1>=STR('X',RND(10)) NEXT JJ NEXT II STOPTIME=SYSTEM(1020) PRINT (STOPTIME-STARTTIME) 'MD00':'ms' Steve Mike Preece wrote: Well gee. If you compare code that works with 50,000 individually addressable memory locations with one that works with a delimited infinite-length string wouldn't you expect to see a wee difference? I think you might be an idiot. Ah, but is he self-aggrandizing? Or even vociferous? =`:^ |
#13
| |||
| |||
|
|
Luke Webber wrote: Quite apart from that little peccadillo <g>, I have other concerns about the code. God knows we all love to carve up anybody who posts code in this group (or is that just me?), but what is it with this bit? Why dont you just comment on the dynamic array in this case being more than 2000 times slower than a dimensioned array?. |
|
I already explained the requirement in my earlier posts. You wont be able to provide a solution because there isnt one in mvbasic. Ive been programming non-stop in mvbasic since 1983. |
#14
| |||
| |||
|
|
Luke Webber wrote: If you've been coding in MV BASIC since 1983, you should be aware that you can use a fixed array of dynamic arrays to result this sore of problem. Yes I have and yes I am thanks. |
|
What is not to like is that I need an unknown number of ZZ arrays to be created during the processing but Pick has to predetermine the number and sizes of all dimensioned arrays in advance ... unlike other languages where you can happily create new arrays on the fly and store them in other arrays at your convenience. |
|
The best possible solution in Pick has already been highlighted in the thread. Just write everything into hashed files instead of dimensioned or dynamic arrays. Since the files are cached in memory they approximate hashed collections in other languages. This solution is fast enough even though I find it about 15 times slower than accessing numerical arrays. |
#15
| |||
| |||
|
|
Luke Webber wrote: So... why did you show us the worst-case code? <g To show that dynamic arrays werent a solution to the problem at hand ... |
|
Well, not really. I thought that was probably going to be a point you'd raise, so here is a little sample I prepared earlier, so to speak... Yes redim *is* a way to dynamically acquire dimensioned memory during processing. It is still rather clunky to use in more complicated scenarios but works to a degree when you are desperate. I still miss proper memory acquisition techniques available in all the other languages that I use. |
![]() |
| Thread Tools | |
| Display Modes | |
| |