[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [T-Merge patch] syncing code for views

From: Oto BREZINA <otik_at_printflow.eu>
Date: Sat, 09 Apr 2011 21:54:13 +0200

On 2011-04-06 18:25, Stefan Küng wrote:
> On 05.04.2011 23:09, Oto BREZINA wrote:
>>>> popup.AppendMenu(
>>>> UINT nFlags,
>>>> UINT_PTR nIDNewItem = 0,
>>>> LPCTSTR lpszNewItem = NULL )
>>>> 1. Is there any real gain to do not use nIDNewItem same value as IDS ?
>>> That depends on whether we trust the optimizations of the compiler :)
>>> If we use the IDS values, then the switch() could take up a lot of space
>>> since those values are not continuous or even in the same value range.
>>> Sure, we could edit the resource.h file manually to make sure those IDS
>>> values are as we would like them, but I don't like messing with
>>> generated files.
>> we are talking about user action response - called rare, with up to ten
>> values. No big deal, but I will keep in mind ...
> It's not a performance issue but a code size issue. The switch-case
> statement is converted into a jump table, and if the values are far
> apart, that jump table gets really big. And we have to trust the
> optimizer to decide in such cases that a jump table isn't the right
> thing to do but better convert the switch-case to if-else statements.
I would say numbers are from big range right now:
ID_EDIT_COPY and ID_EDIT_PASTE are 0xE122 and 0xE125 respectively.
http://msdn.microsoft.com/en-us/library/dd941781%28v=vs.85%29.aspx - may
be not a relevant source I have seen lot of other values, but this one
is MSDN.

But I'm looking for other solution..
> Stefan

Oto BREZINA, Printflow s.r.o., EU
To unsubscribe from this discussion, e-mail: [dev-unsubscribe_at_tortoisesvn.tigris.org].
Received on 2011-04-09 21:57:54 CEST

This is an archived mail posted to the TortoiseSVN Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.