diff options
author | Steve Baird <baird@adacore.com> | 2022-07-26 17:17:17 -0700 |
---|---|---|
committer | Marc Poulhiès <poulhies@adacore.com> | 2022-09-05 09:21:06 +0200 |
commit | cb6ff9e4198c6cd5abd915e271ea33d50f48b3d8 (patch) | |
tree | 04ab8aeaeb3d457f77b98ed7bc8cf065f4a4cbad /libcpp | |
parent | 66d4ff2658fc2d5115092da29249191feac75308 (diff) | |
download | gcc-cb6ff9e4198c6cd5abd915e271ea33d50f48b3d8.zip gcc-cb6ff9e4198c6cd5abd915e271ea33d50f48b3d8.tar.gz gcc-cb6ff9e4198c6cd5abd915e271ea33d50f48b3d8.tar.bz2 |
[Ada] Single-element Append performance improvement
Ada.Containers.Vectors has two Append procedures that take an
Element value; one takes a Count parameter and one does not
(the count is implicitly one for the latter). For the former version,
there was code that took a faster path if certain conditions were met
and otherwise took a slower path; one of the prerequisite conditions
for this was Count = 1. For the latter version, no such special-case
detection was performed; the more general code was always executed.
Move the special-case detection/handling code from the former version into
the latter and change the former version to simply call the latter version
if Count = 1. Also apply same change to Ada.Containers.Indefinite_Vectors.
gcc/ada/
* libgnat/a-coinve.adb, libgnat/a-convec.adb
(Append): If the Append that takes an Element and a Count is
called with Count = 1, then call the Append that does not take a
Count parameter; otherwise call the code that handles the general
case. Move the special case detection/handling code that was
formerly in that version of Append into the version that does not
take a Count parameter, so that now both versions get the
performance benefit.
Diffstat (limited to 'libcpp')
0 files changed, 0 insertions, 0 deletions