I'm going to write a modified version of MakeGraph by mike3
#11
(02/23/2023, 07:41 PM)Gottfried Wrote: Yes, for a vector of values:
  st=""; for(c=1,cols, st=Str(st, X[  c  ])); write(st);

or for a rows-by-cols array
  st=""; for(r=1,rows, st=Str(st,X[r,1]; for(c=2,cols, st=Str(st, ",",X[r,c])); st=Str(st,"\n"));   write(st); 

This should be considerably faster than all mathematical optimizations...
Perhaps a "strjoin()" on a vector of numerical values might even be faster than doing the loop of "for(c=1,cols, st=Str(st,",",<numerical value>))". You should test it.   


Moreover, the new "filewrite()" procedures do more-or-less make the above implicite (via caches in main-memory, while "write()" do the full procedure of looking whether the file exists, allocation of a write-string, looking where the file-pointer is, increase, write to the file-system, wait until received, closing the file descriptor etc etc.

I always use filewrite()

I was just using the broad term WRITE; as how the code works. And the math of whatever speed it takes to run WRITE.

I think you're going to be pleasantly surprised with my math speed ups, Gottfried. Don't write them off yet. I'm just explaining how the logistics of the code go. I do believe you are right. I can probably gain some speed by avoiding WRITE, and just writing strings of elements.

Give me a day or two. I swear the code I wrote is pretty fucking cool Tongue
Reply


Messages In This Thread
RE: I'm going to write a modified version of MakeGraph by mike3 - by JmsNxn - 02/23/2023, 07:57 PM



Users browsing this thread: 1 Guest(s)