function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Dima KryvyiDima Kryvyi 

Lightning Component in Visualforce - Slow Loading in Spring 18

We've faced an issue with custom ligtning components wrapped up with Visualforce page. It takes Visualforce page around 3-5 seconds to start loading the lightning part (when the page itself is there). Here's VF page:
<apex:outputPanel id="viewPanel" rendered="{!$User.UIThemeDisplayed == 'Theme3'}">
    <apex:includeLightning />
    <div id="component" />
        <script>
            var myUserContext = "{!$User.UITheme}";
            $Lightning.use("sff:SFF", function() {
                $Lightning.createComponent("sff:ReportsTab", {
                        label: "List of Reports",
                        userContext: myUserContext,
                    },
                    "component",
                    function(cmp) {});
            });
        </script>
    </apex:outputPanel>
</apex:page>
That's what I see in Chrome console. 'A' - VF part emerges, 'B' - Lightning is visualized and nothing in between.

User-added image

Any ideas/hints on how to boost that loading? Thanks
Dima KryvyiDima Kryvyi
UPD:
Lightning Insperctor shows that it takes 4511ms to load "aura:bootstrap" before the actual componet emerges in the log.

If we use the exact same component in the ligtning tab (what i've described above is a Visualforce tab) it takes around 1 sec to show the spinner (so user starts seeing that smth is happening).