I have tried building a Visualforce page using lightning component. It is working fine. But the loading time is quite slow. Even after I remove the Visualforce controller and extension it is still quite slow. I can partly understand the reason. The lightning component file is an xml file which in the server end, Java code needs to be executed to transfer to file into output html file and using frontend javascript to load it into Visualforce page related <div> tag.

And after that, it still needs to call the init methods which then call the enqueued server actions and rerender the page after it is all done.

This process reminds of React JS. It is pretty much doing the same thing - convert JSX file into output html. However, React has a developer version and a production version. So is there a similar thing for lightning component which can boost the loading efficiency?

1 Answer 1


Yes, Lightning also has both debug mode and production mode. Here are the differences:

Debug mode has a significant performance impact. Salesforce is slower for any user who has debug mode enabled. For this reason, we recommend using it only when actively debugging JavaScript code, and only for users involved in debugging activity. Don’t leave debug mode on permanently. Users who have debug mode enabled see a banner notification once a week while it’s enabled.

To toggle debug mode, use the following process:

From Setup, enter Debug Mode in the Quick Find box, then select Debug Mode Users.

Users with debug mode enabled have a check mark in the Debug Mode column.

In the user list, locate any users who need debug mode enabled. If necessary, use the standard list view controls to filter your org's users.

Enable/Disable the selection checkbox next to users for whom you want to enable/disable debug mode.

There is also an optimizer:

From Setup, enter Optimizer in the Quick Find box, then select Optimizer. Select Run Report. Continue running the Optimizer monthly to monitor progress and get all the benefits of the enhancements to the report.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .