scalacenter / scastie

An interactive playground for Scala
https://scastie.scala-lang.org
Apache License 2.0
433 stars 105 forks source link

Website Optimization(s) #194

Open MasseGuillaume opened 7 years ago

MasseGuillaume commented 7 years ago

@lihaoyi reported a ~27s loading delay in Singapore.

MasseGuillaume commented 7 years ago
lihaoyi commented 7 years ago

[ ] fullOptJS on the Scala.js output :)

MasseGuillaume commented 7 years ago

When the user compiles a Scala.js snippet or when I compile the website?

lihaoyi commented 7 years ago

The website itself (that's why it was 2mb of JS on my initial download, instead of a few hundred KB like scalafiddle is)

lihaoyi commented 7 years ago

compilation output of a Scala.js snippet could go either way, since the time you save on download you pay for in increased compilation time that the user has to wait for. For the website itself though, compilation is done beforehand, so there's no reason not to fullOptJS the website's own JS bundle

MasseGuillaume commented 7 years ago

I'm pretty sure the website is fullopted

https://scastie.scala-lang.org/public/app.js

lihaoyi commented 7 years ago

Huh, so the 2mb blob is after fullOpt??? That sound unusual unless your app is pretty large

lihaoyi commented 7 years ago

I guess if it's already fullOpt-ed then the only thing is to gzip it then

MasseGuillaume commented 7 years ago

It's a webpack bundle: It includes React & CodeMirror. I guess I can minify those artifacts too.

lihaoyi commented 7 years ago

oh yeah there are definitely minified versions of those two artifacts you can pull in

MasseGuillaume commented 7 years ago

We are now down to 300KB. https://github.com/scalacenter/scastie/pull/341

MasseGuillaume commented 7 years ago

For the CDN, we will probably use CloudFlare, but I need to discuss this with our sysadmin first.

This would be really useful for the scaladoc (http://www.scala-lang.org/api/current/index.js is 1.1MB gzipped!)

lihaoyi commented 7 years ago

yasssss

On Sat, 23 Sep 2017 at 10:35 AM, Guillaume Massé notifications@github.com wrote:

For the CDN, we will probably use CloudFlare, but I need to discuss this with our sysadmin first.

This would be really useful for the scaladoc ( http://www.scala-lang.org/api/current/index.js is 1.1MB gzipped!)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/scalacenter/scastie/issues/194#issuecomment-331656184, or mute the thread https://github.com/notifications/unsubscribe-auth/AA5A_J4SFnZJY6PoFb_zrCe03UGqKOxLks5slUFigaJpZM4Ndwbh .