Skip to main content

Compression

  • Chapter
  • First Online:
Programming Algorithms in Lisp
  • 1173 Accesses

Abstract

Compression is one of the tools that every programmer should understand and wield confidently. Such situations when the size of the dataset is larger than the program can handle directly and it becomes a bottleneck are quite frequent and can be encountered in any domain. There are many forms of compression, yet the most general subdivision is between lossless one which preserves the original information intact and lossy compression which discards some information (assumed to be the most useless part or just noise). Lossless compression is applied to numeric or text data, whole files, or directories—the data that will become partially or utterly useless if even a slight modification is made. Lossy compression, as a rule, is applied to data that originates in the "analog world": sound or video recordings, images, and so on. We have touched the subject of lossy compression slightly in the previous chapter when talking about such formats as JPEG. In this chapter, we will discuss the lossless variants in more detail. Besides, we'll talk a bit about other, non-compressing forms of encoding.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 29.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 37.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    To make full use of this feature and be able to profile SBCL internal functions, you’ll need to compile SBCL with the --with-cons-profiling flag. Many thanks to Douglas Katzman for developing this feature and guiding me through its usage.

  2. 2.

    It was verified by taking the average of multiple test runs.

  3. 3.

    You can study the details in the relevant article.

  4. 4.

    Some implementations (for instance, SBCL) have “smart enough” compilers to perform constant folding of such expressions. However, read-eval may be used to help the compiler if it is not smart enough.

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2021 Vsevolod Domkin

About this chapter

Check for updates. Verify currency and authenticity via CrossMark

Cite this chapter

Domkin, V. (2021). Compression. In: Programming Algorithms in Lisp. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-6428-7_14

Download citation

Publish with us

Policies and ethics