Is program speed less important than X?

Is program speed less important than safety? Sometimes it is – and sometimes speed is safety. A slow autopilot is a dangerous autopilot. That's why so much safety-critical software is written in the least safe programming languages.

A lot of programs aren't like autopilots – a slower, safer transaction processor is usually better. Google's early credit card charging disaster is my favorite example (it would never happen with a bounds-checked, garbage-collected language runtime).

However, there's the "counter-anecdote" of a cell phone company switching to a fancy new billing system which took more time to charge customers for calls than it took customers to make calls. It fell behind to the point where they had to avoid charging customers for a month worth of calls because they couldn't compute the right amounts. So sometimes trusting one's money to a slow program is rather unsafe.

And then there are high-frequency trading algorithms. Speaking of which: is speed less important than program correctness? Sometimes it is – and sometimes speed is correctness. A slower chess program playing under time control will settle for a worse move – a less correct move. Slower project scheduling software will come up with a worse schedule.

Life in general is a game played under time control. Often, "slower" means "being able to process less information in less ways" – in other words, dumber, further away from "correct".

What about time to market – isn't program speed less important than time to market? Sometimes it is – and sometimes higher speed is shorter time to market. A breathtaking game or special effect on today's hardware that others can only pull off on tomorrow's hardware means that the game or the special effect made it first to the market.

("Performance tricks" sound more relevant to the real-time world of games than to the offline rendering of movies; a great counter-example is procedural generation of outdoor landscape in Brave by Inigo Quilez.)

But time to market is also affected by development time; is program speed less important than development time? Sometimes it is – and sometimes higher speed is less development time. A developer waiting for slow programs develops more slowly – and developers often wait for their own programs (tools searching for stuff or summarizing stuff, build systems, tests, machine learning algorithms, …).

Another point is that a developer whose code tends to be too slow will waste time looking for a faster, fancier, buggier algorithm, sometimes sifting through many options, each of which could be fast enough if coded by someone else. A developer whose code tends to be fast the first time will move on to the next thing more quickly.

Is program speed less important than X? Sometimes it is – but sometimes speed is inseparable from X.

76 comments ↓

#1 Michael Moser on 02.14.13 at 4:59 pm

With bounds checked, garbage collected language you can't crash because a poor pointer has gone missing; you still can crash due to null reference or OutOfMemoryException ; the later gets sometimes really hard to fix/handle ; so instead one is at the mercy of a virtual machine. Is that safe?

#2 Yossi Kreinin on 02.15.13 at 12:14 am

OOM or NPE is safer than memory corruption where you charge the customer -$2.5681M because the amount you should charge was a local variable on the stack of a thread that has since returned from the function – safer by a very large margin.

#3 Chad on 02.16.13 at 6:46 am

Okay I'm going to bite.

Programmers can control the correctness, speed and also the delivery date of the product. Though the one thing that programmers miss ineptness is the culture code regarding the meaning behind correctness, robustness, and also what is a bug.

Just simply taking an American about quality vs a Japan you will get vastly different cultural code (meanings,feelings) behind the word. So one can not just simply take quality to mean one rooted thing because quality, same with correctness is a relative term.

Understandable, you can hold up different test case project and point at them saying "this is what they did wrong", and "this is how they should of done it". The truth is, there are many many decisions that need to be made during the software development life cycle. These have to be considered and weighed up by a team of technical lead for the over-all project goal and conventions. This includes (correctness, robustness), though saying that these are relative terms if you're speaking to developers at large.

Instead of focusing what went wrong, there should be more of a focus on "what decisions they did right?". Development is about wining many many small insignificant battles though the accumulation of those small battles as a whole make up the complete software package. Some problems get through, but I would say the guy from Google that made the wrong billing calculation was a awesome developer (who btw when he did find the mistake handed in his resignation that was rejected).

Some technologies do help in making you fall into the pit of success. Though they normally tend to leverage experience from people who made the small mistakes, and have collectively been put into a framework for developers. Checked and Unchecked exceptions in (.net,Java) spring to mind. Though if you find out what you're goal is from the start of the project (correctness, speed, quality) and the meaning behind those words (customers interpretation of it) then you're much more inline in delivering a product that is going to be successful.

One example is the case regarding early web browsers. There was a war on between correctness (containing all the web content before conducting a search on it) and just good unuf (ranked based algorithms). Today we know the answer to this question, though back in yahoo, alvista, or any library search query we just didn't. So the interpretation of correctness from the user and the programmers where vastly different. One wanted reliant search based query based on rank based links, vs perfect search result based on the current known state of the internet.

Sorry for my ramblings must go and feed the baby.

#4 gsg on 02.17.13 at 12:44 am

