192 Commits

Author SHA1 Message Date
Vadim Godunko
e8c4c71f58 Fix flake8 warnings. 2025-01-20 11:51:53 +00:00
Joel Brobecker
af28fe615c Add flake8 and black pre-commit checks, and reformat python files
This commit introduces a pre-commit config, which checks all
Python files via black (a code foramtter) and flake8 (a style
checker).

This commit also updates all python files after reformatting
by black (obtained by running "pre-commit run --all").

One thing this commit does not do, however, is make any manual
change. In particular, this commit does not address the errors
reported by flake8.
2025-01-20 11:51:53 +00:00
bortolussi
d3aec81e95 Add AdaCore logo in the docs
Add the AdaCore logo in the table of content of the html docs, update
the background color and add and icon.

eng/toolchain/gnatcoll-db#1
2023-11-02 16:15:29 +01:00
Fedor Rybin
68c48d5c78 Use RTD theme, fix typo
TN: V809-018
Change-Id: I1d5f052eb1cb8c9b06f2c4b60a7879aff195d5f1
2022-09-02 15:43:38 +03:00
Vasiliy Fofanov
4a50dcf316 sphinx: remove unused extensions
This comes from the GitHub pull request #18
no-tn-check

Change-Id: Ie5f45d675668ef980a9e1b62567d2c8272c65984
2022-08-14 12:56:11 +02:00
Nicolas Boulenguez
4d41cb85a4 sphinx: remove unused extensions
None of the listed extensions is actually used.
When one is missing, the build crashes.
2021-10-25 18:08:10 +02:00
Nicolas Boulenguez
05ec5ccb9c docs/conf.py: close the version information file 2021-10-25 18:07:44 +02:00
anisimko
9dadb68f7d GNATCOLL.SQL example
U108-018

Change-Id: Ic2be45cd8fa8457416129c1d0f09720d01a49a97
2021-01-10 16:40:35 +06:00
Dimitri Kokkonis
a8e1615821 Migrate to Sphinx 3.2 and Python 3. T421-010
Change-Id: I6c2a665225e713c9fbecc65014d5ad6bd2b8c68a
2020-12-08 17:17:14 +01:00
Vasiliy Fofanov
c067251840 Fix various typos and headers, bump copyright.
Motivated by github PR #14. no-tn-check

Change-Id: I866431c55fe0937f348d08cd8a188eb40fc8f061
2020-06-12 19:29:25 +02:00
Pierre-Marie de Rodat
523d0929ca Import documentation from the obsolete GNATcoll monorepo
Change-Id: I647360a2a2eeb1cba232be2c2b47434854bf2feb
TN: R329-046
2020-02-10 12:42:48 +01:00
Vasiliy Fofanov
ce99ac280e Initial version of gnatcoll-db module.
Part of major reorganization of gnatcoll for better modularity and
maintainability.

Change-Id: Iad961b53634520081eb90c37aff2bfdbf58b2e06
TN: P909-033 no-precommit-check
2017-10-29 15:30:27 +01:00
Nicolas Setton
975c9d590b Remove support for GtkAda, Pygtk, PyGObject
This cleans up the dependency tree. The corresponding code
still exists and has been moved to the GPS repository, which
is probably the only place where this is needed.

For Q727-014

Change-Id: I2c9df154694fb3f1dcdc62c50be68d332a967f59
2017-07-31 11:35:39 -04:00
Nicolas Setton
6c03b10433 Remove reference to -fdump-xref
For Q424-032.

Change-Id: Id56fb5292659dd58e4d089ef85e5923d5a34eff3
2017-04-24 14:20:05 -04:00
Emmanuel Briot
ec00b627a7 Update to use the new API (introduced 2 years ago)
Mentioned in Q319-005

Change-Id: Ic8414ec690cf23e391187a46db75acb0b7c38dbe
2017-03-20 17:58:32 +01:00
Emmanuel Briot
ad422d21c4 Add support for files larger than 2Gb
On 64 bits systems that support the mmap system call, we can now
read files up to one petabyte.

This change is backward compatible.

Add support for using madvise() system call when available. This can
provide some minor speed optimization depending on the system. For
instance, reading sequentially a 3Gb file has the following timing
info:

                     OSX          Linux
    use_advice:     14.98s       9.09s
    use_sequential: 14.62s       8.74s

Q315-030

Change-Id: I85851b55f66db7f5d905923b8ddc0c007b6de1dd
2017-03-18 19:26:47 +01:00
Emmanuel Briot
f26abf8d66 (GNATCOLL.Promises): new package
Q314-010

Change-Id: I9e8d33111fe7bf4eba7e2b5f7b59475b48aea715
2017-03-18 19:26:29 +01:00
Emmanuel Briot
74b23fc109 Make the growth strategy configurable
Add documentation (based on blog post)

Q216-036

Change-Id: I5a8c3005b263ecf0f0a16c71743e7e355bb1ddc1
2017-03-18 19:25:50 +01:00
Emmanuel Briot
b78628bb8b Performance improvements for GNATCOLL.Traces
A significant set of improvements were done to improve the performance,
namely:

When a trace is inactive, we no longer increase the counters, which are
 atomic. This provides a minor speed up in multi-threaded applications.

Minor optimization to check whether the module has been finalized.
 A single test is needed instead of two.

Change locking policy:
 Instead of using GNAT.Task_Lock, we now use atomic counters and an
 active loop to do the locking. This provides significant speed up in
 multi threaded applications, and no slow down in mono-threaded.
 Locks are now per-stream, instead of only using one global lock, which
 will result in less contention when outputing to multiple streams.

Use C FILE* for the default file stream.
 Bypasses Ada.Text_IO to use a lower-level directly.
 This provides a slightly faster output, though the changes are not very
 large.

Disable flushing after each message by default:
 This commit also adds support for disabling the automatic flushing
 after each message is printed, which also results in significant
 speed up. A file stream can now be configured to force autoflush or not,
 in the config file:
     FOO >file.txt:buffer_size=0
 File streams now have a setting (can be set in .gnatdebug) to specify
 the size of the internal buffer at the system level.
 This setting can only be set when the stream is declared in the config
 file. This removes the need for dynamically checking the flag in Put,
 and removes the need for fflush(), since we directly setup the
 appropriate buffering in the FILE* handle.

Change design of decorators:
 Decorators should now add to the buffered string, rather than output
 directly on the stream. This is more efficient (a single operation to
 the stream, and the critical section is much smaller, allowing better
 parallelism).
 These smaller critical sections allow better scaling on the
 number of threads.
 The use of a buffer also will make it possible to have asynchronous
 streams (where the I/O is done in a separate thread to increase
 throughput).
 The buffer is implemented via GNATCOLL.Strings, since unbounded strings
 systematically require a malloc and thus were slower. Typical slow
 messages will require no malloc, although larger message will simply
 allocate memory as needed.
 This XString is also passed directly to the stream's put, so that it
 can chose to store it in a buffer to implement async streams, without
 a need for further memory allocation.

Make some parameters "not null" in gnatcoll-traces to match what
 the code expects and avoid some checks from the compiler.

Make Trace_Handle_Record and Trace_Stream_Record limited types. These
 can now be used to store limited types, like a File_Type or a protected
 type.

Add Logger as an alias for Trace_Handle.
 This is a more usual term in logging frameworks.

Store all active decorators in a separate array:
 This makes traversing the list faster in Trace, which is the hotspot
 in this package.

("DEBUG.MEMORY"): new decorator for gnatcoll.traces
 Imported from GPS, since of general use

Fix memory barrier issue with the atomic operations.

Q212-003
P623-028

Comparing performance with master, when showing 200_000 messages
via 1, 2 or 100 threads. Main benefit is from not flushing
systematically, but the new implementation also scales better
with the number of threads. On OSX.

