Page take over 30 seconds to load

  • 1
  • Problem
  • Updated 3 years ago
I have a simple page with two account models on it. One is used for the list view, the other is used to create a record. The list view model (loaded on page load) has 8 fields and 1 condition. It takes more than 30 seconds to load, and chrome keeps killing it.

I've tried to limit the model returns to 100 records, but it still takes more than 30 seconds to load. Any direction on what to do would be appreciated.
Photo of Brayden Smith

Brayden Smith

  • 1,078 Points 1k badge 2x thumb

Posted 3 years ago

  • 1
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
Strange. Standard object?

Either way, can you provide the XML?
Photo of Brayden Smith

Brayden Smith

  • 1,078 Points 1k badge 2x thumb
Standard Account Object, here's the XML:

Vendor Accounts
Home

VendorAccounts

Create new Vendor{{#Name}}: {{Name}}{{/Name}}
Vendor:

var $ = skuid.$,
params = arguments[0],
component = params.component,
popup = component.editor.element.closest('.ui-dialog-content'),
modelsToSave = [],
objLabelsToSave = [],
uniqueModels = {};

popup.children().each(function(){
var obj = $(this).data('object');
if (obj && obj.model && !uniqueModels[obj.model.id]) {
var model = obj.model;
modelsToSave.push(model);
if (model.data && model.data.length) {
if (model.data.length>1) {
objLabelsToSave.push(model.labelPlural);
} else {
objLabelsToSave.push(model.label);
}
}
uniqueModels[obj.model.id] = 1;
}
});

var message = 'Saving new ';
if (objLabelsToSave.length < 3) {
message += objLabelsToSave.join(' and ');
} else {
var lastObj = objLabelsToSave.pop();
message += objLabelsToSave.join(', ');
message += ', and ' + lastObj;
}
message += '...';
popup.block({
message: message
});

skuid.model.save(modelsToSave,{callback:function(result){
if (result.totalsuccess){

// Refresh the data in related Models on the page
var uniqueRelatedObjectsToCheck = {},
relatedModelsToUpdate = [];

$.each(modelsToSave,function(){
if (this.objectName && !uniqueRelatedObjectsToCheck[this.objectName]) {
uniqueRelatedObjectsToCheck[this.objectName] = 1;
}
});

// Loop over all Models,
// including the Models we've already saved,
// and find ones that are on the same objects as the ones we've already saved.
// Update them if they do not have unsaved changes.
$.each(skuid.model.list(),function(){
if (uniqueRelatedObjectsToCheck[this.objectName]
&& !this.hasChanged) {
relatedModelsToUpdate.push(this);
}
});

$.when(skuid.model.updateData(relatedModelsToUpdate)).then(function(){
$.each(popup.children(),function(){
var obj = $(this).data('component');
if (obj && obj.unregister) obj.unregister();
});
popup.dialog('destroy');

// Create new Rows in our Models to Save,
// to prepare for the NEXT time someone creates a new record
$.each(modelsToSave,function(){
this.createRow();
});

});
} else {
popup.unblock();
}
}});
Photo of Brayden Smith

Brayden Smith

  • 1,078 Points 1k badge 2x thumb
1. I'm on 7.27
2. It runs just as slow in IE
3. Every page loads quickly (under 5 seconds). The two that take the longest are on the account object, and both of them have this error
4. The only error I'm getting is the above "skuid__SkuidJS:23 Refused to set unsafe header "User-Agent""
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
Ok. You can upgrade to 7.36.

Also, how many Accounts do you have in your org?
Photo of Brayden Smith

Brayden Smith

  • 1,078 Points 1k badge 2x thumb
Thanks for all your help on this.

I went ahead and upgraded to 7.36, and am still receiving the errors, and page load is still over 30 seconds.

There are 4,050 in our Sandbox.
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
I'm stumped.
Photo of Brayden Smith

Brayden Smith

  • 1,078 Points 1k badge 2x thumb
I'm at a loss here. I've just re-verified that it only occurs on the two pages where I have a model based on the account object.

Also, I created a completely new page with one account model, that is not assigned as a child page. And received the attached error.

Photo of Dave

Dave

  • 5,538 Points 5k badge 2x thumb
Hi,

In case you have 1 model condition based on another model that is returning no row, see this post

https://community.skuid.com/skuid/topics/page-load-very-slow-if-no-records-found-or-no-record-meet-d...
Photo of Brayden Smith

Brayden Smith

  • 1,078 Points 1k badge 2x thumb

In this case, it's just a basic condition. It's not based on any other models.

Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
If you kill your javascript does that improve things? 

Have you looked at the performance tuning guide?  It shows you have to look deeply at what is happening in the salesforce developer console.  
http://help.skuid.com/m/supercharge-your-ui/l/391568-skuid-page-performance-guide