Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c++ > #8592 > unrolled thread

maximum cases in a switch ?

Started byLynn McGuire <lmc@winsim.com>
First post2011-08-09 11:03 -0500
Last post2011-08-22 10:56 -0700
Articles 20 on this page of 119 — 22 participants

Back to article view | Back to comp.lang.c++


Contents

  maximum cases in a switch ? Lynn McGuire <lmc@winsim.com> - 2011-08-09 11:03 -0500
    Re: maximum cases in a switch ? LR <lruss@superlink.net> - 2011-08-09 12:27 -0400
      Re: maximum cases in a switch ? Lynn McGuire <lmc@winsim.com> - 2011-08-09 12:23 -0500
        Re: maximum cases in a switch ? Joe Greer <jgreer@doubletake.com> - 2011-08-10 12:45 +0000
          Re: maximum cases in a switch ? Victor Bazarov <v.bazarov@comcast.invalid> - 2011-08-10 09:09 -0400
            Re: maximum cases in a switch ? Joe Greer <jgreer@doubletake.com> - 2011-08-11 12:49 +0000
              Re: maximum cases in a switch ? Lynn McGuire <lmc@winsim.com> - 2011-08-11 10:48 -0500
                Re: maximum cases in a switch ? Alain Ketterlin <alain@dpt-info.u-strasbg.fr> - 2011-08-11 18:26 +0200
                  Re: maximum cases in a switch ? Lynn McGuire <lmc@winsim.com> - 2011-08-11 11:45 -0500
                    Re: maximum cases in a switch ? Alain Ketterlin <alain@dpt-info.u-strasbg.fr> - 2011-08-11 20:06 +0200
                      Re: maximum cases in a switch ? Lynn McGuire <lmc@winsim.com> - 2011-08-11 14:47 -0500
                        Re: maximum cases in a switch ? Alain Ketterlin <alain@dpt-info.u-strasbg.fr> - 2011-08-11 22:32 +0200
                        Re: maximum cases in a switch ? gwowen <gwowen@gmail.com> - 2011-08-12 06:00 -0700
                          Re: maximum cases in a switch ? Lynn McGuire <lmc@winsim.com> - 2011-08-12 10:49 -0500
                Re: maximum cases in a switch ? Joe Greer <jgreer@doubletake.com> - 2011-08-12 13:46 +0000
                  Re: maximum cases in a switch ? Lynn McGuire <lmc@winsim.com> - 2011-08-12 10:58 -0500
                    Re: maximum cases in a switch ? Joe Greer <jgreer@doubletake.com> - 2011-08-12 20:22 +0000
                      Re: maximum cases in a switch ? Lynn McGuire <lmc@winsim.com> - 2011-08-12 15:57 -0500
                      Re: maximum cases in a switch ? Leo Equinox Gaspard <ekinox1995@gmail.com> - 2011-08-13 20:58 +0200
                        Re: maximum cases in a switch ? Victor Bazarov <v.bazarov@comcast.invalid> - 2011-08-13 18:16 -0400
                          Re: maximum cases in a switch ? Leo Equinox Gaspard <ekinox1995@gmail.com> - 2011-08-16 07:55 +0200
                            Re: maximum cases in a switch ? Victor Bazarov <v.bazarov@comcast.invalid> - 2011-08-16 09:04 -0400
                              Re: maximum cases in a switch ? Leo Equinox Gaspard <ekinox1995@gmail.com> - 2011-08-17 00:11 +0200
                                Re: maximum cases in a switch ? Ian Collins <ian-news@hotmail.com> - 2011-08-17 10:24 +1200
                                  Re: maximum cases in a switch ? Leo Equinox Gaspard <ekinox1995@gmail.com> - 2011-08-17 01:33 +0200
                      Re: maximum cases in a switch ? Leo Equinox Gaspard <ekinox1995@gmail.com> - 2011-08-17 00:18 +0200
                        Re: maximum cases in a switch ? Ian Collins <ian-news@hotmail.com> - 2011-08-17 10:29 +1200
                          Re: maximum cases in a switch ? Leo Equinox Gaspard <ekinox1995@gmail.com> - 2011-08-17 01:37 +0200
                            Re: maximum cases in a switch ? Ian Collins <ian-news@hotmail.com> - 2011-08-17 12:02 +1200
    Re: maximum cases in a switch ? Juha Nieminen <nospam@thanks.invalid> - 2011-08-09 16:38 +0000
    Re: maximum cases in a switch ? Victor Bazarov <v.bazarov@comcast.invalid> - 2011-08-09 15:42 -0400
      Re: maximum cases in a switch ? Lynn McGuire <lmc@winsim.com> - 2011-08-09 15:39 -0500
        Re: maximum cases in a switch ? Leo Equinox Gaspard <ekinox1995@gmail.com> - 2011-08-09 23:39 +0200
          Re: maximum cases in a switch ? Lynn McGuire <lmc@winsim.com> - 2011-08-09 17:18 -0500
        Re: maximum cases in a switch ? Victor Bazarov <v.bazarov@comcast.invalid> - 2011-08-09 20:06 -0400
          Re: maximum cases in a switch ? Juha Nieminen <nospam@thanks.invalid> - 2011-08-10 06:54 +0000
            Re: maximum cases in a switch ? Jorgen Grahn <grahn+nntp@snipabacken.se> - 2011-08-10 12:20 +0000
              Re: maximum cases in a switch ? Lynn McGuire <lmc@winsim.com> - 2011-08-10 11:34 -0500
                Re: maximum cases in a switch ? Paul Brettschneider <paul.brettschneider@yahoo.fr> - 2011-08-10 20:34 +0200
                  Re: maximum cases in a switch ? Paul Brettschneider <paul.brettschneider@yahoo.fr> - 2011-08-10 21:06 +0200
                Re: maximum cases in a switch ? Jorgen Grahn <grahn+nntp@snipabacken.se> - 2011-08-11 21:00 +0000
        Re: maximum cases in a switch ? Marcel Müller <news.5.maazl@spamgourmet.com> - 2011-08-10 11:10 +0200
          Re: maximum cases in a switch ? Juha Nieminen <nospam@thanks.invalid> - 2011-08-10 10:40 +0000
            Re: maximum cases in a switch ? Victor Bazarov <v.bazarov@comcast.invalid> - 2011-08-10 09:02 -0400
              Re: maximum cases in a switch ? Juha Nieminen <nospam@thanks.invalid> - 2011-08-11 08:05 +0000
            Re: maximum cases in a switch ? Marcel Müller <news.5.maazl@spamgourmet.com> - 2011-08-10 21:17 +0200
          Re: maximum cases in a switch ? Lynn McGuire <lmc@winsim.com> - 2011-08-10 11:12 -0500
            Re: maximum cases in a switch ? "Paul" <pchristor@yahoo.co.uk> - 2011-08-11 11:07 +0100
              Re: maximum cases in a switch ? Leigh Johnston <leigh@i42.co.uk> - 2011-08-13 00:14 +0100
                Re: maximum cases in a switch ? "Paul" <pchristor@yahoo.co.uk> - 2011-08-13 14:54 +0100
                  Re: maximum cases in a switch ? Leigh Johnston <leigh@i42.co.uk> - 2011-08-13 15:26 +0100
                  Re: maximum cases in a switch ? Juha Nieminen <nospam@thanks.invalid> - 2011-08-14 18:14 +0000
                    Re: maximum cases in a switch ? "Paul" <pchristor@yahoo.co.uk> - 2011-08-15 01:09 +0100
                      Re: maximum cases in a switch ? Nick Keighley <nick_keighley_nospam@hotmail.com> - 2011-08-15 02:15 -0700
                        Re: maximum cases in a switch ? "Paul" <pchristor@yahoo.co.uk> - 2011-08-15 12:18 +0100
                          Re: maximum cases in a switch ? Leigh Johnston <leigh@i42.co.uk> - 2011-08-15 13:22 +0100
                            Re: maximum cases in a switch ? "Paul" <pchristor@yahoo.co.uk> - 2011-08-15 13:38 +0100
                              Re: maximum cases in a switch ? Leigh Johnston <leigh@i42.co.uk> - 2011-08-15 14:06 +0100
                                Re: maximum cases in a switch ? "Paul" <pchristor@yahoo.co.uk> - 2011-08-15 16:05 +0100
                                  Re: maximum cases in a switch ? Leigh Johnston <leigh@i42.co.uk> - 2011-08-15 16:20 +0100
                                    Re: maximum cases in a switch ? "Paul" <pchristor@yahoo.co.uk> - 2011-08-15 20:24 +0100
                                      Re: maximum cases in a switch ? Leigh Johnston <leigh@i42.co.uk> - 2011-08-15 22:09 +0100
                                        Re: maximum cases in a switch ? Leigh Johnston <leigh@i42.co.uk> - 2011-08-15 22:19 +0100
                                          Re: maximum cases in a switch ? "Paul" <pchristor@yahoo.co.uk> - 2011-08-16 03:10 +0100
                                            Re: maximum cases in a switch ? Leigh Johnston <leigh@i42.co.uk> - 2011-08-16 13:08 +0100
                                              Re: maximum cases in a switch ? "Paul" <pchristor@yahoo.co.uk> - 2011-08-16 14:01 +0100
                                                Re: maximum cases in a switch ? Leigh Johnston <leigh@i42.co.uk> - 2011-08-16 14:10 +0100
                                        Re: maximum cases in a switch ? "Paul" <pchristor@yahoo.co.uk> - 2011-08-16 03:07 +0100
                                          Re: maximum cases in a switch ? Leigh Johnston <leigh@i42.co.uk> - 2011-08-16 13:05 +0100
                                            Re: maximum cases in a switch ? "Paul" <pchristor@yahoo.co.uk> - 2011-08-16 13:57 +0100
                                              Re: maximum cases in a switch ? Leigh Johnston <leigh@i42.co.uk> - 2011-08-16 14:07 +0100
                                                Re: maximum cases in a switch ? "Paul" <pchristor@yahoo.co.uk> - 2011-08-16 19:29 +0100
                                                  Re: maximum cases in a switch ? Leigh Johnston <leigh@i42.co.uk> - 2011-08-16 19:35 +0100
                                                    Re: maximum cases in a switch ? "Paul" <pchristor@yahoo.co.uk> - 2011-08-17 00:01 +0100
                                                      Re: maximum cases in a switch ? Leigh Johnston <leigh@i42.co.uk> - 2011-08-17 00:11 +0100
                                                        Re: maximum cases in a switch ? "Paul" <pchristor@yahoo.co.uk> - 2011-08-17 01:23 +0100
                              Re: maximum cases in a switch ? Juha Nieminen <nospam@thanks.invalid> - 2011-08-15 13:32 +0000
                                Re: maximum cases in a switch ? "Paul" <pchristor@yahoo.co.uk> - 2011-08-15 15:20 +0100
                                  Re: maximum cases in a switch ? Leigh Johnston <leigh@i42.co.uk> - 2011-08-15 15:33 +0100
                                  Re: maximum cases in a switch ? Juha Nieminen <nospam@thanks.invalid> - 2011-08-16 07:34 +0000
                                    Re: maximum cases in a switch ? "Paul" <pchristor@yahoo.co.uk> - 2011-08-16 13:49 +0100
                                      Re: maximum cases in a switch ? Juha Nieminen <nospam@thanks.invalid> - 2011-08-16 15:02 +0000
                                        Re: maximum cases in a switch ? Leigh Johnston <leigh@i42.co.uk> - 2011-08-16 16:07 +0100
                                          Re: maximum cases in a switch ? "Paul" <pchristor@yahoo.co.uk> - 2011-08-16 19:50 +0100
                                            Re: maximum cases in a switch ? Leigh Johnston <leigh@i42.co.uk> - 2011-08-16 19:57 +0100
                                              Re: maximum cases in a switch ? "Paul" <pchristor@yahoo.co.uk> - 2011-08-17 00:12 +0100
                                        Re: maximum cases in a switch ? "Paul" <pchristor@yahoo.co.uk> - 2011-08-16 19:34 +0100
                                          Re: maximum cases in a switch ? Juha Nieminen <nospam@thanks.invalid> - 2011-08-17 12:55 +0000
                                            Re: maximum cases in a switch ? "Paul" <pchristor@yahoo.co.uk> - 2011-08-17 14:32 +0100
                                              Re: maximum cases in a switch ? Juha Nieminen <nospam@thanks.invalid> - 2011-08-17 20:11 +0000
                                                Re: maximum cases in a switch ? "Paul" <pchristor@yahoo.co.uk> - 2011-08-18 11:00 +0100
                              Re: maximum cases in a switch ? Joshua Maurice <joshuamaurice@gmail.com> - 2011-08-15 15:35 -0700
                                Re: maximum cases in a switch ? Gareth Owen <gwowen@gmail.com> - 2011-08-17 06:34 +0100
                                  Re: maximum cases in a switch ? "Paul" <pchristor@yahoo.co.uk> - 2011-08-17 12:23 +0100
                          Re: maximum cases in a switch ? Nick Keighley <nick_keighley_nospam@hotmail.com> - 2011-08-17 02:01 -0700
                            Re: maximum cases in a switch ? "Paul" <pchristor@yahoo.co.uk> - 2011-08-17 12:29 +0100
                              Re: maximum cases in a switch ? Leigh Johnston <leigh@i42.co.uk> - 2011-08-17 14:13 +0100
                                Re: maximum cases in a switch ? "Paul" <pchristor@yahoo.co.uk> - 2011-08-17 14:18 +0100
                                  Re: maximum cases in a switch ? Leigh Johnston <leigh@i42.co.uk> - 2011-08-17 14:43 +0100
                                    Re: maximum cases in a switch ? "Paul" <pchristor@yahoo.co.uk> - 2011-08-17 15:23 +0100
                                      Re: maximum cases in a switch ? Leigh Johnston <leigh@i42.co.uk> - 2011-08-17 15:31 +0100
                                        Re: maximum cases in a switch ? "Paul" <pchristor@yahoo.co.uk> - 2011-08-17 15:48 +0100
                                          Re: maximum cases in a switch ? Leigh Johnston <leigh@i42.co.uk> - 2011-08-17 15:53 +0100
                                          Re: maximum cases in a switch ? SG <s.gesemann@gmail.com> - 2011-08-17 07:54 -0700
                                            Re: maximum cases in a switch ? "Paul" <pchristor@yahoo.co.uk> - 2011-08-17 20:40 +0100
                              Re: maximum cases in a switch ? Larry Evans <cppljevans@suddenlink.net> - 2011-08-17 10:54 -0500
                                Re: maximum cases in a switch ? Robert Wessel <robertwessel2@yahoo.com> - 2011-08-17 12:44 -0500
                                  jump table vs. vector of function pointers(was Re: maximum cases in a switch ? Larry Evans <cppljevans@suddenlink.net> - 2011-08-17 15:18 -0500
                                    Re: jump table vs. vector of function pointers(was Re: maximum cases in a switch ? Alain Ketterlin <alain@dpt-info.u-strasbg.fr> - 2011-08-17 22:48 +0200
                                      Re: jump table vs. vector of function pointers(was Re: maximum cases in a switch ? Larry Evans <cppljevans@suddenlink.net> - 2011-08-17 16:49 -0500
                                Re: maximum cases in a switch ? Thomas David Rivers <rivers@dignus.com> - 2011-08-17 13:50 -0400
                                Re: maximum cases in a switch ? "Paul" <pchristor@yahoo.co.uk> - 2011-08-17 22:04 +0100
                              Re: maximum cases in a switch ? Nick Keighley <nick_keighley_nospam@hotmail.com> - 2011-08-22 03:23 -0700
      Re: maximum cases in a switch ? Nick Keighley <nick_keighley_nospam@hotmail.com> - 2011-08-12 05:51 -0700
        Re: maximum cases in a switch ? Victor Bazarov <v.bazarov@comcast.invalid> - 2011-08-13 08:45 -0400
      Re: maximum cases in a switch ? James Kanze <james.kanze@gmail.com> - 2011-08-21 16:55 -0700
        Re: maximum cases in a switch ? Robert Wessel <robertwessel2@yahoo.com> - 2011-08-21 23:22 -0500
          Re: maximum cases in a switch ? Victor Bazarov <v.bazarov@comcast.invalid> - 2011-08-22 08:14 -0400
          Re: maximum cases in a switch ? James Kanze <james.kanze@gmail.com> - 2011-08-22 10:56 -0700

Page 5 of 6 — ← Prev page 1 2 3 4 [5] 6  Next page →


#8917

From"Paul" <pchristor@yahoo.co.uk>
Date2011-08-16 13:49 +0100
Message-ID<j2dp20$2li$1@adenine.netfront.net>
In reply to#8888
"Juha Nieminen" <nospam@thanks.invalid> wrote in message 
news:4e4a1da1$0$3070$7b1e8fa0@news.nbl.fi...
> Paul <pchristor@yahoo.co.uk> wrote:
>>
>> "Juha Nieminen" <nospam@thanks.invalid> wrote in message
>> news:4e491ff5$0$2807$7b1e8fa0@news.nbl.fi...
>>> Paul <pchristor@yahoo.co.uk> wrote:
>>>> You can't have a switch statement with 525 cases executed in 6 clock
>>>> cycles
>>>> you fucking moronic idiot.
>>>
>>>  You see, that's why they recommended you to go and do some research on
>>> jump tables.
>> I am not even talking about a jump table, what makes you think a jump 
>> table
>> has any relevance to what I said?
>
>  Read your own text above. It says "you can't have a switch statement with
> 525 cases executed in 6 clock cycles". It doesn't have any qualifiers or
> conditions. You are making an absolute assertion: That it's impossible.
>
I made it clear that the estimated number of clock cycles was based on a 
worse case scenario, where all conditions were checked.
Also the OP has stated that the cases were nonordered.

The text itself does not have conditions but the context the text was 
written in implied these conditions.

>  Now, after several people have hammered into you the concept of jump
> tables, and seemingly you finally understand what that means and how they
> can be applied by a compiler to implement a switch block, now you can't
> just admit that you didn't understand it first but now you do. Instead,
> you try to weasel yourself out of the situation by some vague claims that
> you were "not talking about a jump table".

A jump table has nothing to do with it if the compiler doesn't implement it 
as a jump table.
My estimate was a rough estimate intended to be an estimate of the least 
efficient(or thereabouts)implementation.
So why if I am not even talking about a jump table do you suggest that I 
don't know what a jump table is? I am not making a vague claim that "I was 
not talking about jump tables", I am tellin you I was not talking about jump 
tables.


--- Posted via news://freenews.netfront.net/ - Complaints to news@netfront.net ---

[toc] | [prev] | [next] | [standalone]


#8926

FromJuha Nieminen <nospam@thanks.invalid>
Date2011-08-16 15:02 +0000
Message-ID<4e4a866a$0$4352$7b1e8fa0@news.nbl.fi>
In reply to#8917
Paul <pchristor@yahoo.co.uk> wrote:
> I made it clear that the estimated number of clock cycles was based on a 
> worse case scenario, where all conditions were checked.

  You made it clear? Where exactly? I went through the conversation again
and nowhere did you make any mention whatsoever that you were talking about
"the worst case scenario", not directly, nor even in context. The only
thing you did was to insult the poster who mentioned jump tables and then
when I asked to explain yourself, you simply said that it's impossible to
execute a large switch block on just 6 clock cycles.

  It's rather clear that you didn't know about the jump table trick,
didn't understand it when you were first told, and thought that the
only way to compile a switch block is to effectively compile a conditional
for each case. Clearly you later understood how a jump table works but
now are unable to admit that you made a mistake.

[toc] | [prev] | [next] | [standalone]


#8927

FromLeigh Johnston <leigh@i42.co.uk>
Date2011-08-16 16:07 +0100
Message-ID<BLWdnWqJd6E0GtfTnZ2dnUVZ8jCdnZ2d@giganews.com>
In reply to#8926
On 16/08/2011 16:02, Juha Nieminen wrote:
> Paul<pchristor@yahoo.co.uk>  wrote:
>> I made it clear that the estimated number of clock cycles was based on a
>> worse case scenario, where all conditions were checked.
>
>    You made it clear? Where exactly? I went through the conversation again
> and nowhere did you make any mention whatsoever that you were talking about
> "the worst case scenario", not directly, nor even in context. The only
> thing you did was to insult the poster who mentioned jump tables and then
> when I asked to explain yourself, you simply said that it's impossible to
> execute a large switch block on just 6 clock cycles.
>
>    It's rather clear that you didn't know about the jump table trick,
> didn't understand it when you were first told, and thought that the
> only way to compile a switch block is to effectively compile a conditional
> for each case. Clearly you later understood how a jump table works but
> now are unable to admit that you made a mistake.

This seems to be a familiar pattern of behaviour from Paul; his 
inability to admit to mistakes or gaps in his knowledge is almost 
pathological in nature.

/Leigh

[toc] | [prev] | [next] | [standalone]


#8933

From"Paul" <pchristor@yahoo.co.uk>
Date2011-08-16 19:50 +0100
Message-ID<j2ee5p$sb2$1@adenine.netfront.net>
In reply to#8927
"Leigh Johnston" <leigh@i42.co.uk> wrote in message 
news:BLWdnWqJd6E0GtfTnZ2dnUVZ8jCdnZ2d@giganews.com...
> On 16/08/2011 16:02, Juha Nieminen wrote:
>> Paul<pchristor@yahoo.co.uk>  wrote:
>>> I made it clear that the estimated number of clock cycles was based on a
>>> worse case scenario, where all conditions were checked.
>>
>>    You made it clear? Where exactly? I went through the conversation 
>> again
>> and nowhere did you make any mention whatsoever that you were talking 
>> about
>> "the worst case scenario", not directly, nor even in context. The only
>> thing you did was to insult the poster who mentioned jump tables and then
>> when I asked to explain yourself, you simply said that it's impossible to
>> execute a large switch block on just 6 clock cycles.
>>
>>    It's rather clear that you didn't know about the jump table trick,
>> didn't understand it when you were first told, and thought that the
>> only way to compile a switch block is to effectively compile a 
>> conditional
>> for each case. Clearly you later understood how a jump table works but
>> now are unable to admit that you made a mistake.
>
> This seems to be a familiar pattern of behaviour from Paul; his inability 
> to admit to mistakes or gaps in his knowledge is almost pathological in 
> nature.
>
If it makes you feel better then go ahead and think I don't know what a jump 
table is. I couldn't really care. 


--- Posted via news://freenews.netfront.net/ - Complaints to news@netfront.net ---

[toc] | [prev] | [next] | [standalone]


#8934

FromLeigh Johnston <leigh@i42.co.uk>
Date2011-08-16 19:57 +0100
Message-ID<-JWdnR-O44oEINfTnZ2dnUVZ7s6dnZ2d@giganews.com>
In reply to#8933
On 16/08/2011 19:50, Paul wrote:
>
> "Leigh Johnston" <leigh@i42.co.uk> wrote in message
> news:BLWdnWqJd6E0GtfTnZ2dnUVZ8jCdnZ2d@giganews.com...
>> On 16/08/2011 16:02, Juha Nieminen wrote:
>>> Paul<pchristor@yahoo.co.uk> wrote:
>>>> I made it clear that the estimated number of clock cycles was based
>>>> on a
>>>> worse case scenario, where all conditions were checked.
>>>
>>> You made it clear? Where exactly? I went through the conversation again
>>> and nowhere did you make any mention whatsoever that you were talking
>>> about
>>> "the worst case scenario", not directly, nor even in context. The only
>>> thing you did was to insult the poster who mentioned jump tables and
>>> then
>>> when I asked to explain yourself, you simply said that it's
>>> impossible to
>>> execute a large switch block on just 6 clock cycles.
>>>
>>> It's rather clear that you didn't know about the jump table trick,
>>> didn't understand it when you were first told, and thought that the
>>> only way to compile a switch block is to effectively compile a
>>> conditional
>>> for each case. Clearly you later understood how a jump table works but
>>> now are unable to admit that you made a mistake.
>>
>> This seems to be a familiar pattern of behaviour from Paul; his
>> inability to admit to mistakes or gaps in his knowledge is almost
>> pathological in nature.
>>
> If it makes you feel better then go ahead and think I don't know what a
> jump table is. I couldn't really care.

If you knew what a jump table was or how switches are commonly 
implemented by compilers *before* your initial post in this thread you 
would have never made that initial post.

You may or may not *now* fully understand how compilers commonly 
implement switch statements; I am doubtful if you now "get it".

HTH.

/Leigh

[toc] | [prev] | [next] | [standalone]


#8961

From"Paul" <pchristor@yahoo.co.uk>
Date2011-08-17 00:12 +0100
Message-ID<j2ethi$1fep$1@adenine.netfront.net>
In reply to#8934
"Leigh Johnston" <leigh@i42.co.uk> wrote in message 
news:-JWdnR-O44oEINfTnZ2dnUVZ7s6dnZ2d@giganews.com...
> On 16/08/2011 19:50, Paul wrote:
>>>> Paul<pchristor@yahoo.co.uk> wrote:
>>>>> I made it clear that the estimated number of clock cycles was based
>>>>> on a
>>>>> worse case scenario, where all conditions were checked.
>>>>
>>>> You made it clear? Where exactly? I went through the conversation again
>>>> and nowhere did you make any mention whatsoever that you were talking
>>>> about
>>>> "the worst case scenario", not directly, nor even in context. The only
>>>> thing you did was to insult the poster who mentioned jump tables and
>>>> then
>>>> when I asked to explain yourself, you simply said that it's
>>>> impossible to
>>>> execute a large switch block on just 6 clock cycles.
>>>>
>>>> It's rather clear that you didn't know about the jump table trick,
>>>> didn't understand it when you were first told, and thought that the
>>>> only way to compile a switch block is to effectively compile a
>>>> conditional
>>>> for each case. Clearly you later understood how a jump table works but
>>>> now are unable to admit that you made a mistake.
>>>
>>> This seems to be a familiar pattern of behaviour from Paul; his
>>> inability to admit to mistakes or gaps in his knowledge is almost
>>> pathological in nature.
>>>
>> If it makes you feel better then go ahead and think I don't know what a
>> jump table is. I couldn't really care.
>
> If you knew what a jump table was or how switches are commonly implemented 
> by compilers *before* your initial post in this thread you would have 
> never made that initial post.
>
> You may or may not *now* fully understand how compilers commonly implement 
> switch statements; I am doubtful if you now "get it".
>
Changing it to knew or will know in the future makes no difference I still 
don't care whether you think I know/knew/will know about a "jump table". 


--- Posted via news://freenews.netfront.net/ - Complaints to news@netfront.net ---

[toc] | [prev] | [next] | [standalone]


#8931

From"Paul" <pchristor@yahoo.co.uk>
Date2011-08-16 19:34 +0100
Message-ID<j2ed8i$rch$1@adenine.netfront.net>
In reply to#8926
"Juha Nieminen" <nospam@thanks.invalid> wrote in message 
news:4e4a866a$0$4352$7b1e8fa0@news.nbl.fi...
> Paul <pchristor@yahoo.co.uk> wrote:
>> I made it clear that the estimated number of clock cycles was based on a
>> worse case scenario, where all conditions were checked.
>
>  You made it clear? Where exactly? I went through the conversation again
> and nowhere did you make any mention whatsoever that you were talking 
> about
> "the worst case scenario", not directly, nor even in context.

I said "even is the last condition is the only one that is true".

> The only
> thing you did was to insult the poster who mentioned jump tables and then
> when I asked to explain yourself, you simply said that it's impossible to
> execute a large switch block on just 6 clock cycles.

No you are twisting the context from that of an unordered switch case, to 
what you incorrectly assumed to be that of an ordered switch case that was 
implemented as a jump table.



--- Posted via news://freenews.netfront.net/ - Complaints to news@netfront.net ---

[toc] | [prev] | [next] | [standalone]


#8980

FromJuha Nieminen <nospam@thanks.invalid>
Date2011-08-17 12:55 +0000
Message-ID<4e4bba34$0$4367$7b1e8fa0@news.nbl.fi>
In reply to#8931
Paul <pchristor@yahoo.co.uk> wrote:
> "Juha Nieminen" <nospam@thanks.invalid> wrote in message 
> news:4e4a866a$0$4352$7b1e8fa0@news.nbl.fi...
>> Paul <pchristor@yahoo.co.uk> wrote:
>>> I made it clear that the estimated number of clock cycles was based on a
>>> worse case scenario, where all conditions were checked.
>>
>>  You made it clear? Where exactly? I went through the conversation again
>> and nowhere did you make any mention whatsoever that you were talking 
>> about
>> "the worst case scenario", not directly, nor even in context.
> 
> I said "even is the last condition is the only one that is true".
> 
>> The only
>> thing you did was to insult the poster who mentioned jump tables and then
>> when I asked to explain yourself, you simply said that it's impossible to
>> execute a large switch block on just 6 clock cycles.
> 
> No you are twisting the context from that of an unordered switch case, to 
> what you incorrectly assumed to be that of an ordered switch case that was 
> implemented as a jump table.

  Nowhere did you make any mention whatsoever about "an unordered switch
case". And even if you had done it, it would still be wrong. The order
in which the case blocks are specified doesn't matter, the jump table
technique still works equally well. (The only thing that changes is
the order in which the code is arranged inside the function. Indexing
the jump table still works exactly the same way as if the cases were
ordered in whichever order you want.)

  The situation where a jump table cannot be used for an O(1) jump to
the proper case block is when the case values are sparse (in other words
not consecutive or with only very small gaps between them). In that case
the jump table would become too large to be feasible.

  However, even in this situation a binary (instead of a linear) search
can be performed on the jump table. This increases the execution time to
O(log n), which is still significantly lower than your proposed O(n).
(In other words, rather than talking about 6 clock cycles we might be
talking about a hundred or so at most. Nowhere near your 5000.)

  However, that's not the point. The point is that you insulted the poster
who talked about jump tables. You speak as if you had first suggested your
linear-time execution estimation, then someone had responded with the
jump table solution, and then you had objected that you were not talking
about that. No, that's not what happened. Your very first post was in
response to the jump table post. You were objecting directly to that. You
insinuated that it's impossible and resorted to namecalling.

[toc] | [prev] | [next] | [standalone]


#8985

From"Paul" <pchristor@yahoo.co.uk>
Date2011-08-17 14:32 +0100
Message-ID<j2gfuu$2pnh$2@adenine.netfront.net>
In reply to#8980
"Juha Nieminen" <nospam@thanks.invalid> wrote in message 
news:4e4bba34$0$4367$7b1e8fa0@news.nbl.fi...
> Paul <pchristor@yahoo.co.uk> wrote:
>> "Juha Nieminen" <nospam@thanks.invalid> wrote in message
>> news:4e4a866a$0$4352$7b1e8fa0@news.nbl.fi...
>>> Paul <pchristor@yahoo.co.uk> wrote:
>>>> I made it clear that the estimated number of clock cycles was based on 
>>>> a
>>>> worse case scenario, where all conditions were checked.
>>>
>>>  You made it clear? Where exactly? I went through the conversation again
>>> and nowhere did you make any mention whatsoever that you were talking
>>> about
>>> "the worst case scenario", not directly, nor even in context.
>>
>> I said "even is the last condition is the only one that is true".
>>
>>> The only
>>> thing you did was to insult the poster who mentioned jump tables and 
>>> then
>>> when I asked to explain yourself, you simply said that it's impossible 
>>> to
>>> execute a large switch block on just 6 clock cycles.
>>
>> No you are twisting the context from that of an unordered switch case, to
>> what you incorrectly assumed to be that of an ordered switch case that 
>> was
>> implemented as a jump table.
>
>  Nowhere did you make any mention whatsoever about "an unordered switch
> case".
I didnt but the OP did.

The implementation of the switch case is irrellevant to what I said. The 
worst case scenaio would be approx 3x 525.
Obviously a compiler will optimise this , I don't really give a toss how it 
does this and I don't give a toss whether you or any other idiot thinks it 
will be implemented as a jump table or a binary search becuase you are just 
speculating and if you idiots had any clue about this you would have 
followed that branch of the thread that was discussing jump tables and 
answered the questions there.


It's irrellevant if you or any other idiot can do it in 1 clock cycle. Now 
stop trying to twist what I say.


--- Posted via news://freenews.netfront.net/ - Complaints to news@netfront.net ---

[toc] | [prev] | [next] | [standalone]


#9011

FromJuha Nieminen <nospam@thanks.invalid>
Date2011-08-17 20:11 +0000
Message-ID<4e4c2063$0$4393$7b1e8fa0@news.nbl.fi>
In reply to#8985
Paul <pchristor@yahoo.co.uk> wrote:
> The implementation of the switch case is irrellevant to what I said. The 
> worst case scenaio would be approx 3x 525.
> Obviously a compiler will optimise this , I don't really give a toss how it 
> does this and I don't give a toss whether you or any other idiot thinks it 
> will be implemented as a jump table or a binary search becuase you are just 
> speculating and if you idiots had any clue about this you would have 
> followed that branch of the thread that was discussing jump tables and 
> answered the questions there.
> 
> 
> It's irrellevant if you or any other idiot can do it in 1 clock cycle. Now 
> stop trying to twist what I say.

  You are just digging a deeper and deeper hole, trying to weasel yourself
out of the pinch.

  I know how it is, from personal experience. Been there, done that. Once
you have started to defend your mistake, you simply can't stop anymore.
You have to continue. But it's a vicious circle: The more you try to avoid
admitting the error, the more you prolong the facade, the more it would hurt
to stop and admit your error. So you just can't stop. You try to come up
with some rationalization, some explanation of how you didn't actually make
a mistake, how your behavior and claims were justified. You might even
convince yourself that you didn't make a mistake (even though deep inside
you know you did, you just can't admit it even to yourself, much less to
others).

  I know how hard it is to break the vicious cycle, and how hard it is
to avoid doing the same thing again and again in the future. You write
a response too hastily, without thinking, without having the proper
knowledge and experience on the subject, and suddenly you once again find
yourself in the pinch: You made a mistake and now it's very hard to admit
it and move on. You have to start defending yourself once again. Which,
unfortunately, just makes things worse. But you just can't stop. I know
this feeling, and I know how hard it is to overcome.

  However, your problem is even worse than just that. Your problem is
aggravated even more by the fact that you resort very easily to insults,
denigrating namecalling and belittling other people, sometimes even without
any kind of provocation. Maybe it's a defense mechanism, a semi-subconscious
attempt to compensate your own insecurities. After all, if everybody else
is an idiot and a moron, you yourself cannot be that bad, can you? This is
a form of psychological projection.

  I know this post will not change anything at all, and it will be a
complete waste of time, but maybe, just maybe, if you read it, it might
plant a small seed in you that will perhaps grow in a few years and make
you learn something about how to interact with other people, even when
doing so behind the anonymity of the internet.

  I know you are going to dismiss this, but for your own sake, please do
three things:

  1) Stop insulting people. Simply don't do it. There's no reason to do it.

  2) atop posting hasty replies on subjects you do not have much experience
