Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Website hangs in Chrome on Core i5 consuming 100% CPU #247

Open
irnc opened this issue Aug 4, 2017 · 7 comments
Open

Website hangs in Chrome on Core i5 consuming 100% CPU #247

irnc opened this issue Aug 4, 2017 · 7 comments

Comments

@irnc
Copy link

irnc commented Aug 4, 2017

https://synaptic.juancazala.com/ hangs right away leaving it unusable, because links couldn't be clicked.

System is Ubuntu 16.04 with Chrome 59.

@wagenaartje
Copy link
Contributor

Was mentioned here too - #26.

@AlexisTM
Copy link

AlexisTM commented Aug 4, 2017

Might be because of the 100 fps?

What about using the window.requestAnimationFrame function instead of the setTimeout?

https://github.com/cazala/synaptic/blob/gh-pages/scripts/homepage/world.js#L83

@wagenaartje
Copy link
Contributor

wagenaartje commented Aug 5, 2017

@AlexisTM I wrote a JSFiddle of the demo that uses requestAnimationFrame instead of setTimeout, problem still occured. https://jsfiddle.net/wagenaartje/fuh36aex/1/.

I also set the setTimeout delay to 1000 and it worked fine for like 5 iterations and then just completely slowed down, but did not freeze.

@AlexisTM
Copy link

AlexisTM commented Aug 5, 2017

If you leave the page during some time, it actually works after a long freeze.

@AlexisTM
Copy link

AlexisTM commented Aug 5, 2017

It took 134200 seconds for the first execution of the activate function, which optimize.

https://github.com/cazala/synaptic/blob/gh-pages/scripts/homepage/world.js#L71

var output = creature.network.activate(input);

The optimization creates an optimized version of the network by concatenating the calls.

https://github.com/cazala/synaptic/blob/master/src/network.js#L114-L191

@wagenaartje
Copy link
Contributor

wagenaartje commented Aug 5, 2017

Nice catch! I used setOptimize(false) and it worked again.

https://jsfiddle.net/wagenaartje/4516xtze/7/

I also noticed that the perceptron has way too many neurons in its hidden layer. Could easily be reduced. Just 1 is enough for clustering, 2 is more smooth.

@AlexisTM
Copy link

AlexisTM commented Aug 5, 2017

Therefore, the optimization is hanging on Chrome. :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants