Crank: Generator Function Component Hogs CPU on Safari

Created on 5 Sep 2020  路  3Comments  路  Source: bikeshaving/crank

Steps to repro:

  1. Open Safari on Mac
  2. Go to the Try on CodeSandbox link under A Stateful Component (in the README.md)
  3. Wait 15 seconds or so

Observed: the CPU usage on my laptop shoots up and I can hear the fan come on

  • Doesn't happen in Chrome
  • Doesn't happen on non-Generator examples
bug performance

All 3 comments

I use Safari as my regular browser so this would be troubling if true 馃槵
Some thoughts:

  1. I accidentally did not upgrade the version of Crank used in that example to latest; it was on 0.1.4. I upgraded the template to 0.3.3 but I鈥檓 not sure if it鈥檚 sticking on the CodeSandbox鈥檚 side. I rewrote Crank twice for performance reasons and I encourage everyone to upgrade.
  2. The CodeSandbox app might be confounding attempts to understand the performance of Crank.js. Even the minimal app pane seems to use an inordinate amount of resources, maybe because it is compiling on the fly or something https://hh8zx.csb.app. In any case, I would want any performance issues to be reproduced on an otherwise empty HTML page.

I ran the stateful generator example locally in Safari and cannot reproduce the issue.

Yeah, that makes sense, could be CodeSandbox. I wondered about that, but since it was just generator functions and only Safari, I discounted it. I'll spin up standalone app. I want to do that to learn more about Crank anyway. Great framework!

Yeah, works fine locally in Safari. Must be something in CodeSandbox. Closing.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

GormanFletcher picture GormanFletcher  路  4Comments

virtualfunction picture virtualfunction  路  5Comments

workingjubilee picture workingjubilee  路  6Comments

dfabulich picture dfabulich  路  4Comments

xkxx picture xkxx  路  7Comments