Skip to content
Snippets Groups Projects
Commit 6331d2c2 authored by Henrik (Grubba) Grubbström's avatar Henrik (Grubba) Grubbström
Browse files

encode_value: Use MAPPING_FLAG_NO_SHRINK.

The mapping with encoded values is intentionally allocated with
medium sized hashtable. Shrinking it due to use of map_delete()
is just a waste of cpu.

Attempts to improve performance of encode_value() for objects,
programs and functions a bit more.
parent 27ae4d12
No related branches found
No related tags found
No related merge requests found
...@@ -1883,6 +1883,7 @@ void f_encode_value(INT32 args) ...@@ -1883,6 +1883,7 @@ void f_encode_value(INT32 args)
initialize_buf(&data->buf); initialize_buf(&data->buf);
data->canonic = 0; data->canonic = 0;
data->encoded=allocate_mapping(128); data->encoded=allocate_mapping(128);
data->encoded->data->flags |= MAPPING_FLAG_NO_SHRINK;
data->delayed = allocate_array (0); data->delayed = allocate_array (0);
SET_SVAL(data->counter, T_INT, NUMBER_NUMBER, integer, COUNTER_START); SET_SVAL(data->counter, T_INT, NUMBER_NUMBER, integer, COUNTER_START);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment