Performance of tables slower than built in?

Alex AJ at gmail.com
Fri May 24 12:05:16 UTC 2019


On Friday, 24 May 2019 at 11:57:44 UTC, Alex wrote:
> On Friday, 24 May 2019 at 08:13:00 UTC, Basilez B. wrote:
>> On Thursday, 23 May 2019 at 10:16:42 UTC, Alex wrote:
>>> On Wednesday, 22 May 2019 at 08:25:58 UTC, Basile B. wrote:
>>>> On Wednesday, 22 May 2019 at 00:22:09 UTC, JS wrote:
>>>>> I am trying to create some fast sin, sinc, and exponential 
>>>>> routines to speed up some code by using tables... but it 
>>>>> seems it's slower than the function itself?!?
>>>>>
>>>>> [...]
>>>>
>>>> Hi, lookup tables ARE faster but the problem you have here, 
>>>> and I'm surprised that nobody noticed it so far, is that 
>>>> YOUR SWITCH LEADS TO A RUNTIME STRING COMPARISON AT RUNTIME. 
>>>> Just replace it with a static if (Method = "Linear") { 
>>>> /*...*/} else { /*...*/}
>>>>
>>>> Also takes care to the type used. With DMD the implicit 
>>>> coercion of float and double can lead to extra conversions.
>>>>
>>>> You'll directly see a 15% gain after refactoring the switch.
>>>
>>> Surely not?!?! Surely the compiler can optimize that switch 
>>> since the value passed is CT? I thought the whole point of 
>>> not having static switch(analogous to static if) was because 
>>> it would go ahead and optimize these cases for us... and it's 
>>> just a switch, just a jmp table.
>>
>> Try by yourself but to be clear note that I don't like your 
>> attitude, which I find disrespectful.
>
> Are you an idiot or on medications? My attitude? What did you 
> want me to do? Suck your cock? My attitude? Seriously? WHERE? 
> WHERE? You quoted everything?
>
> I don't like your attitude? You seem to be extremely 
> oversensitive and take things out of context?
>
> It sounds like you just don't like people questioning you in 
> any way shape or form even if you are wrong.
>
> "Surely not?!?! Surely the compiler can optimize that switch
> since the value passed is CT? I thought the whole point of not
> having static switch(analogous to static if) was because it
> would go ahead and optimize these cases for us... and it's
> just a switch, just a jmp table."
>
> Where? I seriously do not like your attitude though! You attack 
> me when I said nothing offensive to you. You have serious 
> problems. Get back on or get off the lithium.
>
> [Now, of course, you get to see what an attitude really looks 
> like... maybe I've taught you a bit about perspective? I doubt 
> it.]

What amazes me is that you Basilez come in and start stuff and 
yet my response to you starting stuff will get deleted and yours 
won't... that is typical.

You really have mental issues. No where in my post was I hostile 
to you and yet you decided to have a hissy fit.  You are a 
snowflake that obviously need a ass kicking. That will teach you 
not to be so sensitive and interpret things in your own little 
cushioned wall universe.

See, no one was attacking you or questioning your intelligence... 
that is something you perceived and made up all on your own. But 
you will be supported by all the other people who love cushy 
walls and koolaid rather than getting the help you need.




More information about the Digitalmars-d-learn mailing list