I'm not sure what the bug is here - I tried your random generator but stuff appeared after 1 second. I noticed a lot of loops - are you sure it's just not taking a long time to complete? I tried reproducing the large array issue in the OP and it works fine here, appears instantly.
I think it might be a browser issue...