Chapter 10. Blocks of Data

IN THIS CHAPTER

Often, the programs you write will at some point need to perform actions on blocks of data. Think, for instance, of using numerical information for setting up graphics, or handling a textual database of client addresses. Your program might need to go through a large base of such addresses in order to produce a list of clients ordered by name, ZIP code, or age grouping. Perhaps you even need to generate specific subsets from a certain base of information, creating a list of clients with outstanding orders or bills, for instance. Of course, the larger the blocks of data are that your program needs to analyze, the more important become the algorithms it analyzes with. This chapter highlights the performance and footprint implications of various algorithms that are often used for just these kinds of actions, pointing out when and why slowdown can occur. It also introduces new techniques that may help you speed up your programs.

Throughout this chapter, pieces of example code are presented. The speed of these pieces of code is tested via a large data file named dbase.txt that can be found on the Web site. This data file contains 103,680 articles of a fictitious company; for each article, six attributes are specified. The total size of the data file is 4.8MB.

Note that this chapter focuses solely on using blocks of data. File IO and storage of data in memory are not part of this chapter; they are dealt with in Chapters 11, "Storage Structures," and 12, "Optimizing IO."

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset