Are you, in fact, a pregnant lady who lives in the apartment next door to Superdeath's parents? - Commodore

Create an account  

 
[SPOILERS] Scooticator and Pindooter give a sporting try

(October 4th, 2013, 10:42)DaveV Wrote:
(October 4th, 2013, 10:21)NobleHelium Wrote: ++Post is more efficient, you're not doing anything else with the variable anyway.

Huh? For certain processors and compilers, maybe, but I can't believe that's true in all cases. I would expect Post++; and ++Post; to result in an identical register increment instruction.

(October 4th, 2013, 10:46)NobleHelium Wrote: The idea is that at the high level language level, the postfix requires you to store the original value in order to return it, whereas the prefix increments the value and then returns it, not necessitating an extra temporary variable. I have no idea whether that's optimized out at a lower level if the return value is unused though now that you mention it.

I've always used ++Post for the reasons Noble suggested, but now I'm curious if all modern compilers optimize that out or not. The answer has to be yes, right? +5 internet points to the person who can provide an actual source here so I don't have to google it. lol
Reply

(October 3rd, 2013, 20:37)pindicator Wrote: I moved the new worker south to finish a road, and plan on continuing him south to road towards the marble city. He's the yellow worker circled; I figure it's best to road the banana since we're going to want to have a worker on that tile anyway. The other yellow unit circled is an axe to cover the worker and settler as they'll be outside our borders a few turns.

The green is the other axe - we could send him south to cover the worker as it moves outside the borders to chop and road the 2nd gems. Or it could go east to cover the island city as we pop the hut. (Or we can build a scout i guess...)

Finally, I started a galley at the capital. We could 1-pop whip it next turn, or take 5 turns to slow-build it.

I'm not really able to login today to take a close look, so I'll just trust your judgement on the workers and whether or not to whip the galley. To make it fair, I also formally renounce my right to second-guess whatever decision you end on wink. Thanks for covering turns while I'm gone.
Reply

In Depth study part 1
In Depth study part 2
Assembly breakdown of basic operations

Results: for simple calculations (say on ints), no actual difference. For more complex objects/types, definite iterative difference.

*not white papers, so could be less than precise, but seem decently justified to me.

**The end result is that my code snippet was just as efficient as Nobles so I win so nyaa nyaa nyaa.
Reply

Nooooo! My plan to scare off all the nerds with a sports-heavy thread has backfired! cry

In other news, i need to get back into programming. Been wanting to try my hand at a more in-depth combat simulator for practicing with Python but i haven't made the time for it yet
Suffer Game Sicko
Dodo Tier Player
Reply

Well sure, if you define a custom class with the pre and post increment operators defined, then the compiler can't work it's magic. For all the compiler knows, ++CustomPost could be incrementing by two, and CustomPost++ could be writing a dissertation on Kant and posting it to reddit, so it can't see CustomPost++, notice that nothing uses the return value, and substitute ++CustomPost in it's place.

But for primitives, it's different. The compiler knows that Post++ and ++Post are equivalent where the output isn't used, and so the substitution is safe, which is what you see in the third link there where it looks at the assembly breakdown. I was actually surprised to see that it does it even without compiler optimizations, so I guess a certain amount of optimization is just taken for granted.
Reply

(October 4th, 2013, 12:54)pindicator Wrote: Nooooo! My plan to scare off all the nerds with a sports-heavy thread has backfired! cry

Ha! Don't you know the nerds are taking over sports?

[Image: lisa-sabr.jpg]
Reply

Please tell me that there are other people on RB who have NO FUCKING IDEA what just happened. I get the Simpsons pic, though. lol

Pindicator, on the one hand you want to scare off the nerds. Fair enough, as outside of Silicon Valley, the nerds scare the girls away. On the other hand, though, you want to get back into programming? Sports. Sports is the answer you were looking for. Not programming. Civ takes enough of my time, leaving me in a dank, dark room (not mom's basement).

Ok, I'm just jealous that I can't keep up with you smart computer people. Carry on. troll
Reply

Did you see some of the bullshit that happened with the Iowa State - Texas game last night? Downright shameful that was, one of those PI calls looked kinda made up, and the 1st down stand was CLEARLY a fumble before the whistle. Though it's almost worth it to make Longhorn fans suffer through more of the Mack.
Reply

(October 4th, 2013, 15:16)Boldly Going Nowhere Wrote: Please tell me that there are other people on RB who have NO FUCKING IDEA what just happened.

Nah, it's just you. neenerneener They're just babbling about salad tins to screw with you. In end user nightmare propagation support where I work there's less need for this kind of minutiae, all I have to do is decide between STUN and KILL. But the discussion was interesting anyway, thanks guys.

By the way, today's post count is probably going to have your neighbors looking for an invasion soon. lol

Played: Pitboss 18 - Kublai Khan of Germany Somalia | Pitboss 11 - De Gaulle of Byzantium | Pitboss 8 - Churchill of Portugal | PB7 - Mao of Native America | PBEM29 Greens - Mao of Babylon
Reply

(October 4th, 2013, 15:58)spacetyrantxenu Wrote: By the way, today's post count is probably going to have your neighbors looking for an invasion soon. lol

I love this tool. Thanks WilliamLP! Now we can back up our metagame-based assumptions with graphs and stuff! Data driven analysis that any middle manager, me included, can understand!

From posts/viewsOctober 1-4 there sure does look like these guys are cooking up something nasty for their neighbors...Good thing that the metagame F9 tool will let them prepare in time.

neenerneener
Reply



Forum Jump: