« first day (844 days earlier)      last day (3646 days later) » 

12:13 AM
@brama probably you are generating a large nested expression that grows larger at each iteration. ;)
 
@OleksandrR. I am only updating a bunch of arrays..it is a simulation
 
@brama a numerical method, then? In that case I suspect you're introducing rationals somewhere which get larger and larger (in size)
 
@OleksandrR. It is a numerical method...The output looks ok with while loop...but I wanted to implement NestWhile hoping that it will be more effecient
 
@brama insert N in some strategic places and see if things improve. But really I am just guessing, of course, because you don't give any actual detail about what you're really doing
 
@OleksandrR. I can send you my code...if you wish to look at...it is not too big!!...All my inputs are real. I am pretty positive there are no rationals. I think there is a problem with my Syntax because it is slowing down in another simulation application too. The syntax I use is NestWhile[(...bunch of steps...)&, , T>0 &] where T is calculated in every iteration in the loop
 
12:24 AM
@brama well, I'd rather you don't send it to me personally. If you can produce a small self-contained example then I'd suggest posting it as a question
 
12:38 AM
@brama incidentally, NestWhile probably will not be much/any more efficient than While unless it happens that the body can be compiled.
 
@OleksandrR. I am using NestWhile inside a compile
 
@brama be careful about how you use Compile. It can slow things down (perhaps by a lot) if you have a lot of calls out of the VM
Anyway, inside Compile, NestWhile will definitely not be more efficient than While.
 
@OleksandrR. That is interesting. I want to talk more about it..but I need to step away for a moment, will be back in less than 10 mins.
 
@brama okay. If it gives you any comfort, I used While here (question), as it was just easier to write the code this way. There is no real performance impact.
 
1:23 AM
@OleksandrR. How does While compare with For loop if you know the number of iterations?
 
@brama the compiler converts them all to bytecodes equivalent to If and Goto. So it doesn't matter at all.
 
@OleksandrR. good to know that...
@OleksandrR. going back to your earlier comment, what do you mean by "lot of calls out of the VM?" If I have a module with mot of functions and also a compile that calls those functions. Is there a possibility of calling out of VM?
 
@brama definitely. The only way to tell is to check the bytecode.
 
@OleksandrR. wow...let me post the code as a question.
 
In a tight loop, just one call out can be disastrous for performance.
@halirutan did I get the right email address?
 
2:13 AM
@OleksandrR. Yes. I'm trying some things out which is the reason why I didn't answer you right away.
 
2:41 AM
@halirutan okay; no problem
 
 
17 hours later…
7:38 PM
@MichaelE2 I want to refer to your comment to my last question on SE. Are you here?
 

« first day (844 days earlier)      last day (3646 days later) »