summaryrefslogtreecommitdiff
path: root/src/buffer.inl.hh
AgeCommit message (Collapse)Author
2025-02-04Revert "WIP linked list shared strings"Maxime Coste
This got pushed by accident This reverts commit 2856b99e0914cc7a659977f2b33308cb5b4c9bb7.
2025-01-22WIP linked list shared stringsMaxime Coste
2024-12-03Compact BufferIterator to avoid paddingMaxime Coste
2024-12-03Do not store buffer pointer in BufferIteratorMaxime Coste
This makes BufferIterator smaller and trivially move/copyable
2024-11-30Cache buffer lines ArrayView in BufferIteratorMaxime Coste
The extra indirection of going through the buffer can be costly as the compiler does not know the buffer is not supposed to be mutated during iteration, so it has to actually reload the values which adds memory accesses in the Buffer instance which can be costly in say regex searches where memory access tends to dominate performance. Storing this in the BufferIterator lets the compiler put this info in registers and not reload it.
2023-01-21Replace std::strong_ordering with auto return type to not require <compare>Maxime Coste
2022-11-20Change BufferIterator comparison to assert same bufferMaxime Coste
Comparing iterators between buffers should never happen, and the only place we did was with default constructed BufferIterator which we replace by casting the iterator to bool. This should improve performance on iterator heavy code.
2021-11-21Convert comparisons to spaceship operatorMaxime Coste
2018-11-01Use BufferCoord sentinel type for regex matching on BufferIteratorsMaxime Coste
BufferIterators are large-ish, and need to check the buffer pointer on comparison. Checking against a coord is just a 64 bit comparison.
2018-10-30Buffer: Remove m_line_count field from BufferIteratorMaxime Coste
It seems unlikely this would give performance gain, as buffer lines are always accessed when we read that field, leading to all the necessary data already being in memory. Removing it reduces the size of a BufferIterator, which are already pretty hefty objects.
2017-06-12Simplify a bit buffer iteration functionsMaxime Coste
Dont try to ensure the returned value is valid, incrementing past the end/decrementing before begin is the caller's error.
2017-06-11Fix the Buffer::end() madnessMaxime Coste
Until now, buffer had multiple recognized end coordinates, either { line_count, 0 } or { line_count - 1, line[line_count - 1].length }. Now the only correct end coord is { line_count, 0 }, removing the need for various special cases.
2017-06-07noexept-ify BufferIterator methodsMaxime Coste
2017-02-20Fix performance of word completion with many different selectionsMaxime Coste
Fixes #1228
2016-10-01Support codepoints of variable widthMaxime Coste
Add a ColumnCount type and use it in place of CharCount whenever more appropriate, take column size of codepoints into account for vertical movements and docstring wrapping. Fixes #811
2016-07-15Make buffer iterator iteration/dereference fasterMaxime Coste
2016-04-27Make use of strongly typed number to size_t conversionMaxime Coste
2016-04-21Allow equality comparison between buffer iterators from differnt buffersMaxime Coste
2016-03-09It can happen during an undo/redo that the buffer be temporarily emptyMaxime Coste
Fix is_end in that case.
2016-01-27Make BufferIterator::operator* return a const ref to be more compatibleMaxime Coste
2015-12-12Fix Buffer::changes_since if we get passed an invalid timestampMaxime Coste
2015-11-12Faster BufferIterator::operator++/--Maxime Coste
2015-11-10Remove useless checks, buffer has always at list one lineMaxime Coste
2015-11-07Optimize BufferIterator to avoid a lot of pointer chasingMaxime Coste
2015-11-04Rework Buffer::distance implementationMaxime Coste
2015-06-24Style tweakMaxime Coste
2015-03-09ArrayView content is not const anymoreMaxime Coste
As in upcoming std c++ array_view, ArrayView<T> points to mutable data, use ArrayView<const T> or alias ConstArrayView<T> for const data.
2015-02-26Tweak BufferIterator::{+=,-=} implementationMaxime Coste
2015-01-06Rename memoryview to ArrayViewMaxime Coste
2014-10-28Fix invalid memory access when applying modifications on an empty bufferMaxime Coste
That can happen when undoing/redoing accross a buffer reload boundary.
2014-08-17Always inline a few more methodsMaxime Coste
2014-07-19Add some more force inlines to some buffer methodsMaxime Coste
2014-05-24Remove use of 'offset' in buffer iterators, lines are just StringMaxime Coste
No need to maintain line offsets anymore.
2014-05-17Remove per lines timestamp in BufferMaxime Coste
2014-05-13negative coordinates are invalidMaxime Coste
2014-05-12Maintain an append-only list of changes in BufferMaxime Coste
2014-05-07Refactor LineAndColumn coordinatesMaxime Coste
BufferCoord -> ByteCoord DisplayCoord -> CharCoord Moved their definition along with LineAndColumn into coord.hh
2014-04-01Minor formatting changesMaxime Coste
2014-01-12rename buffer_iterator.inl.hh as buffer.inl.hh and inline some more methodsMaxime Coste