Commit Graph

185 Commits

Author SHA1 Message Date
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
Thomas Quinot
f56b8a039e Support for generating image functions for db enums
P201-084

Change-Id: Idc7cf3c38f7ad401fce77da07ba41cae775dd5a8
2016-02-02 10:46:53 +01:00
Emmanuel Briot
9bd0cf0df0 Force static libiconv when using --disable-shared and --with-iconv=path
When both switches are specified, the tools like gnatinspect will be
built with gnatcoll static libraries. They should also using a static
libiconv, to avoid conflicts when running on other systems.

This patch has no impact when using --with-iconv=path and not
--disable-shared, since in this case we want the tools to be linked
against shared libraries, including for iconv.

This patch also has no effect when using --disable-shared and --with-iconv
(i.e. using auto-search), to keep it simpler and avoid breaking existing
setups. The recommended solution, in any case, is to use --with-iconv=path
as has now been made clear in the doc.

This patch supercedes using --with-iconv=static, which did not provide
a way to specify an explicit directory and only supported auto-search.

O923-012

Change-Id: I9b8398cd4e7958fbd796a0ee17e54f10809a64b0
2015-11-06 12:21:17 +01:00
Vadim Godunko
47fd452135 OA28-024 Correctly escape inline markup to display stars.
Change-Id: I9a329acd7ab1719050e9c2e1e8cdcf5a38c1ec5b
2015-10-30 14:40:18 +03:00
Emmanuel Briot
8a33b8b32f Update version number to 17.0w
OA27-049

Change-Id: I3c535e02bb1ad060a8fddcefe756ca28ae7da11b
2015-10-28 10:34:28 +01:00
Emmanuel Briot
cb961661fd Add reference to Cygwin
Update outdated reference to libgnat_utils, and replace with libgpr

OA27-070

Change-Id: I5296cc5c7ace6239601a8f17752598b05d1900dc
2015-10-28 09:58:14 +01:00
Dmitriy Anisimkov
1758b79bf0 Indexed direct cursors access.
J422-005

Task_Safe_Instance call moved from GNATCOLL.SQL.SQLite.Builder.Execute
routine to GNATCOLL.SQL.Exec.Execute_And_Log routine because we need
to put parameter Index_By there and it available only on
Execute_And_Log level. By the way we would not need to convert forward
cursors to direct cursors in DBMS drivers where direct cursors is not
supported.

* src/gnatcoll-sql-exec.ads:
(No_Field_Index): New constant.
(Find): New routines to find Integer and String field value.
(Prepare): Add Index_By parameter.

* src/gnatcoll-sql-exec.adb:
(Fetch_Internal): Direct flag calculation fixed. Types inherited from
 Direct_Cursor Direct too.
 

Change-Id: Ie853aa5cf45bca6ad9fd4ffa0de426b1f66857db
2015-09-22 09:28:17 +02:00
Emmanuel Briot
92e067261a (gnatinspect): support for --lang
This commit adds support for a new command line switch (--lang) that
can be used to specify custom naming schemes for languages. In particular,
users can now define, in GPS, new languages based on Ada (that also
generate a .ali file or similar) and have cross-reference information
for them. The preferred approach, though, is to use a configuration
project file.

M304-034 (3/3)

Change-Id: I9d8d312e51756d154dce88980ff031f2d31b7412
2015-08-17 14:34:19 +02:00