Commit Graph

9328 Commits

Author SHA1 Message Date
Dennis Heimbigner
fb40a72b45 Improve performance of the nc_reclaim_data and nc_copy_data functions.
re: Issue https://github.com/Unidata/netcdf-c/issues/2685
re: PR https://github.com/Unidata/netcdf-c/pull/2179

As noted in PR https://github.com/Unidata/netcdf-c/pull/2179,
the old code did not allow for reclaiming instances of types,
nor for properly copying them. That PR provided new functions
capable of reclaiming/copying instances of arbitrary types.

However, as noted by Issue https://github.com/Unidata/netcdf-c/issues/2685, using these
most general functions resulted in a significant performance
degradation, even for common cases.

This PR attempts to mitigate the cost of using the general
reclaim/copy functions in two ways.

First, the previous functions operating at the top level by
using ncid and typeid arguments. These functions were augmented
with equivalent versions that used the netcdf-c library internal
data structures to allow direct access to needed information.
These new functions are used internally to the library.

The second mitigation involves optimizing the internal functions
by providing early tests for common cases. This avoids
unnecessary recursive function calls.

The overall result is a significant improvement in speed by a
factor of roughly twenty -- your mileage may vary. These
optimized functions are still not as fast as the original (more
limited) functions, but they are getting close. Additional optimizations are
possible. But the cost is a significant "uglification" of the
code that I deemed a step too far, at least for now.

