Re: extremely slow array indexing?

2006-11-30 Thread Grace Fang
Hi will,Thanks for your reply. The simplified code is as follows, and you can run it if you like. It takes 7 seconds to process 1000 rows, which is tolerable, but I wonder why it takes so long, because I also did one for loop through all of the same rows without accessing array, which only takes 1

extremely slow array indexing?

2006-11-30 Thread Grace Fang
Hi, I am writing code to sort the columns according to the sum of each column. The dataset is huge (50k rows x 300k cols), so i need to read line by line and do the summation to avoid the out-of-memory problem. But I don't know why it runs very slow, and part of the code is as follows. I suspect i