Maximize your program's laziness (#58)
Dr. David Q Mertz (Gnosis Software) bio
30min ◊◊ Intermediate
Friday 02:15pm, Centennial I
categories:
case study, design, optimization, tutorial
Gordon Bell's observation that "The cheapest, fastest and most reliable components of a computer system are those that aren't there" has a parallel in data structures. The fastest, most parsimonious, and best performing data structure is one which is never concretized within a program run. A promise to create data when, or if, it is needed is often easy to make without needing to realize the data computationally.
The addition of iterators and generators to Python during the 2.x series, and their more systematic use in 3.x, provides an easy way to work with lazy computation. Using these facilities well can improve program performance, often in terms of big-O complexity even. However, sometimes more complex lazy data structures require special design in order to encapsulate more complex promises than one can make with list-like iterators.
The addition of iterators and generators to Python during the 2.x series, and their more systematic use in 3.x, provides an easy way to work with lazy computation. Using these facilities well can improve program performance, often in terms of big-O complexity even. However, sometimes more complex lazy data structures require special design in order to encapsulate more complex promises than one can make with list-like iterators.
Files:
| file | size | uploaded | comment |
|---|---|---|---|
| Slides.pdf | 226.0 KB | Wed, Feb. 17th, 5:22 p.m. | The presentation (read-only) |
| Slides.odp | 71.9 KB | Wed, Feb. 17th, 5:22 p.m. | The presentation (source document) |
| Slides_.odp | 71.9 KB | Wed, Feb. 17th, 5:22 p.m. | The presentation (source document) |
video:# Permalink
.