and knowledge about (especially if that reply is in disagreement with what
somebody else has said).

  3) When you make a mistake, don't be afraid to admit it. Just write
something like "ah, you are right, I didn't know that", no matter how
much it might hurt your pride at that moment, and move on. You will be
glad later that you did that instead of engaging in yet another detrimental
and useless flamewar that will only give you a shitty reputation.

  You are not going to do this now, but I'm hoping something of this will
make you think in the following years.

[toc] | [prev] | [next] | [standalone]


#9035

From"Paul" <pchristor@yahoo.co.uk>
Date2011-08-18 11:00 +0100
Message-ID<j2int2$1eju$1@adenine.netfront.net>
In reply to#9011
"Juha Nieminen" <nospam@thanks.invalid> wrote in message 
news:4e4c2063$0$4393$7b1e8fa0@news.nbl.fi...
> Paul <pchristor@yahoo.co.uk> wrote:
>> The implementation of the switch case is irrellevant to what I said. The
>> worst case scenaio would be approx 3x 525.
>> Obviously a compiler will optimise this , I don't really give a toss how 
>> it
>> does this and I don't give a toss whether you or any other idiot thinks 
>> it
>> will be implemented as a jump table or a binary search becuase you are 
>> just
>> speculating and if you idiots had any clue about this you would have
>> followed that branch of the thread that was discussing jump tables and
>> answered the questions there.
>>
>>
>> It's irrellevant if you or any other idiot can do it in 1 clock cycle. 
>> Now
>> stop trying to twist what I say.
>
>  You are just digging a deeper and deeper hole, trying to weasel yourself
> out of the pinch.
I'm not in a pinch or a hole that I need to dig myself out of.

>
>  I know how it is, from personal experience. Been there, done that. Once
> you have started to defend your mistake, you simply can't stop anymore.
> You have to continue. But it's a vicious circle: The more you try to avoid
> admitting the error, the more you prolong the facade, the more it would 
> hurt
> to stop and admit your error. So you just can't stop. You try to come up
> with some rationalization, some explanation of how you didn't actually 
> make
> a mistake, how your behavior and claims were justified. You might even
> convince yourself that you didn't make a mistake (even though deep inside
> you know you did, you just can't admit it even to yourself, much less to
> others).
Thats YOUR experience but this is not the case here.
>
>  I know how hard it is to break the vicious cycle, and how hard it is
> to avoid doing the same thing again and again in the future. You write
> a response too hastily, without thinking, without having the proper
> knowledge and experience on the subject, and suddenly you once again find
> yourself in the pinch: You made a mistake and now it's very hard to admit
> it and move on. You have to start defending yourself once again. Which,
> unfortunately, just makes things worse. But you just can't stop. I know
> this feeling, and I know how hard it is to overcome.

I have no problems admitting mistakes.

>
>  However, your problem is even worse than just that. Your problem is
> aggravated even more by the fact that you resort very easily to insults,
> denigrating namecalling and belittling other people, sometimes even 
> without
> any kind of provocation. Maybe it's a defense mechanism, a 
> semi-subconscious
> attempt to compensate your own insecurities. After all, if everybody else
> is an idiot and a moron, you yourself cannot be that bad, can you? This is
> a form of psychological projection.
I don't randomly insult normal people. I insult Leigh because he is 
exceptionally annoying and his behaviour is no better.