=======Old  1 threads ==========
Total time (auto flush)        0.315237000  100%    634443 ops/s
Total time (when inactive)     0.008458000    3%  23646252 ops/s
Total time (check active)      0.000443000    0% 451467264 ops/s
=======Old  2 threads ==========
Total time (auto flush)        1.066011000  338%    187615 ops/s
Total time (when inactive)     0.010407000    3%  19217834 ops/s
Total time (check active)      0.000297000    0% 673400704 ops/s
=======Old  100 threads ==========
Total time (auto flush)        1.192194000  378%    167758 ops/s
Total time (when inactive)     0.007754000    2%  25793140 ops/s
Total time (check active)      0.003973000    1%  50339792 ops/s

=======New  1 threads ==========
Total time                     0.031278000   10%   6394271 ops/s
Total time (auto flush)        0.263455000   84%    759143 ops/s
Total time (when inactive)     0.004223000    1%  47359700 ops/s
Total time (check active)      0.000459000    0% 435729856 ops/s
=======New  2 threads ==========
Total time                     0.050222000   16%   3982319 ops/s
Total time (auto flush)        0.398661000  126%    501679 ops/s
Total time (when inactive)     0.002369000    1%  84423800 ops/s
Total time (check active)      0.000330000    0% 606060608 ops/s
=======New  100 threads ==========
Total time                     0.069576000   22%   2874554 ops/s
Total time (auto flush)        3.738483000 1186%     53498 ops/s
Total time (when inactive)     0.004329000    1%  46200044 ops/s
Total time (check active)      0.002613000    1%  76540368 ops/s

(cherry picked from commit 80b7a39ca5f7c35b394e8883e55103e54d8d0a94)

Change-Id: Id336f2420e2b3fc71de4c9c508a311dc8849576a
2017-03-06 10:24:36 +01:00
Olivier Ramonat
8ff0c55d4f Revert “Performance improvements for GNATCOLL.Traces"
The incompatible API in Increase/Decrease_Indent is 
breaking asistools, which breaks the GNAT package. 

https://delphi.eu.adacore.com/#/e/19332542

(Also it looks like the GNATbench build failed)

This reverts commit 80b7a39ca5f7c35b394e8883e55103e54d8d0a94.

Change-Id: I2cc241487cbbddf4591ab6db57acbb0b9c039936
2017-03-03 23:04:56 +01:00
Emmanuel Briot
d83ce1f12f Performance improvements for GNATCOLL.Traces
A significant set of improvements were done to improve the performance,
namely:

When a trace is inactive, we no longer increase the counters, which are
 atomic. This provides a minor speed up in multi-threaded applications.

Minor optimization to check whether the module has been finalized.
 A single test is needed instead of two.

Change locking policy:
 Instead of using GNAT.Task_Lock, we now use atomic counters and an
 active loop to do the locking. This provides significant speed up in
 multi threaded applications, and no slow down in mono-threaded.
 Locks are now per-stream, instead of only using one global lock, which
 will result in less contention when outputing to multiple streams.

Use C FILE* for the default file stream.
 Bypasses Ada.Text_IO to use a lower-level directly.
 This provides a slightly faster output, though the changes are not very
 large.

Disable flushing after each message by default:
 This commit also adds support for disabling the automatic flushing
 after each message is printed, which also results in significant
 speed up. A file stream can now be configured to force autoflush or not,
 in the config file:
     FOO >file.txt:buffer_size=0
 File streams now have a setting (can be set in .gnatdebug) to specify
 the size of the internal buffer at the system level.
 This setting can only be set when the stream is declared in the config
 file. This removes the need for dynamically checking the flag in Put,
 and removes the need for fflush(), since we directly setup the
 appropriate buffering in the FILE* handle.

