diff options
author | Joffrey Huguet <huguet@adacore.com> | 2019-08-14 09:52:58 +0000 |
---|---|---|
committer | Pierre-Marie de Rodat <pmderodat@gcc.gnu.org> | 2019-08-14 09:52:58 +0000 |
commit | 4b0f6ee8b58dedc18192933e35f81b2b71d44fe7 (patch) | |
tree | bbb97fab40b6429d3c36b9ea1850eba416b81cf5 /gcc/builtins.c | |
parent | ff0889eb4d7f34270a6cddb3351fe8ee4fc9bbe0 (diff) | |
download | gcc-4b0f6ee8b58dedc18192933e35f81b2b71d44fe7.zip gcc-4b0f6ee8b58dedc18192933e35f81b2b71d44fe7.tar.gz gcc-4b0f6ee8b58dedc18192933e35f81b2b71d44fe7.tar.bz2 |
[Ada] Improve performance of Containers.Functional_Base
This patch modifies the implementation of Functional_Base to damp the
cost of its subprograms at runtime in specific cases. Instead of copying
the entire underlying array to create a new container, containers can
share the same Array_Base attribute. Performance on common use cases of
formal and functional containers is improved with this patch.
2019-08-14 Joffrey Huguet <huguet@adacore.com>
gcc/ada/
* libgnat/a-cofuba.ads: Add a Length attribute to type
Container. Add a type Array_Base which replaces the previous
Elements attribute of Container.
(Content_Init): New subprogram. It is used to initialize the
Base attribute of Container.
* libgnat/a-cofuba.adb (Resize): New subprogram. It is used to
resize the underlying array of a container if necessary.
(=, <=, Find, Get, Intersection, Length, Num_Overlaps, Set,
Union): Update to match changes in type declarations.
(Add): Modify body to damp the time and space cost in a specific
case.
(Content_Init): New subprogram. It is used to initialize the
Base attribute of Container.
(Remove): Modify body to damp the time and space cost in a
specific case.
From-SVN: r274474
Diffstat (limited to 'gcc/builtins.c')
0 files changed, 0 insertions, 0 deletions