>
>  I know this post will not change anything at all, and it will be a
> complete waste of time, but maybe, just maybe, if you read it, it might
> plant a small seed in you that will perhaps grow in a few years and make
> you learn something about how to interact with other people, even when
> doing so behind the anonymity of the internet.
>
>  I know you are going to dismiss this, but for your own sake, please do
> three things:
>
>  1) Stop insulting people. Simply don't do it. There's no reason to do it.
I don't insult people randomly as you are suggesting .
I do mock and taunt Leigh but he is exceptionally annoying and always being 
argumentative and awkward.

>
>  2) atop posting hasty replies on subjects you do not have much experience
> and knowledge about (especially if that reply is in disagreement with what
> somebody else has said).
I haven't disagreed with anything. You are misinterpreting my reply. My 
reply was simply saying that...
Even given a  bad scenario where all conditions were tested , that is 525 
conditional tests, its still not alot of processing time. The topic of 
compiler implementations was being discussed on a different thread chain.
I wasn't discussing the details of how a compiler implements a switch case. 
I was discussing how 525 cases seems alot but its not really that much.


>
>  3) When you make a mistake, don't be afraid to admit it. Just write
> something like "ah, you are right, I didn't know that", no matter how
> much it might hurt your pride at that moment, and move on. You will be
> glad later that you did that instead of engaging in yet another 
> detrimental
> and useless flamewar that will only give you a shitty reputation.

Im not afraid to admit it but why don't you take your own advice and admit 
that you have misinterpreted my post.

>
>  You are not going to do this now, but I'm hoping something of this will
> make you think in the following years.

Like you are the know all god of everything and you know what I am or am not 
going to do?


--- Posted via news://freenews.netfront.net/ - Complaints to news@netfront.net ---

[toc] | [prev] | [next] | [standalone]


#8879

FromJoshua Maurice <joshuamaurice@gmail.com>
Date2011-08-15 15:35 -0700
Message-ID<3d8f8114-d896-484f-a87f-cf8d851607f7@x2g2000yql.googlegroups.com>
In reply to#8856
On Aug 15, 5:38 am, "Paul" <pchris...@yahoo.co.uk> wrote:
[...]

Please ignore Paul the troll. He's either a troll, drunk, or insane,
etc.

[toc] | [prev] | [next] | [standalone]


#8968

FromGareth Owen <gwowen@gmail.com>
Date2011-08-17 06:34 +0100
Message-ID<87zkj8ha90.fsf@gmail.com>
In reply to#8879
Joshua Maurice <joshuamaurice@gmail.com> writes:

> On Aug 15, 5:38 am, "Paul" <pchris...@yahoo.co.uk> wrote:
> [...]
>
> Please ignore Paul the troll. He's either a troll, drunk, or insane,
> etc.

Please note: this is not an exclusive OR.

[toc] | [prev] | [next] | [standalone]


#8975

From"Paul" <pchristor@yahoo.co.uk>
Date2011-08-17 12:23 +0100
Message-ID<j2g8bh$2k1c$1@adenine.netfront.net>
In reply to#8968
"Gareth Owen" <gwowen@gmail.com> wrote in message 
news:87zkj8ha90.fsf@gmail.com...
> Joshua Maurice <joshuamaurice@gmail.com> writes:
>
>> On Aug 15, 5:38 am, "Paul" <pchris...@yahoo.co.uk> wrote:
>> [...]
>>
>> Please ignore Paul the troll. He's either a troll, drunk, or insane,
>> etc.
>
> Please note: this is not an exclusive OR.

And the arseholes accuse me of insulting people.

LOL Fucking scum idiots. 


--- Posted via news://freenews.netfront.net/ - Complaints to news@netfront.net ---

[toc] | [prev] | [next] | [standalone]


#8971

FromNick Keighley <nick_keighley_nospam@hotmail.com>
Date2011-08-17 02:01 -0700
Message-ID<93fea855-83ab-44c7-bfa6-08b7e2e6c85b@k3g2000vbz.googlegroups.com>
In reply to#8852
On Aug 15, 12:18 pm, "Paul" <pchris...@yahoo.co.uk> wrote:
> "Nick Keighley" <nick_keighley_nos...@hotmail.com> wrote in message
> news:8740e3fe-8a70-4d59-bead-66ac3485b009@k3g2000vbz.googlegroups.com...
> On Aug 15, 1:09 am, "Paul" <pchris...@yahoo.co.uk> wrote:
> > "Juha Nieminen" <nos...@thanks.invalid> wrote in message
> >news:4e48109f$0$2874$7b1e8fa0@news.nbl.fi...
> > > Paul <pchris...@yahoo.co.uk> wrote:


