Friday, 15 August 2014

c# - How can I decrease the render time of this view? -



c# - How can I decrease the render time of this view? -

it takes long time view render. consists of table populated 90 table records. db calls running quickly, takes while display records. here bit of code causing sluggishness:

<table> @for (int = 0; < model.positionedits.count; i++) { <tr> <td> @html.displayfor(x => x.positionedits[i].positionid) @html.hiddenfor(x => x.positionedits[i].positionid) </td> <td> @html.displayfor(x => x.positionedits[i].positiondescr) @html.hiddenfor(x => x.positionedits[i].description) </td> <td> @*editable*@ @html.dropdownlist("position", new selectlist(model.positions), model.positionedits[i].position) @html.hiddenfor(x => x.oldpositions[i].position) @html.hiddenfor(x => x.positionedits[i].position) </td> </tr> } </table>

i realize paginating solve problem, hoping show ~90 records on same page. there way can improve view decrease load time?

first , foremost, if you're still in local development, if you're using debug in visual studio, absolute wrong time worry things page load times. you're dealing light-weight single-headed server tons of overhead caused integration , forth visual studio , tooling. page load times meaningless.

once you've got workable, can deploy production-ready server environment test performance. unless you're running on total blown iis on dedicated web server actual ram , other resources plan devote site in production, measurement of performance meaningless it's out of context.

if it's still slow, don't see way perchance (90 records on actual web server total iis modest amount of scheme resources trivial), you'll need investigate part slowing down. there's time involved in initial transmission of request, database queries, actual server time generating response, time send response user, time takes browser render html , css, issue requests/receive responses additional resources css, js files , images, , time execute js on page.

using developer tools of browser (chrome has particular set in regard), should able see gantt chart indicating when each request issued , how long took response. tells part of story though. you'll need additional tools dig deeper 1 time find problem areas at. utilize glimpse. give detailed info how long every part of process took , pieces of application slowing down. steps need take prepare problem largely depend on causing problem, far still mystery.

c# asp.net-mvc

No comments:

Post a Comment