all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#19716: Excessive Windows registry accesses
@ 2015-01-28 18:32 PK
  2015-01-28 19:14 ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: PK @ 2015-01-28 18:32 UTC (permalink / raw)
  To: 19716

When I invoke GNU Emacs (24.4.1 (x86_64-w64-mingw32) of 2014-10-21 on KAEL) 
on Windows 7, it makes an enormous number of what seem (to me) unnecessary 
identical registry accesses.

20 times each:

     QueryValue: HKLM\System\CurrentControlSet\Control\Nls\CodePage\28605 
(success)
     QueryValue: HKLM\System\CurrentControlSet\Control\Nls\CodePage\28604 
(name not found)

1849 times each in quick succession (!):

     OpenKey: HKCU\SOFTWARE\GNU\Emacs (name not found)
     OpenKey: HKLM\SOFTWARE\GNU\Emacs (name not found)

1850 times likewise (also !):

     QueryKey: HKCU (success -- unsurprisingly)

and likewise finally, 1884 times:

     QueryKey: HKLM (more unsurprising success)

Why?

PK





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#19716: Excessive Windows registry accesses
  2015-01-28 18:32 bug#19716: Excessive Windows registry accesses PK
@ 2015-01-28 19:14 ` Eli Zaretskii
       [not found]   ` <54C94F69.3090403@resiak.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Eli Zaretskii @ 2015-01-28 19:14 UTC (permalink / raw)
  To: djc; +Cc: 19716

> Date: Wed, 28 Jan 2015 19:32:49 +0100
> From: PK <djc@resiak.org>
> 
> When I invoke GNU Emacs (24.4.1 (x86_64-w64-mingw32) of 2014-10-21 on KAEL) 
> on Windows 7, it makes an enormous number of what seem (to me) unnecessary 
> identical registry accesses.
> 
> 20 times each:
> 
>      QueryValue: HKLM\System\CurrentControlSet\Control\Nls\CodePage\28605 
> (success)
>      QueryValue: HKLM\System\CurrentControlSet\Control\Nls\CodePage\28604 
> (name not found)

Emacs doesn't access these directly.  Perhaps Windows does, in the
bowels of some API that Emacs calls.

>      OpenKey: HKCU\SOFTWARE\GNU\Emacs (name not found)
>      OpenKey: HKLM\SOFTWARE\GNU\Emacs (name not found)

This is accessed as part of initialization (because environment
variable might be set in the Registry), and also each time Emacs needs
to access GUI resources (because Emacs on Windows allows to store "X
resources" in the Registry).

Anyway, why do you think this is a bug?





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#19716: Excessive Windows registry accesses
       [not found]   ` <54C94F69.3090403@resiak.org>
@ 2015-01-29  3:51     ` Eli Zaretskii
  2017-12-08  1:44       ` Noam Postavsky
  0 siblings, 1 reply; 4+ messages in thread
From: Eli Zaretskii @ 2015-01-29  3:51 UTC (permalink / raw)
  To: djc; +Cc: 19716

> Date: Wed, 28 Jan 2015 22:06:49 +0100
> From: PK <djc@resiak.org>
> 
> > Anyway, why do you think this [duplicated identical OpenKey accesses] is a bug?
> 
> Because it suggests faulty logic to me.  Normally if I were looking for a 
> resource and either finding it or not, I'd keep the outcome the first time 
> and use that outcome.  (Not found?  Don't look again.  Found?  Use what was 
> found.)

The Registry is a place that can change outside Emacs control.  So the
fact we didn't find there something doesn't make sure it won't be
found on the next access.

> If it's cheap to make those more than 3600 duplicate registry accesses, 
> then I suppose there's nothing wrong with it.  (I tend to suspect that very 
> little in Windows is cheap, but I haven't measured the cost of those 
> calls.)  You seem to hint that it's logic transliterated from X, which 
> *does* have cheap access, and I can see the value in not fiddling with 
> logic that works.  Still...

X resources can be put into the Registry whenever the user wants, and
should work starting from then.

Please do time these accesses.  I don't think they are expensive, but
if your data shows otherwise, we could look into this.

(And please keep the bug address on the CC list.)





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#19716: Excessive Windows registry accesses
  2015-01-29  3:51     ` Eli Zaretskii
@ 2017-12-08  1:44       ` Noam Postavsky
  0 siblings, 0 replies; 4+ messages in thread
From: Noam Postavsky @ 2017-12-08  1:44 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: djc, 19716

tags 19716 wontfix
close 19716
quit

Eli Zaretskii <eliz@gnu.org> writes:

>> Date: Wed, 28 Jan 2015 22:06:49 +0100
>> From: PK <djc@resiak.org>
>> 
>> > Anyway, why do you think this [duplicated identical OpenKey accesses] is a bug?
>> 
>> Because it suggests faulty logic to me.  Normally if I were looking for a 
>> resource and either finding it or not, I'd keep the outcome the first time 
>> and use that outcome.  (Not found?  Don't look again.  Found?  Use what was 
>> found.)
>
> The Registry is a place that can change outside Emacs control.  So the
> fact we didn't find there something doesn't make sure it won't be
> found on the next access.
>
>> If it's cheap to make those more than 3600 duplicate registry accesses, 
>> then I suppose there's nothing wrong with it.  (I tend to suspect that very 
>> little in Windows is cheap, but I haven't measured the cost of those 
>> calls.)  You seem to hint that it's logic transliterated from X, which 
>> *does* have cheap access, and I can see the value in not fiddling with 
>> logic that works.  Still...
>
> X resources can be put into the Registry whenever the user wants, and
> should work starting from then.
>
> Please do time these accesses.  I don't think they are expensive, but
> if your data shows otherwise, we could look into this.

Seems no data is forthcoming.






^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-12-08  1:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-28 18:32 bug#19716: Excessive Windows registry accesses PK
2015-01-28 19:14 ` Eli Zaretskii
     [not found]   ` <54C94F69.3090403@resiak.org>
2015-01-29  3:51     ` Eli Zaretskii
2017-12-08  1:44       ` Noam Postavsky

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.