summaryrefslogtreecommitdiff
path: root/absl/strings/cord_analysis.cc
Commit message (Collapse)AuthorAge
* Introduce a kTotalMorePrecise accounting mode for ↵Gravatar Abseil Team2023-06-29
| | | | | | | | | Cord::EstimatedMemoryUsage(). This mode avoids double-counting blocks that a Cord references more than once; otherwise it is similar to the existing kTotal mode. There's no change to the existing kTotal or kFairShare accounting modes. PiperOrigin-RevId: 544378591 Change-Id: I7b4ae55cd93d631194e59a9cd0ff07f47611219e
* Export of internal Abseil changesGravatar Abseil Team2022-02-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -- ed829ac612f090375427c3488827c6e74deb2e3f by Derek Mauro <dmauro@google.com>: Update latest GCC/Clang Linux tests to Bazel 5.0.0 and CMake 3.22.2 PiperOrigin-RevId: 429369775 -- 76952303c4d942288c4e7657ffb5893cec54a132 by Martijn Vels <mvels@google.com>: Optimize Cord::ChunkIterator now that CordRepConcat is removed PiperOrigin-RevId: 429321455 -- dcd0d287793649aba9b98268c5783e449a34749f by Martijn Vels <mvels@google.com>: Add IsDataEdge() and DataEdgeValue() helper functions. This moves repetitive logic accessing data edges into its own header, and more strongly defines the notion of what a data edge is, enforcing the internal invariants. This will also be incorporated in optimized Cord iteration logic once CordRepConcat is totally removed from the Cord code. PiperOrigin-RevId: 429307248 -- 6a0903962155988085bf8656743fda9c4cdcba6c by Abseil Team <absl-team@google.com>: Make it clear that the probability function given for the zipf distribution is unnormalized, i.e., sum(p(x) for x = 0..k) != 100%. Quoting Section 7 of the paper cited in the comments, where this formula comes from (emphasis mine): "We will consider the two parameter generalization as defined in Dagpunar [1988] with the *unnormalized* probability function ..." PiperOrigin-RevId: 429068258 -- 3899ff6d444ba755148bc521a6ee031d9e9d4485 by Abseil Team <absl-team@google.com>: Internal Changes PiperOrigin-RevId: 428644856 -- 319de702d2b537cbb76c4c71277ae89b349b162e by Benjamin Barenblat <bbaren@google.com>: Support symbolization on PA-RISC Null out supervisor bits in PA-RISC addresses before symbolizing, and handle function descriptor tables correctly. Change symbolize_test.cc to use 32-bit aligned addresses, allowing that test to pass on PA-RISC. PiperOrigin-RevId: 428590564 GitOrigin-RevId: ed829ac612f090375427c3488827c6e74deb2e3f Change-Id: Ie01ff3b9365fd45e5a55f858038552679f3180d3
* Export of internal Abseil changesGravatar Abseil Team2022-02-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -- ceee18732f9499d3a53d46d5974f12ea0774b900 by Abseil Team <absl-team@google.com>: Remove division from the profile guided optimization PiperOrigin-RevId: 428444108 -- fc27059f1b0c0b4cb8ddd9a7a88220af52c0c755 by Evan Brown <ezb@google.com>: Rename btree_node::leaf to is_leaf and also add is_internal for readability improvements. PiperOrigin-RevId: 428076422 -- 6a90d18477cc3a6de84282b6e38d6f294aa72748 by Evan Brown <ezb@google.com>: In sanitizer mode, add generation integers to b-tree nodes and iterators and validate that iterators have not been invalidated already when they're used. Even though generation integers are stored in all nodes, we only use the one stored in the root node for validation. The reason we keep one in all the nodes is that nodes can become a root node after they are allocated. Also change the order of args in init_leaf to not violate the style guide. PiperOrigin-RevId: 428054226 -- ede4a0f676f43e7003fd2599c263d55222e760ba by Martijn Vels <mvels@google.com>: Physically remove CordRepConcat This CL removes all uses of CordRepConcat. This change is executed by removing all the dead 'btree_enabled()' and 'IsConcat' branches, and all subsequent dead code. This change explicitly does not optimize any of the remaining code other than the most trivial ones such as removing 'stack' loop vars and loops. PiperOrigin-RevId: 428002308 -- 7cc83d96118149cf1aa1258a066b8fd4517df5f6 by Evan Brown <ezb@google.com>: Change btree_iterator from a struct to a class. Motivation: btree_iterator has private members and invariants so it should be a class. Also merge two private sections. PiperOrigin-RevId: 427768836 -- 524d478b0af422e1a867a8823d9fbad149030360 by Martijn Vels <mvels@google.com>: Physically block the creation of new CordRepConcat nodes. This change removes CordRepConcat creation, issuing a FATAL errors on the (practically impossible) call path on broken invariants. This change is deliberately limited in impact, subsequent changes will be more voluminous ripping out the (now dead) CordRepConcat code. PiperOrigin-RevId: 427741022 -- e21eb354c1bb358ea8b64d0e3fbb378e87b8b8c4 by Derek Mauro <dmauro@google.com>: Update the implementation of ABSL_DEPRECATED to work with GCC, and recommend using the standard attribute [[deprecated]] for C++14 and newer GCC users that are experiencing new warnings can silence them with -Wno-deprecated-declatations. GCC users that want to see the warnings but not error on them can use -Wno-error=deprecated-declarations. PiperOrigin-RevId: 427228952 -- 0ab4ee5660f3a072054dc4ab5056925c26977c7a by Laramie Leavitt <lar@google.com>: Change comment to avoid overflow. PiperOrigin-RevId: 427090218 GitOrigin-RevId: ceee18732f9499d3a53d46d5974f12ea0774b900 Change-Id: Ida00477b6a3d02a8b7bb467be7621b618385d1e9
* Export of internal Abseil changesGravatar Abseil Team2022-02-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -- 262f6992ee0553782531ad58dd7d8bcd6d0b7bb7 by Martijn Vels <mvels@google.com>: Remove CordRepConcat uses in tests and CONCAT constants. This change removes the creation and uses of CordRepConcat in unit tests, and replaces some remaining CONCAT constants with IsConcat() to make subsequent teardown of CordrepConcat uses easier. PiperOrigin-RevId: 426932694 -- fd590f7e849ba8c5395c589ed3f762cd00affdc8 by Abseil Team <absl-team@google.com>: Replace NULL and 0 with nullptr. PiperOrigin-RevId: 426912932 -- 183e5babc478748023f732a1608745a2a544c996 by Abseil Team <absl-team@google.com>: Replace "span of time" with "amount of time" in the first comment line, to make it clearer that we're not talking about a duration that starts at a specific time. PiperOrigin-RevId: 426691794 -- e28ca760f21505f1be55c7af336eb61d2f1b7fea by Martijn Vels <mvels@google.com>: Add extra assertions on CordRepSubstring child nodes PiperOrigin-RevId: 426369104 GitOrigin-RevId: 262f6992ee0553782531ad58dd7d8bcd6d0b7bb7 Change-Id: I7ffdaa2dc999a2117944c9abdb1565b6b6f48b59
* Export of internal Abseil changesGravatar Abseil Team2021-12-15
-- 81f95fcf85b75b84f9892c73123501472b9cff33 by Martijn Vels <mvels@google.com>: Introduce GetEstimatedMemoryUsage(CordMemoryAccounting::kFairShare) Memory usage analysis is moved into a separate cord_analysis.cc source. PiperOrigin-RevId: 416370158 -- 6bc7b1348fd27fe53f100c9eabd47f4f2cb9c19c by Abseil Team <absl-team@google.com>: Support scoped enum in absl::Substitute. PiperOrigin-RevId: 416345422 -- 6399f4f6ae05ebcd67664ebd844902f699ab8ec7 by Abseil Team <absl-team@google.com>: Correct the computation of contention cycles Currently, we record contention cycles from the first time a thread started waiting on a mutex. Consider a situation in which two threads, T1 and T2, run a loop at the top of which they acquire a common mutex and release it at the end of the loop body. Further assume that T2 is never able to acquire the mutex as T1 repeatedly acquires and then releases the mutex. In this case, we would expect that the reported contention cycles would be increase linearly over time. But currently we observe a quadratic behavior in the reported waiting time as mentioned in b/14684244#comment10. To fix the issue, this CL records the contention cycles experienced by all the threads woken up when the mutex is released. Further, contention_start_cycles is set to the current time since the contention cycles for the time already passed has been taken into account. With this CL, we get a linear increase in the waiting time, the expected behavior. PiperOrigin-RevId: 416322593 -- 149c1637c8a0f1a38e5a8f9f27e5803a2015a554 by Jorg Brown <jorg@google.com>: Make Status::EmptyString more efficient by constructing it in global space, rather than on the heap. See https://godbolt.org/z/8M9n7YqcY for reduced code size. PiperOrigin-RevId: 416307833 -- 3b4562a8be5a3c80077cb67b0a32c97419058380 by Abseil Team <absl-team@google.com>: Clarify the usage of RegisterMutexProfiler PiperOrigin-RevId: 416146130 GitOrigin-RevId: 81f95fcf85b75b84f9892c73123501472b9cff33 Change-Id: Iccb72d7ee617e6ebe226a38170d62e0849b43480