- Register, accept the Disclaimer and choose subscription option.
By choosing the Free Account option you will only be able to download the teaser of each issue.
- Verify your account using the verification link sent to your email address.
- Check the password sent on your email address and use it to log in.
- Click the download button to get the issue.
Demistifying Lazy Load Pattern
by Milan Vukoje
Performance is very important for an application because our dear users would love our application much more if it just worked faster. High performance is not an easy task, but it is not impossible. Users usually cannot even imagine what the system is going on behind the curtains. But can we really persuade our users that they are requesting too much when Google does so much more? Google search is accessing more data for more concurrent users and it works lightning fast. Fast enough to autosuggest. Fast enough to show search results key stroke by key stroke. Fast enough to show you the duration of the search, since you will not be able to tell by looking. If Google took one minute to give you a million search matches that would be reasonable but you wouldn’t be happy.
According to Wikipedia:
“Lazy loading is a design pattern commonly used in computer programming to defer initialization of an object until the point at which it is needed. It can contribute to efficiency in the program’s operation if properly and appropriately used.”
I think of lazy load pattern as a simple code convention (Code listing 1) where some property or method once prompted to return some data, first checks if data is already loaded in some local cache, if not loads it and returns the data to the caller. Cached data is only loaded once and beside the performance gain, there is simplicity and delayed performance impact from the data load. (…)