Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is Lazy Loading?

What is Lazy Loading?

[Edit after reading a few answers] Why do people use this term so often?

Say you just use a ASP/ADO recordset and load it with data or ADO.NET Datasource for a gridview.

I guess I should have asked why people use the term Lazy Loading, what "other" types are their?

like image 507
Brian Boatright Avatar asked Aug 30 '08 19:08

Brian Boatright


People also ask

What is Lazy Load example?

For example, if a web page has an image that the user has to scroll down to see, you can display a placeholder and lazy load the full image only when the user arrives to its location.

What is lazy loading in simple words?

Lazy loading is a programming technique that delays loading resources until they are needed. A common example is a webpage that defers loading images until the user scrolls to their location within the page.

Is lazy loading good?

Better performance—lazy loading helps you reduce the amount of images required to load when the page is first loaded. This means the page sends less resource requests, uses less bytes when downloading files, and requires less network bandwidth per user.

What is lazy loading in web page?

Lazy loading is a strategy to identify resources as non-blocking (non-critical) and load these only when needed. It's a way to shorten the length of the critical rendering path, which translates into reduced page load times.


1 Answers

It's called lazy loading because, like a lazy person, you are putting off doing something you don't want to. The opposite is Eager Loading, where you load something right away, long before you need it.

If you are curious why people might use lazy loading, consider an application that takes a LOOOOONG time to start. This application is probably doing a lot of eager loading... loading things from disk, and doing calculations and whatnot long before it is ever needed.

Compare this to lazy loading, the application would start much faster, but then the first time you need to do something that requires some long running load, there may be a slight pause while it is loaded for the first time. Thus, with lazy loading, you are amortizing the load time throughout the course of running your application... and you may actually save from loading things that the user may never intend to use.

like image 88
Mike Stone Avatar answered Sep 18 '22 16:09

Mike Stone