[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Minor optimization in json.c
From: |
Tom Tromey |
Subject: |
Re: Minor optimization in json.c |
Date: |
Sat, 13 Oct 2018 09:28:24 -0600 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.1.50 (gnu/linux) |
>>>>> "Eli" == Eli Zaretskii <address@hidden> writes:
>> 1. Could you try to eliminate global mutable state (i.e. the
>> json_inserted_bytes global variable)? I know that with the current
>> threading implementation access is properly synchronized, but the
>> global variable is still a code smell and unnecessarily couples
>> details of the threading implementation with the JSON adapter code. I
>> think you should be able to move it into the json_insert_data or
>> json_buffer_and_size structures.
Eli> I did that, but it needed adding new members to 2 data structures, and
Eli> copying the values back and forth between them. Not sure this is more
Eli> elegant.
It's also possible to put this sort of thing into the thread object.
Tom