Change design of decorators:
 Decorators should now add to the buffered string, rather than output
 directly on the stream. This is more efficient (a single operation to
 the stream, and the critical section is much smaller, allowing better
 parallelism).
 These smaller critical sections allow better scaling on the
 number of threads.
 The use of a buffer also will make it possible to have asynchronous
 streams (where the I/O is done in a separate thread to increase
 throughput).
 The buffer is implemented via GNATCOLL.Strings, since unbounded strings
 systematically require a malloc and thus were slower. Typical slow
 messages will require no malloc, although larger message will simply
 allocate memory as needed.
 This XString is also passed directly to the stream's put, so that it
 can chose to store it in a buffer to implement async streams, without
 a need for further memory allocation.

Make some parameters "not null" in gnatcoll-traces to match what
 the code expects and avoid some checks from the compiler.

Make Trace_Handle_Record and Trace_Stream_Record limited types. These
 can now be used to store limited types, like a File_Type or a protected
 type.

Add Logger as an alias for Trace_Handle.
 This is a more usual term in logging frameworks.

Store all active decorators in a separate array:
 This makes traversing the list faster in Trace, which is the hotspot
 in this package.

("DEBUG.MEMORY"): new decorator for gnatcoll.traces
 Imported from GPS, since of general use

Fix memory barrier issue with the atomic operations.

Q212-003
P623-028

Comparing performance with master, when showing 200_000 messages
via 1, 2 or 100 threads. Main benefit is from not flushing
systematically, but the new implementation also scales better
with the number of threads. On OSX.

=======Old  1 threads ==========
Total time (auto flush)        0.315237000  100%    634443 ops/s
Total time (when inactive)     0.008458000    3%  23646252 ops/s
Total time (check active)      0.000443000    0% 451467264 ops/s
=======Old  2 threads ==========
Total time (auto flush)        1.066011000  338%    187615 ops/s
Total time (when inactive)     0.010407000    3%  19217834 ops/s
Total time (check active)      0.000297000    0% 673400704 ops/s
=======Old  100 threads ==========
Total time (auto flush)        1.192194000  378%    167758 ops/s
Total time (when inactive)     0.007754000    2%  25793140 ops/s
Total time (check active)      0.003973000    1%  50339792 ops/s

=======New  1 threads ==========
Total time                     0.031278000   10%   6394271 ops/s
Total time (auto flush)        0.263455000   84%    759143 ops/s
Total time (when inactive)     0.004223000    1%  47359700 ops/s
Total time (check active)      0.000459000    0% 435729856 ops/s
=======New  2 threads ==========
Total time                     0.050222000   16%   3982319 ops/s
Total time (auto flush)        0.398661000  126%    501679 ops/s
Total time (when inactive)     0.002369000    1%  84423800 ops/s
Total time (check active)      0.000330000    0% 606060608 ops/s
=======New  100 threads ==========
Total time                     0.069576000   22%   2874554 ops/s
Total time (auto flush)        3.738483000 1186%     53498 ops/s
Total time (when inactive)     0.004329000    1%  46200044 ops/s
Total time (check active)      0.002613000    1%  76540368 ops/s

Change-Id: If13722e1e1da29340f9a2a42d0b4e1eabdce9f98
2017-03-02 14:02:52 +01:00
comar
8b116cf35b fix typos
Change-Id: I54636f2e52923bca030015b1fd8c064e335d7fbc
2017-01-25 12:36:56 +01:00
Emmanuel Briot
5e4678ffa9 Minor grammar fixes
Change-Id: Id266d738bcbbf655eed05653c1e068ee534fe918
2016-12-21 10:36:09 +01:00
Emmanuel Briot
a19dd59e47 Minor doc update
(Parse_All_LI_Files): remove Tree parameter, since this is already
 known to the database.

Change-Id: I3d34cd2874c0f3f2778c285ff4a5eb1298a7e0ef
2016-12-02 21:48:27 +01:00
Emmanuel Briot
dde8725983 Make it easier to add new field types to GNATCOLL.SQL
We no longer use enumerated types to support the field types, which
makes it possible to add new types in third-party packages.

PB17-036
PB02-013

Change-Id: I520234e4e38401534a91632b781ef225aaee48d2
2016-11-23 16:02:51 +01:00