Which is quicker? [[ Window.width ]] or [[ 1024 ]]?


#1

Hi,

THE PROBLEM:
I have a handful of dynamic panels, where:
onLoad, each DP sizes itself to sizes based on window.width (like, [[ Window.width -This.left*2 ]] )

THE PAIN POINT:
The page load takes about 7 seconds. Each dynamic panel contains a grid of text blocks to mimic a data grid, 2 x 20, and 20 x 20 cells.

Then on WindowResize, I fire the same dynamic panels’ onLoad trigger/action.
This, too, is kinda choppy (even with a conditional that constrains the resizing to every 200 milliseconds—"If [[ Now ]] > [[ previous.milliseconds +200 ]] "

QUESTION:
Is there any chance that just having a dedicated widget to get, and then display, window width, so that all other dynamic panels can refer to its text, rather than calculate window.width, would be faster? Or is it just my 20 x 20 cells data grids?

Probably splitting hairs, but I really need to minimize the page rendering time.

Thanks a bunch!
John


#2

Hi John,

It’s possible that having a dedicated widget for the window with might help (you could also store it in a global variable), but it sounds like the number of widgets in your dynamic panels are likely having a greater impact on performance. When it comes to prototype performance, we generally recommend trying to keep the number of widgets per prototype page at around 500 widgets, 40 dynamic panels, and 100 panel states or fewer. The widgets within a panel state do add to this overall widget count, and this could be adding up quickly if you have multiple states with 20 x 20 grids. You can find some more technical information about this from our dev team here if you’re interested:

With that said, do you see any difference in performance after reducing the number of widgets within your dynamic panel states? If you can post a copy of your current RP file, we’ll be able to take a closer look on our end as well. Let me know if you have any questions!


unlisted #3