Hash table for faster key/value lookups - #632
Open
jacobwilliams wants to merge 19 commits into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces an experimental hash-table implementation to speed up key/value lookups for JSON objects (Fixes #631), integrates it into the main json_module, and adds a new unit test to exercise basic functionality and compare timing against existing linked-list lookup.
Changes:
- Add
json_hash_modulewith ajson_hash_tabletype supporting create/get/destroy for object-member lookup acceleration. - Expose JSON name-comparison settings via
json_core%get_name_settingsso the hash table can match JSON key-comparison behavior. - Add and wire up
jf_test_54(including Visual Studio project/test runner integration) and include the new module in CMake builds.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
src/json_hash_module.f90 |
New hash table implementation for faster object-member lookup. |
src/json_value_module.F90 |
Adds json_core%get_name_settings used by the hash table for consistent key handling. |
src/json_module.F90 |
Imports json_hash_module so consumers can access json_hash_table via use json_module. |
test/jf_test_54.F90 |
New unit test for hash table creation/lookup and a basic performance comparison. |
CMakeLists.txt |
Adds the new hash module source file to the library build. |
visual_studio/jsonfortrantest/jsonfortrantest.f90 |
Adds test 54 to the Visual Studio test runner program. |
visual_studio/jsonfortrantest/jsonfortrantest.vfproj |
Adds test 54 source file to the Visual Studio project. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Open
formatting minor update for error check
can now optionally enable to speed up lookups of top-level keys in a json_file, after it has been read. required some refactoring. added new unit test.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #631