+ Start a Discussion
Ken KoellnerKen Koellner 

What is taking time?

Below are some segment of debug logs from an action method called by a VF page.

It looks like the vast majority of time is taking place after  VF_SERIALIZE_VIEWSTATE_END and before Generate Metadata.  Then there's a bit more time used in Generate Metadata.  I'm wondering what's going on during this time?

I could reduce view state a lot and then requery some information.  I'm thinking that might improve performance but I'd like to know that view states effects that time that's being used.

08:58:39.219 (219185000)|VF_SERIALIZE_VIEWSTATE_BEGIN|066i00000003ASR
08:58:39.365 (365728000)|VF_SERIALIZE_VIEWSTATE_END
08:58:52.766 (13766220000)|CODE_UNIT_STARTED|[EXTERNAL]|Generate Metadata
08:58:56.069 (17069399000)|CODE_UNIT_FINISHED|Generate Metadata
08:58:56.632 (17330865000)|CUMULATIVE_LIMIT_USAGE

08:58:18.487 (487066000)|VF_SERIALIZE_VIEWSTATE_BEGIN|066i00000003ASR
08:58:18.629 (629588000)|VF_SERIALIZE_VIEWSTATE_END
08:58:26.961 (8961670000)|CODE_UNIT_STARTED|[EXTERNAL]|Generate Metadata
08:58:30.310 (12310775000)|CODE_UNIT_FINISHED|Generate Metadata
08:58:30.676 (12573652000)|CUMULATIVE_LIMIT_USAGE

09:04:13.208 (208228000)|VF_SERIALIZE_VIEWSTATE_BEGIN|066i00000003ASR
09:04:13.355 (355362000)|VF_SERIALIZE_VIEWSTATE_END
09:04:26.507 (13507293000)|CODE_UNIT_STARTED|[EXTERNAL]|Generate Metadata
09:04:29.665 (16665073000)|CODE_UNIT_FINISHED|Generate Metadata
09:04:30.564 (16933020000)|CUMULATIVE_LIMIT_US

Yes, view stats does impact a VF page's performance. I would suggest you to understand concept of view state from following help document so that you can work on minimizing it.


Also refer following document for increasing VF performance:


Ken KoellnerKen Koellner
I know all that stuff.

I'm just curious what SF is doing between VF_SERIALIZE_VIEWSTATE_END and CODE_UNIT_STARTED|[EXTERNAL]|Generate Metadata.
Rohit Mehta 1Rohit Mehta 1
Did u figure this out? I am having a similar issue. Salesforce is taking few seconds after CODE_UNIT_FINISHED and before VF_SERIALIZE_VIEWSTATE_BEGIN
Hello Ken/Rohit,

Similar issues have been reported to salesforce and are being worked upon. I would advise you to raise a case with support for further details.