Skip to content

Commit

Permalink
Merge FlatMap into JSONObject (#1376)
Browse files Browse the repository at this point in the history
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
  • Loading branch information
jviotti authored Dec 11, 2024
1 parent c2b24e6 commit 40a4cee
Show file tree
Hide file tree
Showing 8 changed files with 266 additions and 625 deletions.
2 changes: 1 addition & 1 deletion src/json/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
noa_library(NAMESPACE sourcemeta PROJECT jsontoolkit NAME json
FOLDER "JSON Toolkit/JSON"
PRIVATE_HEADERS array.h error.h object.h value.h hash.h flat_map.h
PRIVATE_HEADERS array.h error.h object.h value.h hash.h
SOURCES grammar.h parser.h stringify.h json.cc json_value.cc)

if(JSONTOOLKIT_INSTALL)
Expand Down
243 changes: 0 additions & 243 deletions src/json/include/sourcemeta/jsontoolkit/json_flat_map.h

This file was deleted.

Loading

4 comments on commit 40a4cee

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark (macos/llvm)

Benchmark suite Current: 40a4cee Previous: c2b24e6 Ratio
JSON_Array_Of_Objects_Unique 331.3089995000029 ns/iter 310.41754957530816 ns/iter 1.07
JSON_Parse_1 21140.261830511216 ns/iter 19551.072355541117 ns/iter 1.08
JSON_Fast_Hash_Helm_Chart_Lock 49.131532653136865 ns/iter 45.75934766089476 ns/iter 1.07
JSON_Equality_Helm_Chart_Lock 126.62143852437482 ns/iter 115.54498169325042 ns/iter 1.10
Regex_Lower_S_Or_Upper_S_Asterisk 1.8827946895043388 ns/iter 1.574672339407669 ns/iter 1.20
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 1.6839565532570293 ns/iter 1.5754734615366024 ns/iter 1.07
Regex_Period_Asterisk 1.6857078478905352 ns/iter 1.5668833602865948 ns/iter 1.08
Regex_Group_Period_Asterisk_Group 1.715885886917118 ns/iter 1.5708963021230977 ns/iter 1.09
Regex_Period_Plus 2.0322222981267006 ns/iter 1.9833231473918436 ns/iter 1.02
Regex_Period 2.118147278528748 ns/iter 2.068980418842139 ns/iter 1.02
Regex_Caret_Period_Plus_Dollar 2.054848907332626 ns/iter 1.9328060527323947 ns/iter 1.06
Regex_Caret_Group_Period_Plus_Group_Dollar 2.0205236932666972 ns/iter 1.8948244155717726 ns/iter 1.07
Regex_Caret_Period_Asterisk_Dollar 1.904352300808077 ns/iter 1.57598225404152 ns/iter 1.21
Regex_Caret_Group_Period_Asterisk_Group_Dollar 1.9588609202391765 ns/iter 1.5878473514336526 ns/iter 1.23
Regex_Caret_X_Hyphen 6.828284849623025 ns/iter 6.261313988910937 ns/iter 1.09
Regex_Period_Md_Dollar 83.60421516682266 ns/iter 67.18676397519357 ns/iter 1.24
Regex_Caret_Slash_Period_Asterisk 6.667393945138402 ns/iter 5.9907318287829705 ns/iter 1.11
Regex_Caret_Period_Range_Dollar 2.187137859636082 ns/iter 2.0571343559640916 ns/iter 1.06
Regex_Nested_Backtrack 748.5883268655905 ns/iter 695.8998797518207 ns/iter 1.08
Pointer_Object_Traverse 22.85927769295466 ns/iter 20.804378274658934 ns/iter 1.10
Pointer_Object_Try_Traverse 38.533080985304416 ns/iter 35.98373252758524 ns/iter 1.07

This comment was automatically generated by workflow using github-action-benchmark.

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark (linux/llvm)

Benchmark suite Current: 40a4cee Previous: c2b24e6 Ratio
JSON_Array_Of_Objects_Unique 469.7886719050791 ns/iter 375.8802210716672 ns/iter 1.25
JSON_Parse_1 29719.623367290733 ns/iter 29722.50528505451 ns/iter 1.00
JSON_Fast_Hash_Helm_Chart_Lock 57.22591862111073 ns/iter 54.161140824593055 ns/iter 1.06
JSON_Equality_Helm_Chart_Lock 152.29315673317484 ns/iter 161.74500624834968 ns/iter 0.94
Regex_Lower_S_Or_Upper_S_Asterisk 2.474136181191829 ns/iter 2.793230665214345 ns/iter 0.89
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 2.167757762559703 ns/iter 2.78590131024325 ns/iter 0.78
Regex_Period_Asterisk 2.474803040293683 ns/iter 2.7848851609774323 ns/iter 0.89
Regex_Group_Period_Asterisk_Group 2.1716805129051924 ns/iter 2.783935279056127 ns/iter 0.78
Regex_Period_Plus 2.7829231660619613 ns/iter 2.4863700940632225 ns/iter 1.12
Regex_Period 2.782305554304927 ns/iter 2.477653325885232 ns/iter 1.12
Regex_Caret_Period_Plus_Dollar 2.7828069093240595 ns/iter 2.4905292051983268 ns/iter 1.12
Regex_Caret_Group_Period_Plus_Group_Dollar 2.8040066214345516 ns/iter 2.4760799371150695 ns/iter 1.13
Regex_Caret_Period_Asterisk_Dollar 3.4030357916796175 ns/iter 3.095339490692347 ns/iter 1.10
Regex_Caret_Group_Period_Asterisk_Group_Dollar 3.4024944281616265 ns/iter 3.093354627857406 ns/iter 1.10
Regex_Caret_X_Hyphen 10.206184680040144 ns/iter 13.09290872180091 ns/iter 0.78
Regex_Period_Md_Dollar 101.7592103248589 ns/iter 104.96125445937757 ns/iter 0.97
Regex_Caret_Slash_Period_Asterisk 7.119067335722741 ns/iter 7.437288641113379 ns/iter 0.96
Regex_Caret_Period_Range_Dollar 3.7105182279790054 ns/iter 4.019657549513122 ns/iter 0.92
Regex_Nested_Backtrack 806.7911759706316 ns/iter 810.3878255224612 ns/iter 1.00
Pointer_Object_Traverse 40.72438572846745 ns/iter 39.011964753122804 ns/iter 1.04
Pointer_Object_Try_Traverse 52.97912123726645 ns/iter 55.08202849517108 ns/iter 0.96

This comment was automatically generated by workflow using github-action-benchmark.

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark (linux/gcc)

Benchmark suite Current: 40a4cee Previous: c2b24e6 Ratio
Pointer_Object_Traverse 53.29129206856252 ns/iter 53.45003866621139 ns/iter 1.00
Pointer_Object_Try_Traverse 22.268350245988678 ns/iter 26.29462707865475 ns/iter 0.85
Regex_Lower_S_Or_Upper_S_Asterisk 3.1639566038655538 ns/iter 1.2376808668734036 ns/iter 2.56
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 3.1304181208114117 ns/iter 1.238067650148556 ns/iter 2.53
Regex_Period_Asterisk 3.1443331747019454 ns/iter 1.2377209206467557 ns/iter 2.54
Regex_Group_Period_Asterisk_Group 3.164633286015718 ns/iter 1.2380585467360723 ns/iter 2.56
Regex_Period_Plus 3.111470443560097 ns/iter 1.2385320406534825 ns/iter 2.51
Regex_Period 3.134228186161173 ns/iter 1.2394960782104327 ns/iter 2.53
Regex_Caret_Period_Plus_Dollar 3.1321241596701626 ns/iter 1.2385697446928818 ns/iter 2.53
Regex_Caret_Group_Period_Plus_Group_Dollar 3.148408587396941 ns/iter 1.2385252321209417 ns/iter 2.54
Regex_Caret_Period_Asterisk_Dollar 3.163578118860551 ns/iter 1.2389884689283899 ns/iter 2.55
Regex_Caret_Group_Period_Asterisk_Group_Dollar 3.1534300202631846 ns/iter 1.2376163390470905 ns/iter 2.55
Regex_Caret_X_Hyphen 12.059719330753651 ns/iter 12.057383747999182 ns/iter 1.00
Regex_Period_Md_Dollar 93.7331059013255 ns/iter 92.20891500059194 ns/iter 1.02
Regex_Caret_Slash_Period_Asterisk 4.331351627393306 ns/iter 4.3308522147526585 ns/iter 1.00
Regex_Caret_Period_Range_Dollar 3.1268830529016354 ns/iter 1.5495648756263716 ns/iter 2.02
Regex_Nested_Backtrack 853.7343931419823 ns/iter 873.6043630260184 ns/iter 0.98
JSON_Array_Of_Objects_Unique 375.9582956265891 ns/iter 394.05524785771706 ns/iter 0.95
JSON_Parse_1 33285.1248900196 ns/iter 31894.50418041108 ns/iter 1.04
JSON_Fast_Hash_Helm_Chart_Lock 54.42645821129184 ns/iter 67.76183964243309 ns/iter 0.80
JSON_Equality_Helm_Chart_Lock 183.78112188841072 ns/iter 180.43061492897786 ns/iter 1.02

This comment was automatically generated by workflow using github-action-benchmark.

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark (windows/msvc)

Benchmark suite Current: 40a4cee Previous: c2b24e6 Ratio
JSON_Array_Of_Objects_Unique 519.6229000000585 ns/iter 489.2254219425468 ns/iter 1.06
JSON_Parse_1 75892.54464285489 ns/iter 74341.11607143024 ns/iter 1.02
JSON_Fast_Hash_Helm_Chart_Lock 68.85516964285695 ns/iter 64.46756249999908 ns/iter 1.07
JSON_Equality_Helm_Chart_Lock 285.7400730241481 ns/iter 284.9394247795207 ns/iter 1.00
Regex_Lower_S_Or_Upper_S_Asterisk 6.205311383928246 ns/iter 5.9823660714286575 ns/iter 1.04
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 5.35773899999981 ns/iter 5.7628866071419385 ns/iter 0.93
Regex_Period_Asterisk 5.389069642856522 ns/iter 5.345411607142937 ns/iter 1.01
Regex_Group_Period_Asterisk_Group 5.3290348214279755 ns/iter 5.40469499999972 ns/iter 0.99
Regex_Period_Plus 5.741072321428525 ns/iter 5.764727678571851 ns/iter 1.00
Regex_Period 5.599103571428137 ns/iter 5.708447544643391 ns/iter 0.98
Regex_Caret_Period_Plus_Dollar 5.590559821429102 ns/iter 5.996552678571528 ns/iter 0.93
Regex_Caret_Group_Period_Plus_Group_Dollar 5.673798214286105 ns/iter 5.596948214284834 ns/iter 1.01
Regex_Caret_Period_Asterisk_Dollar 5.369097000000238 ns/iter 5.614729999999782 ns/iter 0.96
Regex_Caret_Group_Period_Asterisk_Group_Dollar 5.531498214285843 ns/iter 5.502514285715116 ns/iter 1.01
Regex_Caret_X_Hyphen 14.428015625000006 ns/iter 13.020092857142831 ns/iter 1.11
Regex_Period_Md_Dollar 142.34813203802327 ns/iter 134.59344642857982 ns/iter 1.06
Regex_Caret_Slash_Period_Asterisk 9.704058438820644 ns/iter 9.159717816250621 ns/iter 1.06
Regex_Caret_Period_Range_Dollar 5.9932339285708744 ns/iter 6.186895089285319 ns/iter 0.97
Regex_Nested_Backtrack 563.4464285714712 ns/iter 556.1001999999462 ns/iter 1.01
Pointer_Object_Traverse 35.8626327832604 ns/iter 41.26208604043576 ns/iter 0.87
Pointer_Object_Try_Traverse 47.38414391482425 ns/iter 47.392159540005004 ns/iter 1.00

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.