> > >>>> 525 switch cases seem alot but how long does this take to compute,
> > >>>> assuming the very last case is the one that is true? Probably not
> > >>>> very
> > >>>> long, maybe 3 instructions per conditional test, so it might be
> > >>>> around
> > >>>> 1500 clock cycles or something.
>
> > >>> Only if the compiler was as naive as you (for a clue you should learn
> > >>> about jump tables).

NOTE WELL: "jump tables"

<snip>

> > > Please explain to us how using a jump table to implement a switch block
> > > of 525 cases could possibly take 1500 clock cycles.
>
> > I already have explained it, obviosly this is a very rough estimate
>
> --ITYM "wrong estimate"
>
> There is no "right" estimate,

something that is sufficiently non-right can be deemed to be wrong.
You are 2 or 3 /orders of magnitude/ out. When I studied physics 1
order of magnitude (a factor 10) out was generally taken to be wrong.


> a quadcore cpu  with precaching and all the
> fancy tech they have nowadays will probably do it alot faster than an
> ancient AMD cpu.

not if the quad core cpu was running your code

> So you are "wrong" to say my estimate was "wrong".
>
> > as not
> > all CPU's are the same. Can you explain how many clock cycles you think
> > it'd take?
>
> --the number taken is independent of the number of entries in the table

NOTE WELL: "the number [of clock cycles] taken is independent of the
number of entries in the table"


>  --   goto table[i];

think about how the above pseudo-code might be implemented


> --we're talking half a dozen instructions and a couple of memory
> --accesses
>
> Start Process:
> Load reg1 with comparee (Only done once at start)
>
> Load reg2 with case option
> Load reg3 with jump address
> Jump if reg1and reg2 are equal .
>
> repeat above until the condition is met.
>
> Why do you need to repeat 6 instructions ?

I don't

> And what are you talking about memeory access? L1 cache? or pipeline cache
> or prefetched queues?

in this case it doesn't really matter. I'm assuming there's no
cacheing.

> Modern CPUs have everything all prefetched into caches and its a bit more
> complicated than you seem to understand.

it's less complicated than you understand

> You can try to pretend you know more than me about it and I don't really
> care if you do or don't but when you challenge something I said as wrong and
> present "your opinion" as right, I'd suggest you get your facts right first
> and provide some kind of evidence which supports your "claim".

I suggest you think about it a bit more (and try being politer)

> Even if your opinion that it was 6x525 clock cycles ,

not my claim. Re-read my post.

> for any given CPU, was
> 100% exact then  that would make my estimate close enough to be accurate,

no

> because we are talking about cpu speeds in gigahertz now.

hence my "estimate" is in clock cycles (instructions actually)

> Please don't claim my estimates are "wrong" without providing some kind of
> reason other that "because you say so".

[toc] | [prev] | [next] | [standalone]


#8976

From"Paul" <pchristor@yahoo.co.uk>
Date2011-08-17 12:29 +0100
Message-ID<j2g8nr$2kg5$1@adenine.netfront.net>
In reply to#8971
"Nick Keighley" <nick_keighley_nospam@hotmail.com> wrote in message 
news:93fea855-83ab-44c7-bfa6-08b7e2e6c85b@k3g2000vbz.googlegroups.com...
On Aug 15, 12:18 pm, "Paul" <pchris...@yahoo.co.uk> wrote:
Snip

> because we are talking about cpu speeds in gigahertz now.

--hence my "estimate" is in clock cycles (instructions actually)

If you think you are so smart lets see the C++ and the assembly and tell me 
which compiler produced it.

You cannot do it in 6 instructions(as you say). And an instruction is not 
the same thing as a clock cycle.
So lets see the code or stfu and go have a group hug with Leigh and the rest 
of the gayboys who seem to have just leared what a jump table is.
Code in C++ please , not your own language. 


--- Posted via news://freenews.netfront.net/ - Complaints to news@netfront.net ---

[toc] | [prev] | [next] | [standalone]


#8983

FromLeigh Johnston <leigh@i42.co.uk>
Date2011-08-17 14:13 +0100
Message-ID<poWdnf4WuIgBI9bTnZ2dnUVZ8lednZ2d@giganews.com>
In reply to#8976
On 17/08/2011 12:29, Paul wrote:
>
> "Nick Keighley" <nick_keighley_nospam@hotmail.com> wrote in message
> news:93fea855-83ab-44c7-bfa6-08b7e2e6c85b@k3g2000vbz.googlegroups.com...
> On Aug 15, 12:18 pm, "Paul" <pchris...@yahoo.co.uk> wrote:
> Snip
>
>> because we are talking about cpu speeds in gigahertz now.
>
> --hence my "estimate" is in clock cycles (instructions actually)
>
> If you think you are so smart lets see the C++ and the assembly and tell
> me which compiler produced it.
>
> You cannot do it in 6 instructions(as you say). And an instruction is
> not the same thing as a clock cycle.
> So lets see the code or stfu and go have a group hug with Leigh and the
> rest of the gayboys who seem to have just leared what a jump table is.
> Code in C++ please , not your own language.