I'm surprised you didn't mention compression or video encoding, which drive the point home: a slow encoder is a *bad* encoder (since you could do a better job with a faster one, not just the same job in less time).

As for null pointers, good type systems solve that problem rather nicely by clearly separating values for which null is expected to be a possibility. Of course, few people program in the various non-mainstream languages that get that right…

#5 Yossi Kreinin on 02.17.13 at 12:54 am

Actually I'm not particularly worried about null pointers because you crash in an immediate and clear way with these. In fact I'm instinctively more worried about non-nullable types, under the assumption that someone could start passing dummy objects around and then instead of crashing programs you get programs doing dumb things and proceeding. (A sufficiently smart programmer/team wouldn't run into that of course but then they wouldn't run into NPEs, either; the question is whether nullability everywhere vs having to explicitly ask for nullability and not having it somewhere is better given the real programmers out there; I dunno.)

#6 gsg on 02.17.13 at 10:58 pm

Yeah, it's true that sometimes preventing superficial junk precipitates the formation of more insidious junk.

A nice example of this is uninitialised variables. Supposedly they are the most terrible evil thing ever, and yet you can use Valgrind to detect bugs involving their use quite handily. In contrast the more "principled" initialisation-before-use (or worse, declaration-is-default-initialisation) rules force a meaningless, error-masking assignment.

I'm not sure I buy it as an argument against programming with principled constructs though. There are too many cases where there is no good way to detect the brain damage.

#7 saurabh on 02.23.13 at 7:08 am

What is this google credit card disaster?

#8 Yossi Kreinin on 02.23.13 at 8:03 am

It's described here: http://www.flownet.com/ron/xooglers.pdf (look for "The billing disaster"). The upshot is that they had a money counter allocated at a thread's stack and they accessed the counter after the thread returned from the function.

#9 mk on 05.14.13 at 10:26 pm

"With bounds checked, garbage collected language you can't crash because a poor pointer has gone missing; you still can crash due to null reference or OutOfMemoryException ; the later gets sometimes really hard to fix/handle ; so instead one is at the mercy of a virtual machine. Is that safe?"

This is a fine example of how stupid people think. In this case, a stupid person thought of *a* way that unmanaged code can crash but managed code can't (due to dangling pointers), noticed that managed code can fail in other ways … and then promptly forgot his starting point.

It's extra stupid here because the article he's responding to is all about examples of this sort of faulty reasoning resulting from only considering those cases that support a claim while overlooking cases that don't.

#10 mk on 05.14.13 at 10:43 pm

"(or worse, declaration-is-default-initialisation) rules force a meaningless, error-masking assignment"

What a nutty and erroneous notion … that automatic initialization of all variables to the default value for their type is "error-masking" and is worse than leaving them uninitialized so that they *might* contain the default value (and often will at program startup) or any other value at all, depending on such things as the phase of the moon and the compiler version and flags. Depending on valgrind for detecting uninitialized values is a good way to lose spacecraft or kill radiation patients.

How many C++ constructors initialize everything they should? I just saw a case today where a cow orker added a pointer member to a class but didn't initialize it in the constructor. C++ (pre-11)'s moronic enforced separation of the point of declaration and the point of initialization magnifies the effects of careless incompetence severalfold.

#11 mk on 05.14.13 at 10:52 pm

"A sufficiently smart programmer/team wouldn't run into that of course but then they wouldn't run into NPEs, either"

No, that's quite false … or rather it ignores the probabilities. Virtually all programmers/teams will occasionally have NPE bugs … avoiding them takes *extraordinary* care. But it's quite easy to program in a sensible way with non-nullables, even though incompetent programmers will always find ways to screw up.

#12 MSimon on 07.30.13 at 4:19 am

Suppose you are correcting errors in real time – a PID program say. Close enough results on time is much better than perfect results late. Errors left over can be corrected in the next cycle.

The idea of the OODA loop in the battle space is the same. The perfect pilot gets beaten by the good enough one.

Or as we like to say in controls – if the process changes faster than the machine can respond you WILL get oscillations.

#13 newz aimbot on 05.15.19 at 8:20 pm

Yeah bookmaking this wasn’t a risky decision outstanding post! .

#14 Ricarda Yanda on 05.16.19 at 4:52 am

Appreciate the site– very user-friendly and tons of stuff to think about!

#15 vn hax on 05.16.19 at 1:22 pm

stays on topic and states valid points. Thank you.

#16 aimbot fortnite on 05.16.19 at 5:17 pm

I like this site because so much useful stuff on here : D.

#17 nonsense diamond key on 05.17.19 at 7:32 am

Great, bing took me stright here. thanks btw for info. Cheers!

