1

i have mvc3 site where in one scenario i had to load 1000 records and it is taking way too much time. the query runs for 1 sec and displaying data takes almost 12 secs. Is there any way to display some part of the data while loading remaining data. It is serious performance issue.

Any suggesstions or samples are greatly appreciated.

2
  • Sounds like front end design, either paginate the result set or rework the way the data is rendered Commented Nov 20, 2012 at 1:49
  • Please, stop referring to "ASP.NET MVC" simply as "MVC". One is a framework, while other is a language-independent design pattern. It's like calling IE - "the internet" Commented Nov 20, 2012 at 17:43

1 Answer 1

1

You could have web workers load the data and send it to the main application as it loads and then the main application can update this in the DOM giving a very non-blocking flow of data.

You would probably want to create a worker (or maybe a few) that will make an XHR to the server for a piece of the data, send it to the main application as a message and then do this over and over again until you've loaded all the data. Simultaneously, you would have the main part of the application listening for the messages from the worker and updating the DOM according to the messages, because the communication between the application and the Web Worker is asynchronous, it will not block the flow of the website and won't display messages saying a script has stopped.

You can learn more about web workers at http://www.html5rocks.com/en/tutorials/workers/basics/

Sign up to request clarification or add additional context in comments.

3 Comments

do you have a sample so that i can get real idea as i never worked with web workers before. thanks in advance
also is there something like this for ie8. sorry to be picky on this.
Unfortunately, I don't think so, at least that I know of, I'm not a big fan of ie.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.