If you knew how switches are implemented you wouldn't have screamed 
about a switch with unordered cases; by "unordered" I initially assumed 
you actually meant "sparse" as the order of the cases in a switch should 
(for a decent compiler) make absolutely no difference whatsoever on how 
many cycles/instructions are required to reach the correct case; again: 
LEARN ABOUT JUMP TABLES.

HTH.

/Leigh

[toc] | [prev] | [next] | [standalone]


#8984

From"Paul" <pchristor@yahoo.co.uk>
Date2011-08-17 14:18 +0100
Message-ID<j2gfur$2pnh$1@adenine.netfront.net>
In reply to#8983
"Leigh Johnston" <leigh@i42.co.uk> wrote in message 
news:poWdnf4WuIgBI9bTnZ2dnUVZ8lednZ2d@giganews.com...
> On 17/08/2011 12:29, Paul wrote:
>>
>> "Nick Keighley" <nick_keighley_nospam@hotmail.com> wrote in message
>> news:93fea855-83ab-44c7-bfa6-08b7e2e6c85b@k3g2000vbz.googlegroups.com...
>> On Aug 15, 12:18 pm, "Paul" <pchris...@yahoo.co.uk> wrote:
>> Snip
>>
>>> because we are talking about cpu speeds in gigahertz now.
>>
>> --hence my "estimate" is in clock cycles (instructions actually)
>>
>> If you think you are so smart lets see the C++ and the assembly and tell
>> me which compiler produced it.
>>
>> You cannot do it in 6 instructions(as you say). And an instruction is
>> not the same thing as a clock cycle.
>> So lets see the code or stfu and go have a group hug with Leigh and the
>> rest of the gayboys who seem to have just leared what a jump table is.
>> Code in C++ please , not your own language.
>
> If you knew how switches are implemented you wouldn't have screamed about 
> a switch with unordered cases;

I'm not screaming  about anything , its you thats doing all the sreaming 
about jump tables.
Like its some magic thing you've just discovered. 


--- Posted via news://freenews.netfront.net/ - Complaints to news@netfront.net ---

[toc] | [prev] | [next] | [standalone]


#8986

FromLeigh Johnston <leigh@i42.co.uk>
Date2011-08-17 14:43 +0100
Message-ID<NMCdnb16n5DgWNbTnZ2dnUVZ8q-dnZ2d@giganews.com>
In reply to#8984
On 17/08/2011 14:18, Paul wrote:
>
> "Leigh Johnston" <leigh@i42.co.uk> wrote in message
> news:poWdnf4WuIgBI9bTnZ2dnUVZ8lednZ2d@giganews.com...
>> On 17/08/2011 12:29, Paul wrote:
>>>
>>> "Nick Keighley" <nick_keighley_nospam@hotmail.com> wrote in message
>>> news:93fea855-83ab-44c7-bfa6-08b7e2e6c85b@k3g2000vbz.googlegroups.com...
>>> On Aug 15, 12:18 pm, "Paul" <pchris...@yahoo.co.uk> wrote:
>>> Snip
>>>
>>>> because we are talking about cpu speeds in gigahertz now.
>>>
>>> --hence my "estimate" is in clock cycles (instructions actually)
>>>
>>> If you think you are so smart lets see the C++ and the assembly and tell
>>> me which compiler produced it.
>>>
>>> You cannot do it in 6 instructions(as you say). And an instruction is
>>> not the same thing as a clock cycle.
>>> So lets see the code or stfu and go have a group hug with Leigh and the
>>> rest of the gayboys who seem to have just leared what a jump table is.
>>> Code in C++ please , not your own language.
>>
>> If you knew how switches are implemented you wouldn't have screamed
>> about a switch with unordered cases;
>
> I'm not screaming about anything , its you thats doing all the sreaming
> about jump tables.
> Like its some magic thing you've just discovered.

*We* are telling you about jump tables because jump tables are the 
reason why your initial assertion was false.

I only just discovered jump tables?  Funny as I implemented switch 
statements in my programming language over a year ago and that 
implementation uses jump tables with binary search and even then I 
already knew about jump tables.  It is obvious that it is you who has 
only just learnt about jump tables and you are desperately trying to 
hide this fact for some reason.

/Leigh

[toc] | [prev] | [next] | [standalone]


#8987

From"Paul" <pchristor@yahoo.co.uk>
Date2011-08-17 15:23 +0100
Message-ID<j2gith$2si5$1@adenine.netfront.net>
In reply to#8986
"Leigh Johnston" <leigh@i42.co.uk> wrote in message 
news:NMCdnb16n5DgWNbTnZ2dnUVZ8q-dnZ2d@giganews.com...
> On 17/08/2011 14:18, Paul wrote:
>>
>> "Leigh Johnston" <leigh@i42.co.uk> wrote in message
>> news:poWdnf4WuIgBI9bTnZ2dnUVZ8lednZ2d@giganews.com...
>>> On 17/08/2011 12:29, Paul wrote:
>>>>
>>>> "Nick Keighley" <nick_keighley_nospam@hotmail.com> wrote in message
>>>> news:93fea855-83ab-44c7-bfa6-08b7e2e6c85b@k3g2000vbz.googlegroups.com...
>>>> On Aug 15, 12:18 pm, "Paul" <pchris...@yahoo.co.uk> wrote:
>>>> Snip
>>>>
>>>>> because we are talking about cpu speeds in gigahertz now.
>>>>
>>>> --hence my "estimate" is in clock cycles (instructions actually)
>>>>
>>>> If you think you are so smart lets see the C++ and the assembly and 
>>>> tell
>>>> me which compiler produced it.
>>>>
>>>> You cannot do it in 6 instructions(as you say). And an instruction is
>>>> not the same thing as a clock cycle.
>>>> So lets see the code or stfu and go have a group hug with Leigh and the
>>>> rest of the gayboys who seem to have just leared what a jump table is.
>>>> Code in C++ please , not your own language.
>>>
>>> If you knew how switches are implemented you wouldn't have screamed
>>> about a switch with unordered cases;
>>
>> I'm not screaming about anything , its you thats doing all the sreaming
>> about jump tables.
>> Like its some magic thing you've just discovered.
>
> *We* are telling you about jump tables because jump tables are the reason 
> why your initial assertion was false.
>
Look at your self :
"I know what a jump table is .
I know what a binary search is..
whoo hoo look at me.
I have my own scripting language..
whoo hoo I am super everyone look how great I am."

When are you going to stop pretending to be some kind of expert?
You are a proven idiot scorned and this is just another twisted 
misinterpretation of my post. I was not discussing the way a compiler 
implements/optimises a switch case at machine level code, my post was a 
philosophical view of the numbers, and how 525 may initially seem alot but 
when you think about it its not much really.

If you wanted to discuss how the switch case is implemented by the compiler 
why did you not reply to that part of this disussion?




--- Posted via news://freenews.netfront.net/ - Complaints to news@netfront.net ---

[toc] | [prev] | [next] | [standalone]


Page 5 of 6 — ← Prev page 1 2 3 4 [5] 6  Next page →

Back to top | Article view | comp.lang.c++


csiph-web