Skip to content

Incredibly slow performance #1220

@Pauan

Description

@Pauan

🐛 bug report

Description of the problem

Hello, I am speaking of behalf of AmCharts.

We have hundreds of examples and tutorials on Codepen, but we would really like to move them over to CodeSandbox, because it is far superior in almost every way (great job, by the way!)

However, there is one major blocker which is preventing us from doing so, and that is performance.

Here is a sample Sandbox: https://codesandbox.io/s/4wnn4qwrvw

Wait for it to load (this takes a while). You will know it is working if you see a horizontal tapered chart.

After it's loaded, click the circular Reload button:

  • On Chrome this reload takes ~1 second, which is acceptable.

  • On Firefox this reload takes ~12 seconds, which is obviously far too long!

  • It doesn't even work at all on Edge (it gives CORS network errors).

I tested on Windows 10 64-bit, with the latest Windows updates installed, and the latest versions of all the browsers.

We know that it is not a problem with our code, because the same Codepen loads fast, without any problems, in all browsers.

The only difference between the Sandbox and the Codepen is that the Sandbox is using ES6 modules whereas the Codepen is using <script> tags.

I tried creating a Sandbox that uses <script> tags, but that gives some bizarre Webpack errors (the same <script> tags load fine in Codepen). So it seems that Sandboxes manipulate the runtime environment in weird ways.

We also noticed that the transpilation takes a long time. That's okay if it's only done once and then cached on the server, but the transpilation seems to happen multiple times, even if the code hasn't changed!

If everybody who visits the Sandbox needs to re-transpile it, then that's also unacceptable for us (we need the Sandbox to load in ~1-2 seconds at most), so transpilation must be done only once (assuming no code changes).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions