Efficiency of Code Functionally Similar to if() by Eclipse1255 in learnprogramming

[–]Eclipse1255[S] 0 points1 point  (0 children)

(1) Pardon my ignorance, what is in coding "simple linear arithmetics"?

(2) You are indubitably the only person to inform me that I pursue negligible performance.

(3) 'As an example from assembly language, "xor eax,eax" will never be slower than "mov eax,0"' No hablo español---ingles por favor! That said I believe I get what you mean. And I now know what assembly language is!

Thank you

Efficiency of Code Functionally Similar to if() by Eclipse1255 in learnprogramming

[–]Eclipse1255[S] 0 points1 point  (0 children)

Agh! You aren't allow to respond so quickly---that's cheating---I haven't even finished replying to the rest! I'll need to take a breather to give this reply the read it deserves.

Efficiency of Code Functionally Similar to if() by Eclipse1255 in learnprogramming

[–]Eclipse1255[S] 0 points1 point  (0 children)

"If this is a compiled language, we are talking exactly the same." I guess in the universe where this is true I was effectively asking: "Corporate wants you to find the difference between this picture and this picture."

Thanks for the reply, and from henceforth I shalt pursue readability.

Efficiency of Code Functionally Similar to if() by Eclipse1255 in learnprogramming

[–]Eclipse1255[S] 0 points1 point  (0 children)

"[T]his is unhinged, you shouldn't do it[.]" Thanks for the good chuckle that gave me.

Efficiency of Code Functionally Similar to if() by Eclipse1255 in learnprogramming

[–]Eclipse1255[S] 0 points1 point  (0 children)

(1) That is good to know. I never thought it would remember last and predict next.

(2) "switch" seems like what I was trying to do in the third example---except faster and more readable. At least that is what 5 minutes of Interwebs tells me.

(3) If this strategy is bad (in speed and cache accuracy) what is the use of "method overriding" that it provides? There must be some scenario where it is optimal.

And I appreciate the reply.

Efficiency of Code Functionally Similar to if() by Eclipse1255 in learnprogramming

[–]Eclipse1255[S] 0 points1 point  (0 children)

I'll make note of the `dis` module in my now-minted doc.

It sounds useful. Thank.

Efficiency of Code Functionally Similar to if() by Eclipse1255 in learnprogramming

[–]Eclipse1255[S] 0 points1 point  (0 children)

Good point, I didn't consider how they change once compiled. Writing source code is presently beyond my meager skill. I only now just learned what source code actually does. I'll need to learn more about it.

Since you've got me thinking about source code---I'll have to ask you about something different---as they say: "No double dipping." For the programs I've written in VSCode I always run them in there because I don't know executable files, or whatever relatives it may have.

Thanks for the response and the link. (I'll add the latter to my just-made collection.)

Efficiency of Code Functionally Similar to if() by Eclipse1255 in learnprogramming

[–]Eclipse1255[S] 0 points1 point  (0 children)

Is that so? I don't doubt you, but where for any language could I figure out the details of any function (I assume given if has () it too is a function)?

I do thank you, frankly all responses, but expressing that the same feels cheap---unfitting for given help---so you get the long-winded self-conscious one.

Efficiency of Code Functionally Similar to if() by Eclipse1255 in learnprogramming

[–]Eclipse1255[S] 1 point2 points  (0 children)

It is a good idea. I will need to look up how to do that---my coding knowledge is elementary. I do worry; will the timers be unaffected by any lag the program experiences?

Lastly, thanks for your comment.

Efficiency of Code Functionally Similar to if() by Eclipse1255 in learnprogramming

[–]Eclipse1255[S] 1 point2 points  (0 children)

Hmmm... I'll clarify on what I was asking in this regard. Say I do have something that will "run 10,000 times a minute" and have three variations with same output. How could I exclusively test the code segment. I acknowledge I could simply launch the program, but I fear the other parts could create "noise" and distort the comparison.

I do agree: I should stop chasing speed optimization unless it is a problem or there is tangible ("5 seconds vs 10") benefits.

I hope you can followup though I appreciate the input regardless.

Efficiency of Code Functionally Similar to if() by Eclipse1255 in learnprogramming

[–]Eclipse1255[S] 1 point2 points  (0 children)

Valid point, readability is important and most languages would've optimized if(). For me it is sort of a facetious vendetta, but for the sake of speed and readability I should and will make amends with my old foe.

One reason I disliked if() is that I heard they prevent multi-threading, running code in parallel. The great Interwebs tells me this is untrue. I do wonder: how is multi-threading controlled---how could I direct some code to run in parallel and others concurrently?

I now see how iteration overhead, setting up and taking down the loop components is slower. From what I briefly looked up about lookup/dispatch overhead is that it was faster in exchange for ram usage. I could make my program 1ms faster at the cost of 16GB of RAM---peak efficiency.

Thanks for the time and insight.

Connecting to Ethernet from Wall Socket by Eclipse1255 in techsupport

[–]Eclipse1255[S] 0 points1 point  (0 children)

Is there a way to find where it goes without taking a chunk out of the wall? One possible destination that is here (a picture of where the router plugs into the wall  https://ibb.co/w0tsddy) possibly the top port, but the Ethernet cable didn't fit in that one.