On Monday, July 3, 2017 at 9:42:09 AM UTC+1, Jakub Hampl wrote:
>
> In JS, you could measure the time of each iteration and then only do so 
> many that it would fit into a “frame budget” (so < 16ms, or if you are 
> updating the DOM you would probably only spend say 10ms). However, I’m not 
> sure how easy that would be in Elm.
>

Yes, I was considering that. I have a function that takes an argument 'n' 
which tells it how many loops of the search to run (or terminate sooner if 
it finds a goal state). I was thinking of running say 10 iterations and 
timing how long that takes, then using the throughput from that (= num 
iterations / time taken) to estimate how many iterations would fit in what 
you call a "frame budget". Then on subsequent iterations try and do a frame 
budgets worth each time.

Could work. Or web workers. 

-- 
You received this message because you are subscribed to the Google Groups "Elm 
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to