Back to Eastl

EASTL Modules

doc/Modules.md

3.27.018.6 KB
Original Source

EASTL Modules

Introduction

We provide here a list of all top-level modules present or planned for future presence in EASTL. In some cases (e.g. algorithm), the module consists of many smaller submodules which are not described in detail here. In those cases you should consult the source code for those modules or consult the detailed documentation for those modules. This document is a high level overview and not a detailed document.

Module List

ModuleDescription
configConfiguration header. Allows for changing some compile-time options.
slist
fixed_slistSingly-linked list.
fixed_slist is a version which is implemented via a fixed block of contiguous memory.
list
fixed_listDoubly-linked list.
intrusive_list
intrusive_slistList whereby the contained item provides the node implementation.
arrayWrapper for a C-style array which extends it to act like an STL container.
vector
fixed_vectorResizable array container.
vector_set
vector_multisetSet implemented via a vector instead of a tree. Speed and memory use is improved but resizing is slower.
vector_map
vector_multimapMap implemented via a vector instead of a tree. Speed and memory use is improved but resizing is slower.
dequeDouble-ended queue, but also with random access. Acts like a vector but insertions and removals are efficient.
bit_vectorImplements a vector of bool, but the actual storage is done with one bit per bool. Not the same thing as a bitset.
bitsetImplements an efficient arbitrarily-sized bitfield. Note that this is not strictly the same thing as a vector of bool (bit_vector), as it is optimized to act like an arbitrary set of flags and not to be a generic container which can be iterated, inserted, removed, etc.
set
multiset
fixed_set
fixed_multisetA set is a sorted unique collection, multiset is sorted but non-unique collection.
map
multimap
fixed_map
fixed_multimapA map is a sorted associative collection implemented via a tree. It is also known as dictionary.
hash_map
hash_multimap
fixed_hash_map
fixed_hash_multimapMap implemented via a hash table.
intrusive_hash_map
intrusive_hash_multimap
intrusive_hash_set
intrusive_hash_multisethash_map whereby the contained item provides the node implementation, much like intrusive_list.
hash_set
hash_multiset
fixed_hash_set
fixed_hash_mapSet implemented via a hash table.
basic_string
fixed_string
fixed_substringbasic_string is a character string/array.
fixed_substring is a string which is a reference to a range within another string or character array.
cow_string is a string which implements copy-on-write.
algorithmmin/max, find, binary_search, random_shuffle, reverse, etc. 
sortSorting functionality, including functionality not in STL. quick_sort, heap_sort, merge_sort, shell_sort, insertion_sort, etc.
numericNumeric algorithms: accumulate, inner_product, partial_sum, adjacent_difference, etc.
heapHeap structure functionality: make_heap, push_heap, pop_heap, sort_heap, is_heap, remove_heap, etc.
stackAdapts any container into a stack.
queueAdapts any container into a queue.
priority_queueImplements a conventional priority queue via a heap structure.
type_traitsType information, useful for writing optimized and robust code. Also used for implementing optimized containers and algorithms.
utilitypair, make_pair, rel_ops, etc.
functionalFunction objects.
iteratorIteration for containers and algorithms.
smart_ptrSmart pointers: shared_ptr, shared_array, weak_ptr, scoped_ptr, scoped_array, linked_ptr, linked_array, intrusive_ptr.
 

Module Behaviour

The overhead sizes listed here refer to an optimized release build; debug builds may add some additional overhead. Some of the overhead sizes may be off by a little bit (usually at most 4 bytes). This is because the values reported here are those that refer to when EASTL's container optimizations have been complete. These optimizations may not have been completed as you are reading this.

ContainerStoresContainer Overhead (32 bit)Container Overhead (64 bit)Node Overhead (32 bit)Node Overhead (64 bit)Iterator categorysize() efficiencyoperator[] efficiencyInsert efficiencyErase via Iterator efficiencyFind efficiencySort efficiency
slistT81648fn-11nn+
listT1224816bn-11nn log(n)
intrusive_slistT4848fn-111n+
intrusive_listT816816bn-111n log(n)
arrayT0000r11--nn log(n)
vectorT163200r111 at end, else n1 at end, else nnn log(n)
vector_setT163200r111 at end, else n1 at end, else nlog(n)1
vector_multisetT163200r111 at end, else n1 at end, else nlog(n)1
vector_mapKey, T163200r111 at end, else n1 at end, else nlog(n)1
vector_multimapKey, T163200r111 at end, else n1 at end, else nlog(n)1
dequeT448400r111 at begin or end, else n / 21 at begin or end, else n / 2nn log(n)
bit_vectorbool81600r111 at end, else n1 at end, else nnn log(n)
string (all types)T163200r111 at end, else n1 at end, else nnn log(n)
setT24441628b1-log(n)log(n)log(n)1
multisetT24441628b1-log(n)log(n)log(n)1
mapKey, T24441628b1log(n)log(n)log(n)log(n)1
multimapKey, T24441628b1-log(n)log(n)log(n)1
hash_setT162048b1-111-
hash_multisetT162048b1-111-
hash_mapKey, T162048b1-111-
hash_multimapKey, T162048b1-111-
intrusive_hash_setT162048b1-111-
intrusive_hash_multisetT162048b1-111-
intrusive_hash_mapT <small>(Key == T)</small>162048b1-111-
intrusive_hash_multimapT <small>(Key == T) </small>162048b1-111-
  • - means that the operation does not exist.
  • 1 means amortized constant time. Also known as O(1)
  • n means time proportional to the container size. Also known as O(n)
  • log(n) means time proportional to the natural logarithm of the container size. Also known as O(log(n))
  • n log(n) means time proportional to log(n) times the size of the container. Also known as O(n log(n))
  • n+ means that the time is at least n, and possibly higher.
  • Iterator meanings are: f = forward iterator; b = bidirectional iterator, r = random iterator.
  • Overhead indicates approximate per-element overhead memory required in bytes. Overhead doesn't include possible additional overhead that may be imposed by the memory heap used to allocate nodes. General heaps tend to have between 4 and 16 bytes of overhead per allocation, depending on the heap.
  • Some overhead values are dependent on the structure alignment characteristics in effect. The values reported here are those that would be in effect for a system that requires pointers to be aligned on boundaries of their size and allocations with a minimum of 4 bytes (thus one byte values get rounded up to 4).
  • Some overhead values are dependent on the size_type used by containers. We assume a size_type of 4 bytes, even for 64 bit machines, as this is the EASTL default.
  • Inserting at the end of a vector may cause the vector to be resized; resizing a vector is O(n). However, the amortized time complexity for vector insertions at the end is constant.
  • Sort assumes the usage of the best possible sort for a large container of random data. Some sort algorithms (e.g. quick_sort) require random access iterators and so the sorting of some containers requires a different sort algorithm. We do not include bucket or radix sorts, as they are always O(n).
  • Some containers (e.g. deque, hash*) have unusual data structures that make per-container and per-node overhead calculations not quite account for all memory.

End of document