r/programming • • Dec 15 '18

The Best Programming Advice I Ever Got (2012)

http://russolsen.com/articles/2012/08/09/the-best-programming-advice-i-ever-got.html
1.7k Upvotes

313 comments sorted by

View all comments

0

u/[deleted] Dec 15 '18

[deleted]

206

u/mindbleach Dec 15 '18

Which is an interesting end goal, but it was built on the lie that local performance and remote performance were the same. On "thin" systems that cost an order of magnitude less, local performance would be no slower.

0

u/[deleted] Dec 15 '18

[deleted]

→ More replies (4)

12

u/eyal0 Dec 15 '18

Those "thin" systems weren't cost effective for very long. If your plan was to design for weak desktops, your plan started to look crappy already in the 80s.

→ More replies (2)

127

u/auxiliary-character Dec 15 '18

Problem is it turns out the bottleneck in performance appears to be in the socket transfer, not the rendering back end. Taking it off the client workstation to put it on a more powerful rendering server would reduce performance, since the network layer would stressed to an even greater extent than with a local connection.

15

u/istarian Dec 15 '18

It might have been useful in the future, if sockets improved, to keep the heavy lifting off the remote end...

14

u/Slime0 Dec 15 '18

"Might be useful in the future" is a bad method of prioritization.

In any case it seems like if the networked version was actually a good idea in the long run, the people pushing for it should have been angry with the management that couldn't understand that, instead of the guy who took something that was actually bad and made it actually good.

→ More replies (1)
→ More replies (22)
→ More replies (1)

0

u/[deleted] Dec 15 '18

[deleted]

61

u/ikeif Dec 15 '18

That’s every enterprise approach.

“You sold us a shitty thing”

“Sorry, that was the person before me, and that software got acquired, our new version is fully integrated!”

(Okay, not fully integrated, but maybe by the time you get around to implementing, it will be partially integrated!)

That shit is a mess from top to bottom.

24

u/TizardPaperclip Dec 15 '18

" ... peaking at our code!"

I can just imagine the effort required to take drugs in advance at exactly the right moment for the high to hit them precisely at the same moment as they're looking at the code.

→ More replies (1)

17

u/[deleted] Dec 15 '18

Not sure if anyone mentioned this already, but the guy could have restructured the code in a way where the communication between the two modules can be easily changed (e.g. DI or similar design) so that while they are still shipping everything as a local only product it can run quickly using the guys efficient local communication. When they eventually develop the server side they can just switch out the communication mode or even make it an option within the client application. You can have your cake and eat it too.

→ More replies (5)

44

u/warlaan Dec 15 '18

It's a bit hard to believe that this was the only issue. I mean what kind of data was sent through the network and what did the protocol look like when "a simple drawing took tens of seconds"? If the resulting image was transferred as an image its complexity should not affect the time it took to transfer it, at least not that much. And given that CAD graphics were basically vector graphics (at least as far as I know) I wouldn't know how to spend tens of seconds on transferring data for a simple drawing.

36

u/[deleted] Dec 15 '18

[removed] — view removed comment

8

u/istarian Dec 15 '18

I imagine there's a degree of difference between shifting an entire image (especially a full normal) and just the necessary pieces to draw the vectors though. Especially when the image gets more complex.

→ More replies (2)
→ More replies (3)

13

u/krista_ Dec 15 '18

consider back at that time, single core single socket cpus were the norm, along with < 2mb ram and a 80-120mb hdd.

tcp/ip was in its infancy in the industry, so this was likely an ipx/novell stack running in extended memory.

oh, and cpus had, at best, very primitive context switching and vmm hardware. if you were very lucky, you'd have a 25mhz machine. and no gpu acceleration, or even a local bus for the vga card

if you take a look at the demo scene from back then, these machines were surprisingly capable... there just simply wasn't any room for fancy architecture or ”acedemically correct” ways of doing things.

18

u/warlaan Dec 15 '18

Both you and DrBroomkin are missing my point.

The article states that without the pseudo-network traffic the simple image would draw more or less instantly, so I'd say up to maybe 200ms. Without it they took "tens of seconds", so I'd say upwards of 20s. That's a factor of 100.

It also states that drawing something complicated took "one sip of coffee" without and was "an opportunity to get coffee" with the network code, so maybe from 3s to 5min, which again would be a factor of 100.

That's why I am wondering what kind of data was sent back and forth between the two sides. I would imagine that you would typically send some kind of command list to the rendering system and get back some kind of buffer with result data.

The rendering and the display is performed on the same machine in both cases, so where does the additional workload come from?
It's easy to imagine that such a workload would pile up if every single draw call is sent as a single package so that the overhead would be proportional to the number of rendering steps, but I have a hard time imagining that a computer would spend 99 times as much time copying data through a virtual network as it spent rendering it.

Again, switching contexts, accessing memory, finishing a rendering step, acquiring the next package, parsing it etc. - if all of that happens for very fine-grained steps then it's easy to imagine, but that's why I said that it was hard to imagine that the mere concept of using a virtual network was the only issue here.

And by the way the fact that these machines didn't have gpu acceleration doesn't explain the issue, it makes it even harder to explain, because we are talking about the network overhead in relation to the rendering performance. How do you spend 99% of a frame in network code when the rendering is performed on the CPU?

8

u/kabekew Dec 16 '18

He may have simply fixed a bug in the process of removing the networking part, e.g. shitty error handling. I remember seeing production code in the 90's that handled a send-buffer overflow error with sleep(10000) and the comment "should be enough to let it clear out -- this should never happen anyway" except it was happening constantly. It worked, but nobody knew why it was so slow and assumed that's just how it is.

→ More replies (5)
→ More replies (1)
→ More replies (3)

49

u/kankyo Dec 15 '18

That is a terrible explanation. This dude was absolutely right to screw those plans over.

30

u/frezik Dec 15 '18

Maybe, maybe not. We live at a time where it's easy to see how the network transparency of the X Windowing System was unnecessary. Thin clients were only viable in a short time frame, when the processor needed to run the software was expensive, and a processor to run a screen, keyboard, and mouse was cheap.

It wasn't until much later that everyone filed it into "seemed like a good idea at the time".

28

u/kankyo Dec 15 '18

Except that this is a clear example of where you didn't need hindsight of many years later while the drawbacks where clear directly.

→ More replies (2)
→ More replies (1)
→ More replies (10)

7

u/wonkifier Dec 15 '18

I'm curious how throughout the whole ordeal the explanation never came up.

He never talked to anyone else that had a clue? Nobody was aware of the technical goals (whether good ideas or not), or the political issues?

19

u/causa-sui Dec 15 '18

I read about this before.

Can you say where? I'd like to read what you read.

→ More replies (3)