Poor Performance with images
Poor Performance with images
Hi
We are using Signal-R to append alarm objects with an image url to a datatable.
The initial 'get' call is an IEnumerable list of alarm objects which are then added to the datatable in the following function
[code]
sr_alarm.server.getAlarms().done(function (alarms) {
$.each(alarms, function () {
addAlarm(this);
});
});
function addAlarm(alarm) {
alarmTable.fnAddData(formatAlarm(alarm));
}
function formatAlarm(alarm) {
return $.extend(alarm, {
Colour: '',
Image: '',// imageUrl,
When: moment(alarm.When).format('L HH:mm'),
Id: alarm.HotListId,
Instruction: alarm.Instruction,
ColourHidden: alarm.Colour
});
[/code]
The alarm object has a property called imageURL which when filled extends the displaying of the rows. For 100 rows the time is ~13 secs. However when the imageURL is empty the loading time is reduced by 6 seconds. Is there a way to optimize this process?
Timings for IE (seconds)
Getting Alarms : Time:00:000
Start Adding Rows: Time:2.373
End Adding Rows: Time:16.016
Also the alarm object being passed into the table is $.extended before adding the row, but is there a preferred method to pass custom objects into the table (json etc) rather than just passing in a javascript object?
TIA
Andrew
We are using Signal-R to append alarm objects with an image url to a datatable.
The initial 'get' call is an IEnumerable list of alarm objects which are then added to the datatable in the following function
[code]
sr_alarm.server.getAlarms().done(function (alarms) {
$.each(alarms, function () {
addAlarm(this);
});
});
function addAlarm(alarm) {
alarmTable.fnAddData(formatAlarm(alarm));
}
function formatAlarm(alarm) {
return $.extend(alarm, {
Colour: '',
Image: '',// imageUrl,
When: moment(alarm.When).format('L HH:mm'),
Id: alarm.HotListId,
Instruction: alarm.Instruction,
ColourHidden: alarm.Colour
});
[/code]
The alarm object has a property called imageURL which when filled extends the displaying of the rows. For 100 rows the time is ~13 secs. However when the imageURL is empty the loading time is reduced by 6 seconds. Is there a way to optimize this process?
Timings for IE (seconds)
Getting Alarms : Time:00:000
Start Adding Rows: Time:2.373
End Adding Rows: Time:16.016
Also the alarm object being passed into the table is $.extended before adding the row, but is there a preferred method to pass custom objects into the table (json etc) rather than just passing in a javascript object?
TIA
Andrew
This discussion has been closed.
Replies
Allan
I'll give that a try in the morning - thanks for the prompt reply