Try one or more of the following:
Set the debug level to be less verbose (dev console). You'll get major errors back rather than each loop iteration showing up.
There are visualforce global parameters for page and exception. I placed these in a google analytics event on the page so I can see what's being thrown.
Wrap the whole page in a try/catch block, and do a system.debug(logginglevel.error, e) in the last catch. <==assuming you name all your exceptions e like I do). If the log verbosity is the main problem, combine this with #1.
If the error happens after the page loads, like on a save or other action, you could do #3 but use an apex message option to show the error that you're catching on the page (avoid the logs entirely).
Here's the GA script we use (prerequisite is that you have the GA async tag already on the page AND you have your GA id on the salesforce site config page).
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', '{!$Site.AnalyticsTrackingCode}']);
_gaq.push([
'_trackEvent',
'Page Errors',
'{!$Site.ErrorMessage}',
'{!$Site.OriginalUrl}--{!$Site.ErrorDescription} experienced by {!$User.id}']);
</script>
Best of luck!
Salesforce.com calculates the total amount of time it takes to process the page, including querying the database and rendering the page. Using JavaScript remoting will drastically reduce the time spent rendering the page server-side by offloading this responsibility to the client. Furthermore, using static resources instead of inline JavaScript will also reduce the calculated usage time, because data fetched from a cache (such as the CDN) doesn't count against your total server time. Consider designing your page to use the following code:
<apex:page controller="MySiteController">
<apex:includeScript value="{!$Resource.mySiteJS}"/>
<div id="content"></div>
</apex:page>
Your controller can be completely written as remote actions. Note that I have zero view state and only one expression to evaluate. Here's some possible code that you might use in your controller:
public with sharing class MySiteController {
@RemoteAction
public static SomeData getSomeData(SomeParam param) {
// Do stuff here, return SomeData.
}
// More remote action functions here
}
The client-side rendering is taken care of inside MySiteJS:
(function() {
function init() {
// when the page loads
}
// Other functions here. We can also use jQuery, etc...
addEventListener('load', init, true);
}());
Using this design structure, you should be able to get your Visualforce page loads down to about 20ms, and your remoting actions should typically return in far less than 1000ms even if you have a ton of data you're throwing down the wire. And remember, CDN (your JavaScript) is free of charge, so leverage that fact to reduce your total page time. If you're providing localization strings, I would store the languages in various static resources as well; have the page load the appropriate language pack based on the user's settings.
Best Answer
Can't help you with JS code, but I can with APEX. There's a freebie Stop Watch class that's part of Apex Utilities which you can get from either the App Exchange or get the source code here. If you downloaded the source code, I'd think you could readily incorporate portions of it into a custom controller for your wizard.