Skip to content

Commit

Permalink
Reduce the size of the string set
Browse files Browse the repository at this point in the history
  • Loading branch information
linas committed Apr 16, 2024
1 parent e65b94d commit 397a3d4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions link-grammar/string-id.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ struct String_id_s
};

/* If the table gets too big, we grow it. Too big is defined as being
* more than 3/8 full. There's a huge boost from keeping this sparse. */
#define MAX_STRING_SET_TABLE_SIZE(s) ((s) * 3 / 8)
* more than 3/4 full. There's a huge boost from keeping this sparse. */
#define MAX_STRING_SET_TABLE_SIZE(s) ((s) * 3 / 4)

String_id *string_id_create(void);
unsigned int string_id_add(const char *source_string, String_id *ss);
Expand Down
4 changes: 2 additions & 2 deletions link-grammar/string-set.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ struct String_set_s
};

/* If the table gets too big, we grow it. Too big is defined as being
* more than 3/8 full. There's a huge boost from keeping this sparse. */
#define MAX_STRING_SET_TABLE_SIZE(s) ((s) * 3 / 8)
* more than 3/4 full. There's a huge boost from keeping this sparse. */
#define MAX_STRING_SET_TABLE_SIZE(s) ((s) * 3 / 4)

String_set * string_set_create(void);
const char * string_set_add(const char * source_string, String_set * ss);
Expand Down

0 comments on commit 397a3d4

Please sign in to comment.