compact arrays in python in the introduction to this sectionwe emphasized that strings are represented using an array of characters (not an array of referenceswe will refer to this more direct representation as compact array because the array is storing the bits that represent the primary data (charactersin the case of stringss compact arrays have several advantages over referential structures in terms of computing performance most significantlythe overall memory usage will be much lower for compact structure because there is no overhead devoted to the explicit storage of the sequence of memory references (in addition to the primary datathat isa referential structure will typically use -bits for the memory address stored in the arrayon top of whatever number of bits are used to represent the object that is considered the element alsoeach unicode character stored in compact array within string typically requires bytes if each character were stored independently as one-character stringthere would be significantly more bytes used as another case studysuppose we wish to store sequence of one million -bit integers in theorywe might hope to use only million bits howeverwe estimate that python list will use four to five times as much memory each element of the list will result in -bit memory address being stored in the primary arrayand an int instance being stored elsewhere in memory python allows you to query the actual number of bytes being used for the primary storage of any object this is done using the getsizeof function of the sys module on our systemthe size of typical int object requires bytes of memory (well beyond the bytes needed for representing the actual -bit numberin allthe list will be using bytes per entryrather than the bytes that compact list of integers would require another important advantage to compact structure for high-performance computing is that the primary data are stored consecutively in memory note well that this is not the case for referential structure that iseven though list maintains careful ordering of the sequence of memory addresseswhere those elements reside in memory is not determined by the list because of the workings of the cache and memory hierarchies of computersit is often advantageous to have data stored in memory near other data that might be used in the same computations despite the apparent inefficiencies of referential structureswe will generally be content with the convenience of python' lists and tuples in this book the only place in which we consider alternatives will be in which focuses on the impact of memory usage on data structures and algorithms python provides several means for creating compact arrays of various types