GNU bug report logs -
#48264
28.0.50; Changing the default for DEFVAR_PER_BUFFER variables takes O(#buffers) time
Previous Next
Full log
View this message in rfc822 format
Eli Zaretskii <eliz <at> gnu.org> writes:
>> From: Spencer Baugh <sbaugh <at> catern.com>
>> Cc: 48264 <at> debbugs.gnu.org
>> Date: Sat, 08 May 2021 15:03:46 -0400
>>
>> Eli Zaretskii <eliz <at> gnu.org> writes:
>> >> From: Spencer Baugh <sbaugh <at> catern.com>
>> >> Cc: 48264 <at> debbugs.gnu.org
>> >> Date: Sat, 08 May 2021 09:35:31 -0400
>> >> If you think such a conditionally-compiled runtime check would be
>> >> acceptable for applying these changes, I can go ahead and write that.
>> >
>> > Yes, I think so. But if Lars or Stefan think differently, I might
>> > reconsider.
>>
>> In the process of implementing the runtime check, I, of course, came up
>> with a better compile-time check. How about this?
>
> LGTM, thanks. But could you please run your benchmarks again, with
> this implementation, to make sure we still get only a 1 - 2% slowdown
> at worst? I wouldn't expect the addition to matter in an optimized
> build, but just to be sure...
I ran the benchmarks again and got similar results.
| | On master | With my changes | Slowdown |
| shr-bench | 2.2865667967 | 2.2762716187 | -0.48% |
| delete *.elc and make | 52m12.627s | 51m56.780s | -0.50% |
| xdisp-bench | 6.1960484849 | 6.2269325793 | 0.49% |
Here's the two patches that are needed to add this compile-time check;
they apply cleanly on my v4 series, when the "Add and use BVAR_FIELD
macros" patch is removed.
Spencer Baugh (2):
Take buffer field name in DEFVAR_PER_BUFFER
Add compile-time check that BVAR is used correctly
src/buffer.c | 140 ++++++++++++++++++++++++-------------------------
src/buffer.h | 28 ++++++++--
src/category.h | 2 +-
src/syntax.h | 2 +-
4 files changed, 94 insertions(+), 78 deletions(-)
--
2.31.1
This bug report was last modified 2 years and 289 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.