Efficient idiom for fastest code

biocyberman biocyberman at gmail.com
Thu May 24 08:46:00 UTC 2018


On Wednesday, 23 May 2018 at 03:12:52 UTC, IntegratedDimensions 
wrote:
> On Wednesday, 23 May 2018 at 03:00:17 UTC, Nicholas Wilson 
> wrote:
>> [...]
>
> I knew someone was going to say that and I forgot to say DON'T!
>
> Saying to profile when I clearly said these ARE cases where 
> they are slow is just moronic. Please don't use default answers 
> to arguments.
>
> This was a general question about cases on how to attack a 
> problem WHEN profiling says I need to optimize. Your SO 101 
> answer sucks! Sorry!
>
> To prove to you that your answer is invalid:
>
> I profile my code, it says that it is very slow and shows that 
> it is do to the decision checking... I then I have to come here 
> and write up a post trying to explain how to solve the problem. 
> I then get a post telling me I should profile. I then respond I 
> did profile and that this is my problem. A lot of wasted energy 
> when it is better to know a general attack strategy. Yes, some 
> of us can judge if code is needed to be optimized before 
> profiling. It is not difficult. Giving a generic answer that 
> always does not apply and is obvious to anyone trying to do 
> optimization is not helpful. Everyone today pretty must does 
> not even optimize code anymore... this isn't 1979. It's not ok 
> to keep repeating the same mantra. I guess we should turn this 
> in to a meme?
>
> The reason I'm getting on to you is that the "profile before 
> optimization" sounds a bit grade school, specially since I 
> wasn't talking anything about profiling but a general 
> programming pattern speed up code, which is always valid but 
> not always useful(and hence that is when profiling comes in).

Very challenging. Wish I could help you out with the tough work. 
People don't share the same context, especially via online, so it 
is necessary to clarify the  problem so other can understand and 
help. I've been beaten on stackoverflow many times for not 
providing sufficient information for my questions. It seems like 
one can do the reverse here at forum.dlang.org.

With that said, I think you know what you are doing, and you can 
do it. Just relax and give it more time and experimentation.


More information about the Digitalmars-d-learn mailing list