{"action":"created","issue":{"url":"https://api.github.com/repos/processing/p5.js/issues/1744","repository_url":"https://api.github.com/repos/processing/p5.js","labels_url":"https://api.github.com/repos/processing/p5.js/issues/1744/labels{/name}","comments_url":"https://api.github.com/repos/processing/p5.js/issues/1744/comments","events_url":"https://api.github.com/repos/processing/p5.js/issues/1744/events","html_url":"https://github.com/processing/p5.js/issues/1744","id":199044094,"number":1744,"title":"incredibly slow sketch on chrome, runs fine in safari","user":{"login":"jtoy","id":14783,"avatar_url":"https://avatars.githubusercontent.com/u/14783?v=3","gravatar_id":"","url":"https://api.github.com/users/jtoy","html_url":"https://github.com/jtoy","followers_url":"https://api.github.com/users/jtoy/followers","following_url":"https://api.github.com/users/jtoy/following{/other_user}","gists_url":"https://api.github.com/users/jtoy/gists{/gist_id}","starred_url":"https://api.github.com/users/jtoy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jtoy/subscriptions","organizations_url":"https://api.github.com/users/jtoy/orgs","repos_url":"https://api.github.com/users/jtoy/repos","events_url":"https://api.github.com/users/jtoy/events{/privacy}","received_events_url":"https://api.github.com/users/jtoy/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-01-05T19:54:32Z","updated_at":"2017-01-19T01:43:36Z","closed_at":"2017-01-19T01:43:36Z","body":"my first real  p5js sketch that I ported from Processing grinds chrome to a halt. It runs fine in safari though. is this considered a p5js bug or a chrome bug or?\r\nI debugged it, it is due to the while loop it looks like.  I had to use a while loop in this case instead of a for loop.\r\n\r\nYou can see it run here:\r\nhttp://www.jtoy.net/2017/01/04/my-experience-with-processing.html\r\n\r\nHere is the code:\r\n```\r\n\r\n   var radius = 300;\r\n   var direction = 1;\r\n   var ray_length = 0;\r\n  var ray_direction = 1;\r\n\r\n  function alternating_ray(radius){\r\n  ray_length +=ray_direction;\r\n  if(ray_length == 10){\r\n    ray_direction = -1;\r\n  }else if(ray_length == 0){\r\n    ray_direction = 1;\r\n  }\r\n  return radius/2+ray_length; \r\n  }\r\n   \r\n   \r\n function setup(){\r\n   createCanvas(600, 600);\r\n }\r\n function draw(){\r\n   background(0);\r\n   var amount_ray = cos(frameCount/15)*10;\r\n   var amount = sin(frameCount/15)*5;\r\n   var below = height/2+amount;\r\n   translate(width/2,below);\r\n   fill(229,155+amount_ray,16);\r\n   ellipse(0,-170,radius,radius);\r\n  stroke(229,155+amount_ray,16);\r\n  //for(i=0;i<=360;i+=1){\r\n  i = 0;\r\nwhile(i != 361){\r\n  var arr = alternating_ray(radius);\r\n  var new_x = cos(radians(i))*arr;\r\n  var new_y = sin(radians(i))*arr;\r\n  line(0,-170,new_x,-170+new_y); \r\n  i+=1;\r\n }\r\n   \r\n   radius+=direction;\r\n    if (radius == 400){\r\n  direction = -1;\r\n }else if(radius ==50){\r\n    direction = 1;\r\n }\r\n   \r\n   fill(205);\r\n   triangle(-250, 250, 0, -100, 250, 250);\r\n      \r\n\r\n   ellipse(0, 270, 400, 40);\r\n   ellipse(0, -170, 120, 120);\r\n   \r\n\r\n }\r\n```"},"comment":{"url":"https://api.github.com/repos/processing/p5.js/issues/comments/273658069","html_url":"https://github.com/processing/p5.js/issues/1744#issuecomment-273658069","issue_url":"https://api.github.com/repos/processing/p5.js/issues/1744","id":273658069,"user":{"login":"lmccart","id":191056,"avatar_url":"https://avatars.githubusercontent.com/u/191056?v=3","gravatar_id":"","url":"https://api.github.com/users/lmccart","html_url":"https://github.com/lmccart","followers_url":"https://api.github.com/users/lmccart/followers","following_url":"https://api.github.com/users/lmccart/following{/other_user}","gists_url":"https://api.github.com/users/lmccart/gists{/gist_id}","starred_url":"https://api.github.com/users/lmccart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmccart/subscriptions","organizations_url":"https://api.github.com/users/lmccart/orgs","repos_url":"https://api.github.com/users/lmccart/repos","events_url":"https://api.github.com/users/lmccart/events{/privacy}","received_events_url":"https://api.github.com/users/lmccart/received_events","type":"User","site_admin":false},"created_at":"2017-01-19T01:43:36Z","updated_at":"2017-01-19T01:43:36Z","body":"thanks @limzykenneth!"}}
{"actor":{"display_login":"lmccart"}}