6
$\begingroup$

Has anyone noticed a slowdown on Wolfram Cloud rendering? With @JanPöschko's help I've been using Wolfram Cloud to share docs for my EcoEvo package. I just updated them and noticed that it takes a long time to render now.

The main Guide page takes 1 second to load, but 1 minute and 40 seconds to make all the links active (watch the tiny blue progress bar under the "Wolfram Notebook" header). Before the page has rendered, clicking on a link brings a popup saying "Starting interactivity..." After it is done, clicking on a link is unresponsive for 25 seconds before going to the linked page.

I don't remember it being so slow before. Has something changed?

$\endgroup$

1 Answer 1

13
$\begingroup$

I'm not sure yet what exactly changed – maybe the underlying "Reference.nb" stylesheet or our handling of N or Inherited (see below). We don't officially support documentation notebooks in the cloud yet (so we don't actively test that stylesheet), but, of course, this should "just work". So it's a little embarrassing this got slower. Sorry.

In cases like this, it can be very useful to look at our (rather experimental and un-polished) "devtools", e.g. by opening the page with an extra ?devtools=true parameter: https://www.wolframcloud.com/obj/EcoEvo/docs/guide/EcoEvo.nb?devtools=true

This shows you all the kernel evaluations being made, which is usually the bottleneck (due to the round-trip time to the server). You can see a lot of evaluations with an evaluated value like

{CloudSystem`SynchronousEvaluate[
  "4cafbfd0-ee6b-428d-afe1-2b4635dd199c", 
  CloudSystem`UpdateDynamic[
   CloudSystem`Signing`SignedExpression[
    If[CurrentValue["MouseOver"], 
     RGBColor[0.054902`, 0.243137`, 0.72549`], Inherited], 
    "res:StyleSheets:Wolfram/Reference.nb"], None, N, 87236023836699, 
   6, 1585260120.881`]]}

– so what's happening is that it (unfortunately) uses the kernel to resolve essentially

If[CurrentValue["MouseOver"], 
 RGBColor[0.054902`, 0.243137`, 0.72549`], Inherited]

This should really be handled by the client-side evaluator, but it isn't (anymore?), I think because it doesn't know how to resolve N[Inherited]. We will try to get that fixed in Cloud 1.55.

In the meanwhile, you could avoid this by just not using a hover effect for hyperlinks, e.g. adding a style override like the following to your (inline) stylesheet:

Cell[StyleData["WebLink"], 
 TemplateBoxOptions -> {DisplayFunction :> (TagBox[
       ButtonBox[
        StyleBox[#, 
         FontColor -> RGBColor[0.054902, 0.243137, 0.72549]], 
        ButtonData -> {URL[#2], None}], 
       MouseAppearanceTag["LinkHand"]] &)}]

I have tried this, and it loads much faster: https://www.wolframcloud.com/obj/jpoeschko/Published/EcoEvo-optimized.nb

It might also work to just replace Inherited with an explicit RGBColor.

Hope this helps.

$\endgroup$
4
  • $\begingroup$ Thanks for your quick answer. I'll give it a try tonight! $\endgroup$
    – Chris K
    Commented Mar 26, 2020 at 23:21
  • $\begingroup$ @Jan Pöschko: Thank's for mentioning ?devtools=true! Is there a place where more possible parameters are documented? Like the ?_view=frameless parameter (e.g., in CloudDeploy[Manipulate[Plot[Sin[x (1 + a x)], {x, 0, 6}], {a, 0, 2}],"test?_view=frameless",Permissions->"Public"]) should also be documented. And, what is the parameter now to get more synchronous dynamic updating when e.g. moving a slider (?_view=frameless triggered that in older W(E)PC versions, but does not anymore). $\endgroup$ Commented Mar 26, 2020 at 23:28
  • 1
    $\begingroup$ I just added your DisplayFunction incantation to the code that fixes links before uploading to the cloud -- works perfectly. Thanks again! $\endgroup$
    – Chris K
    Commented Mar 27, 2020 at 1:59
  • 1
    $\begingroup$ @RolfMertig ?devtools=true is the only (semi-supported) extra parameter for notebooks I can think of right now. We are working on more documentation that would mention this. ?_view=frameless is not officially supported and will be removed eventually; the cloud object option AppearanceElements->None should be used instead, moving forward. Other "views" are as exposed as CloudObjectURLType (more to come). The way to get immediate updates during interactions (even in the "Object" view) is to explicitly set ContinuousAction->True (e.g. in Manipulate). $\endgroup$ Commented Mar 27, 2020 at 5:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.