1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-10 03:33:12 +02:00

core: use size of 32 for hashtables (instead of 4, 8 or 16)

A size of 32 will use a little more memory but will reduce collisions in key
hashs, and then length of linked lists inside hash structure (faster search in
hashtable).
This commit is contained in:
Sebastien Helleu
2013-01-26 19:26:43 +01:00
parent f4dce04723
commit 25eaec3864
16 changed files with 40 additions and 40 deletions
+6 -6
View File
@@ -428,7 +428,7 @@ irc_config_change_look_nick_color_force (void *data,
if (!irc_config_hashtable_nick_color_force)
{
irc_config_hashtable_nick_color_force = weechat_hashtable_new (8,
irc_config_hashtable_nick_color_force = weechat_hashtable_new (32,
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_STRING,
NULL,
@@ -581,7 +581,7 @@ irc_config_change_color_mirc_remap (void *data, struct t_config_option *option)
if (!irc_config_hashtable_color_mirc_remap)
{
irc_config_hashtable_color_mirc_remap = weechat_hashtable_new (8,
irc_config_hashtable_color_mirc_remap = weechat_hashtable_new (32,
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_STRING,
NULL,
@@ -626,7 +626,7 @@ irc_config_change_color_nick_prefixes (void *data,
if (!irc_config_hashtable_nick_prefixes)
{
irc_config_hashtable_nick_prefixes = weechat_hashtable_new (8,
irc_config_hashtable_nick_prefixes = weechat_hashtable_new (32,
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_STRING,
NULL,
@@ -1954,17 +1954,17 @@ irc_config_init ()
{
struct t_config_section *ptr_section;
irc_config_hashtable_color_mirc_remap = weechat_hashtable_new (8,
irc_config_hashtable_color_mirc_remap = weechat_hashtable_new (32,
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_STRING,
NULL,
NULL);
irc_config_hashtable_nick_color_force = weechat_hashtable_new (8,
irc_config_hashtable_nick_color_force = weechat_hashtable_new (32,
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_STRING,
NULL,
NULL);
irc_config_hashtable_nick_prefixes = weechat_hashtable_new (8,
irc_config_hashtable_nick_prefixes = weechat_hashtable_new (32,
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_STRING,
NULL,
+2 -2
View File
@@ -224,7 +224,7 @@ irc_message_parse_to_hashtable (struct t_irc_server *server,
irc_message_parse (server, message, &tags, &message_without_tags, &nick,
&host, &command, &channel, &arguments);
hashtable = weechat_hashtable_new (8,
hashtable = weechat_hashtable_new (32,
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_STRING,
NULL,
@@ -814,7 +814,7 @@ irc_message_split (struct t_irc_server *server, const char *message)
if (weechat_irc_plugin->debug >= 2)
weechat_printf (NULL, "irc_message_split: message='%s'", message);
hashtable = weechat_hashtable_new (8,
hashtable = weechat_hashtable_new (32,
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_STRING,
NULL,
+1 -1
View File
@@ -4561,7 +4561,7 @@ irc_protocol_get_message_tags (const char *tags)
if (!tags || !tags[0])
return NULL;
hashtable = weechat_hashtable_new (8,
hashtable = weechat_hashtable_new (32,
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_STRING,
NULL,
+2 -2
View File
@@ -422,7 +422,7 @@ irc_redirect_new_with_commands (struct t_irc_server *server,
{
if (items[i])
{
hash_cmd[i] = weechat_hashtable_new (8,
hash_cmd[i] = weechat_hashtable_new (32,
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_INTEGER,
NULL,
@@ -713,7 +713,7 @@ irc_redirect_stop (struct t_irc_redirect *redirect, const char *error)
* error or max count reached, then we run callback and remove
* redirect
*/
hashtable = weechat_hashtable_new (8,
hashtable = weechat_hashtable_new (32,
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_STRING,
NULL,
+4 -4
View File
@@ -958,17 +958,17 @@ irc_server_alloc (const char *name)
new_server->last_redirect = NULL;
new_server->notify_list = NULL;
new_server->last_notify = NULL;
new_server->join_manual = weechat_hashtable_new (4,
new_server->join_manual = weechat_hashtable_new (32,
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_INTEGER,
NULL,
NULL);
new_server->join_channel_key = weechat_hashtable_new (4,
new_server->join_channel_key = weechat_hashtable_new (32,
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_STRING,
NULL,
NULL);
new_server->join_noswitch = weechat_hashtable_new (4,
new_server->join_noswitch = weechat_hashtable_new (32,
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_STRING,
NULL,
@@ -2093,7 +2093,7 @@ irc_server_sendf (struct t_irc_server *server, int flags, const char *tags,
ret_number = 1;
if (flags & IRC_SERVER_SEND_RETURN_HASHTABLE)
{
ret_hashtable = weechat_hashtable_new (8,
ret_hashtable = weechat_hashtable_new (32,
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_STRING,
NULL,