#18 fallout 76 cheats on 05.17.19 at 10:56 am

This does interest me

#19 red dead redemption 2 digital key resale on 05.17.19 at 4:06 pm

Ni hao, here from yahoo, me enjoyng this, will come back soon.

#20 redline v3.0 on 05.17.19 at 7:11 pm

I really enjoy examining on this page , it has got cool article .

#21 chaturbate hack cheat engine 2018 on 05.18.19 at 8:37 am

Just wanna input on few general things, The website layout is perfect, the articles is very superb : D.

#22 forza horizon 4 license key on 05.18.19 at 3:27 pm

I was looking at some of your articles on this site and I believe this internet site is really instructive! Keep on posting .

#23 mining simulator 2019 on 05.19.19 at 7:30 am

Intresting, will come back here once in a while.

#24 smutstone on 05.20.19 at 12:09 pm

I consider something really special in this site.

#25 redline v3.0 on 05.21.19 at 7:40 am

I conceive you have mentioned some very interesting details , appreciate it for the post.

#26 free fire hack version unlimited diamond on 05.21.19 at 4:58 pm

This does interest me

#27 nonsense diamond on 05.22.19 at 6:49 pm

I am glad to be one of the visitors on this great website (:, appreciate it for posting .

#28 krunker aimbot on 05.23.19 at 7:08 am

Very interesting points you have remarked, appreciate it for putting up.

#29 bitcoin adder v.1.3.00 free download on 05.23.19 at 10:47 am

I conceive you have mentioned some very interesting details , appreciate it for the post.

#30 vn hax on 05.23.19 at 7:30 pm

Hey, yahoo lead me here, keep up nice work.

#31 eternity.cc v9 on 05.24.19 at 8:18 am

I am glad to be one of the visitors on this great website (:, appreciate it for posting .

#32 ispoofer pogo activate seriale on 05.24.19 at 6:50 pm

very cool post, i actually like this web site, carry on it

#33 Zachary Dibert on 05.24.19 at 10:34 pm

I'm gratified with the way that yosefk.com deals with this type of topic. Usually to the point, often contentious, always thoughtful and also thought-provoking.

#34 cheats for hempire game on 05.26.19 at 6:54 am

I really enjoy examining on this blog , it has got cool goodies .

#35 smart defrag 6.2 serial key on 05.26.19 at 4:05 pm

I must say, as a lot as I enjoyed reading what you had to say, I couldnt help but lose interest after a while.

#36 resetter epson l1110 on 05.26.19 at 6:52 pm

Great, yahoo took me stright here. thanks btw for info. Cheers!

#37 sims 4 seasons code free on 05.27.19 at 8:10 am

Deference to op , some superb selective information .

#38 rust hacks on 05.27.19 at 8:37 pm

Great, yahoo took me stright here. thanks btw for post. Cheers!

#39 how to get help in windows 10 on 05.28.19 at 5:41 pm

This is very interesting, You're a very skilled blogger.
I've joined your feed and look forward to seeking more of your magnificent post.
Also, I have shared your website in my social networks!

#40 expressvpn key on 05.28.19 at 7:56 pm

Intresting, will come back here later too.

#41 gamefly free trial on 05.29.19 at 8:29 am

Woah! I'm really digging the template/theme of this website.

It's simple, yet effective. A lot of times it's hard to get that "perfect balance" between user friendliness and visual appeal.

I must say that you've done a great job with this. Additionally, the blog loads super quick for me on Internet explorer.
Outstanding Blog!

#42 ispoofer activation key on 05.29.19 at 9:14 am

Yeah bookmaking this wasn’t a risky decision outstanding post! .

#43 redline v3.0 on 05.29.19 at 5:40 pm

I love reading through and I believe this website got some genuinely utilitarian stuff on it! .

#44 gamefly free trial on 05.30.19 at 3:46 am

Why people still make use of to read news papers when in this technological globe
all is existing on web?

#45 vn hax on 05.30.19 at 6:56 am

I am not rattling great with English but I get hold this really easygoing to read .

#46 gamefly free trial on 05.30.19 at 11:03 am

Good post however , I was wondering if you could write a litte more on this topic?
I'd be very thankful if you could elaborate a little bit more.
Cheers!

#47 xbox one mods free download on 05.31.19 at 1:28 pm

This is interesting!

#48 gamefly free trial on 05.31.19 at 2:57 pm

It's hard to come by well-informed people on this
topic, however, you sound like you know what you're talking about!

Thanks

#49 gamefly free trial on 06.01.19 at 8:58 am

Hmm is anyone else encountering problems with the pictures on this
blog loading? I'm trying to determine if its a problem on my end or if it's the blog.
Any feedback would be greatly appreciated.

#50 mpl pro on 06.01.19 at 6:55 pm

Good Morning, google lead me here, keep up good work.

#51 gamefly free trial on 06.01.19 at 9:43 pm

Very rapidly this site will be famous amid all blog people, due to it's pleasant articles or reviews

#52 hacks counter blox script on 06.02.19 at 7:04 am

I dugg some of you post as I thought they were very beneficial invaluable

#53 gamefly free trial on 06.03.19 at 7:51 pm

You should be a part of a contest for one of the most useful blogs on the
internet. I will highly recommend this blog!

#54 gamefly free trial on 06.04.19 at 8:11 pm

This paragraph provides clear idea designed for the new
people of blogging, that genuinely how to do blogging and site-building.

#55 gamefly free trial on 06.05.19 at 5:17 pm

I was suggested this blog via my cousin. I'm not sure whether this put up is written via him
as nobody else realize such distinct about my difficulty.
You're incredible! Thank you!

#56 gamefly free trial on 06.07.19 at 8:45 am

Thank you for the good writeup. It in fact was a amusement account it.
Look advanced to more added agreeable from you! By the way, how could
we communicate?

#57 Rosina Trostle on 06.08.19 at 12:54 am

6/7/2019 In my view, yosefk.com does a great job of covering subject matter of this kind! While sometimes deliberately controversial, the posts are generally well-written and thought-provoking.

#58 playstation 4 games list 2016 on 06.08.19 at 8:46 am

I have read so many articles or reviews regarding the blogger lovers but this paragraph is really a fastidious piece of writing, keep it up.

#59 Kimberli Bollie on 06.08.19 at 8:58 pm

In my view, yosefk.com does a good job of handling topics of this type. Even if often intentionally controversial, the posts are generally thoughtful and challenging.

#60 gamefly free trial 2019 coupon on 06.10.19 at 9:11 pm

Hi there! I just wanted to ask if you ever have any problems with hackers?
My last blog (wordpress) was hacked and I ended up losing a few months of hard work due to no back up.
Do you have any solutions to prevent hackers?

#61 Marylou Caroli on 06.11.19 at 7:17 pm

In my opinion, yosefk.com does a good job of handling topics of this kind. Even if frequently intentionally controversial, the material posted is generally well-written and challenging.

#62 playstation 4 best games ever made 2019 on 06.12.19 at 4:26 pm

Way cool! Some extremely valid points! I appreciate you penning this post and also the rest of the site is
also very good.

#63 playstation 4 best games ever made 2019 on 06.12.19 at 6:28 pm

My coder is trying to persuade me to move to .net from PHP.

I have always disliked the idea because of the expenses.

But he's tryiong none the less. I've been using WordPress
on a number of websites for about a year and am worried about switching to another
platform. I have heard very good things about blogengine.net.

Is there a way I can transfer all my wordpress content into it?
Any help would be really appreciated!

#64 quest bars cheap on 06.14.19 at 3:39 pm

I was able to find good information from your content.

#65 quest bars cheap on 06.15.19 at 5:37 am

Post writing is also a excitement, if you be acquainted with after that you can write if
not it is difficult to write.

#66 quest bars on 06.16.19 at 4:35 pm

Hi everyone, it's my first pay a visit at this site,
and paragraph is really fruitful in support of me, keep
up posting such posts.

#67 how to hacking fortnite on 06.17.19 at 12:17 pm

Respect to website author , some wonderful entropy.

#68 tinyurl.com on 06.17.19 at 12:36 pm

This piece of writing is truly a good one it assists new net users, who are wishing for blogging.

#69 proxo key on 06.19.19 at 1:55 pm

Yeah bookmaking this wasn’t a risky decision outstanding post! .

#70 vn hax on 06.20.19 at 10:28 pm

You got yourself a new rader.

#71 nonsense diamond key generator on 06.21.19 at 11:33 am

I like this site, because so much useful stuff on here : D.

#72 plenty of fish dating site on 06.22.19 at 1:17 am

I quite like reading an article that will make men and
women think. Also, thanks for allowing me
to comment!

#73 game of dice cheats on 06.23.19 at 8:52 pm

I like this page, useful stuff on here : D.

#74 gmod hacks on 06.24.19 at 6:48 pm

Appreciate it for this howling post, I am glad I observed this internet site on yahoo.

#75 geometry dash 2.11 download on 06.25.19 at 11:31 pm

I like this site because so much useful stuff on here : D.

#76 krunker aimbot on 06.26.19 at 9:59 am

I must say, as a lot as I enjoyed reading what you had to say, I couldnt help but lose interest after a while.

Leave a Comment