## Misc. Changes
1. Added a test case to check the proper reclamation/copy of complex types.
2. Found and fixed some places where nc_reclaim/copy should have been used.
3. Replaced, in the netcdf-c library, (almost all) occurrences of nc_reclaim_copy with calls to NC_reclaim/copy. This plus the optimizations is the primary speed-up mechanism.
4. In DAP4, the metadata is held in a substrate in-memory file; this required some changes so that the reclaim/copy code accessed that substrate dispatcher rather than the DAP4 dispatcher.
5. Re-factored and isolated the code that computes if a type is (transitively) variable-sized or not.
6. Clean up the reclamation code in ncgen; adding the use of nc_reclaim exposed some memory problems.
2023-05-20 17:11:25 -06:00
Ward Fisher
bfb8a31aed
Merge pull request #2644 from ZhipengXue97/main
Fix potential dead store
2023-05-15 10:38:59 -06:00
Ward Fisher
4b2851d79e
Merge pull request #2686 from DennisHeimbigner/s3update.dmh
Improve S3 documentation, testing and support
2023-05-11 15:31:43 -06:00
Dennis Heimbigner
6c7e668a04 Remove debugging 2023-05-09 21:18:51 -06:00
Dennis Heimbigner
98477b9f25 ## Addendum [5/9/23]
It turns out that attempting to test S3 using a github action secret is a very complex process. So, this was disabled for github actions. However, a new *run_tests_s3.yml* action file was added that will eventually encapsulate S3 testing.
2023-05-09 21:13:49 -06:00
Dennis Heimbigner
d79f08176a Merge branch 'master' into s3update.dmh 2023-05-09 19:31:18 -06:00
Dennis Heimbigner
5e9a3f66d3 Merge remote-tracking branch 'Unidata/main' 2023-05-09 19:30:47 -06:00
Ward Fisher
c82f0236a9
Merge pull request #2695 from mathstuf/hdf5-api-checks
hdf5open: check for the H5L info structure version directly
2023-05-08 14:47:43 -06:00
Ben Boeckel
51cfad2dbf hdf5open: check for the H5L info structure version directly 2023-05-05 12:25:40 -04:00
Dennis Heimbigner
f928428680 remove push trigger 2023-05-03 16:31:39 -06:00
Dennis Heimbigner
912e76e552 Suppress S3 testing in github actions 2023-05-03 16:27:14 -06:00
Dennis Heimbigner
3ac9958ffc creds1 2023-05-02 19:38:30 -06:00
Dennis Heimbigner
c315873af6 Disable s3 tests 2023-05-02 14:51:34 -06:00
Ward Fisher
863fb64d52
Merge pull request #2693 from WardF/fix_cmake_shelltests.wif
Fix a syntax issue in CMakeLists.txt
2023-05-02 14:23:15 -06:00
Dennis Heimbigner
ef55c327b6 secret1 2023-05-02 14:10:02 -06:00
Dennis Heimbigner
eb6c9fa40f chmod 2023-05-02 13:35:22 -06:00
Dennis Heimbigner
b5ea9616e9 profile1 2023-05-02 13:20:09 -06:00
Dennis Heimbigner
38615da3e7 enable s3 testing 2023-05-02 12:55:25 -06:00
Ward Fisher
7f325464df Fix a syntax issue that may have been fouling other things, in cmake shell-script macro. 2023-05-02 09:10:14 -06:00
Dennis Heimbigner
b1b1a3e9c0 Added comment about curl code 2023-05-01 16:34:57 -06:00
Dennis Heimbigner
681abc3fb1 s3-off 2023-04-30 18:41:31 -06:00
Dennis Heimbigner
77ac0e052b debug 2023-04-29 21:33:45 -06:00
Dennis Heimbigner
dcc99e8d8b debug 2023-04-29 21:23:07 -06:00
Dennis Heimbigner
2e7befd209 debug15 2023-04-29 21:22:18 -06:00
Dennis Heimbigner
e8eeaf5f19 debug14 2023-04-29 21:14:57 -06:00
Dennis Heimbigner
908aa20859 debug12 2023-04-29 21:12:16 -06:00
Dennis Heimbigner
6eac55dc44 debug11 2023-04-29 21:01:05 -06:00
Dennis Heimbigner
a97cabfb12 debug10 2023-04-29 20:51:46 -06:00
Dennis Heimbigner
ff6b6a72d1 debug7 2023-04-29 20:40:21 -06:00
Dennis Heimbigner
5be7088c9e debug6 2023-04-29 20:36:18 -06:00
Dennis Heimbigner
75e3012ff3 debug5 2023-04-29 19:45:51 -06:00
Dennis Heimbigner
cccbc2ebea gdb3 2023-04-29 18:32:46 -06:00
Dennis Heimbigner
a443ba8215 gdb2 2023-04-29 18:07:32 -06:00
Dennis Heimbigner
d89a63a1d3 gdb1 2023-04-29 18:00:42 -06:00
Dennis Heimbigner
2945079f9a test1 2023-04-29 17:38:19 -06:00
Dennis Heimbigner
88bf095f26 intern2 2023-04-28 15:28:32 -06:00
Dennis Heimbigner
2eb131f516 intern1 2023-04-28 15:26:21 -06:00
Dennis Heimbigner
c2f3b6ee84 debug20 2023-04-28 15:11:42 -06:00
Dennis Heimbigner
2f693cf960 debug10 2023-04-28 14:52:20 -06:00
Dennis Heimbigner
613fd120d7 debug2 2023-04-28 14:40:46 -06:00
Dennis Heimbigner
20065682bb debug1 2023-04-28 14:30:48 -06:00
Dennis Heimbigner
aa82e1b4cb Merge branch 's3update.dmh' of https://github.com/DennisHeimbigner/netcdf-c into s3update.dmh 2023-04-28 14:05:14 -06:00
Dennis Heimbigner
62f8d31415 profile1 2023-04-28 14:05:06 -06:00
Dennis Heimbigner
7e5c4ebe66 debug1 2023-04-27 20:01:39 -06:00
Dennis Heimbigner
7939ec559f forward1 2023-04-27 19:52:03 -06:00
Dennis Heimbigner
44441af5bb clean1 2023-04-27 19:46:34 -06:00
Dennis Heimbigner
7121588ac0 try10 2023-04-27 19:25:36 -06:00
Dennis Heimbigner
d0ef22360d try5 2023-04-27 19:15:07 -06:00
Dennis Heimbigner
b3fc253b58 try2 2023-04-27 19:04:06 -06:00
Dennis Heimbigner
3aaf5df99f try1 2023-04-27 18:58:35 -06:00