News for hackers. Stuff that matters.
Re:E-waste mining could be big business and good for the planet by bb88 on Friday July 06, 2018 @06:06PM (#17475476)
From that argument, we should be coding everything in hand tuned assembly, because hand tuned assembly gives a 10% to 200% speedup over C.

The number one slowdown I've seen in rendering web pages, were not bad algorithms or bad programming languages, but bad database queries.

And if that's the case, there is a lot more optimization in the DB to be gained than rewriting your back-end to C, say.

Re:E-waste mining could be big business and good for the planet by pcwalton on Friday July 06, 2018 @11:24PM (#17476791)
> From that argument, we should be coding everything in hand tuned assembly, because hand tuned assembly gives a 10% to 200% speedup over C.

Yes, all things equal, it's better to write faster CPU-bound code. In a world in which writing optimal machine code all the time was possible without sacrificing anything else important, then we would always want to do it. This is hardly a controversial conclusion.

The reason we don't write faster CPU-bound code is that, in the world we live in, all things are never equal. Correctness, security, maintainability, development velocity, portability, engineering culture/trends, and so on are usually more important than raw CPU performance.

Re:E-waste mining could be big business and good for the planet by kragen on Saturday July 07, 2018 @02:57AM (#17477436)
This was true in 1995, assuming you can spend unlimited time writing your code. You can almost certainly get an order of magnitude better performance with a custom backend written in a low-level language instead of a SQL database. And, I don't know if you've ever used a SQL database written in Python instead of C, but I have, and it's definitely a lot slower.

But it's not true today, because today hand-tuned assembly is slow compared to what you can do on the GPU or an FPGA or a TPU.

And, of course, it's not true that you should do this if you can't spend unlimited time writing your code. It's entirely reasonable to use slower languages like Python and JS if you can hack faster as a result. Since many of us are taking that entirely reasonable option, the number of CPU cycles needed to run basic applications is going up, which increases power consumption.

Re:E-waste mining could be big business and good for the planet by bb88 on Saturday July 07, 2018 @04:22PM (#17480360)
> And, I don't know if you've ever used a SQL database written in Python instead of C, but I have, and it's definitely a lot slower.

I don't doubt that but on today's web stacks you use either MySQL or Postgres typically and both those are written in C.

Yes, you can create your own DB written in a low level language, but you'll be hitting the same issues that the DB solves for you (indexing upon insertions, query optimizations, transactional operations, etc).

Re:E-waste mining could be big business and good for the planet by littlestymaar on Saturday July 07, 2018 @04:44AM (#17477699)
> But it's not true today, because today hand-tuned assembly is slow compared to what you can do on the GPU or an FPGA or a TPU.

That's not how thing work. GPUs/TPUs aren't magic, they don't speed everything up: they are really good is some scenario, but they are really slow in many others: the cost of loading memory to the GPU and back from it has a huge cost and it's only worth it if the GPU has enough work to do with the workload.

In theory, you could write a web server that runs on the GPU (at least a majority of it, it will still need some CPU work obviously), but it would be incredibly slow, probably slower than if it was a regular web server running on a machine from the 90s.

FPGA are totally different beasts, you can theoretically speed up anything with them, but

1. that requires a LOT of work, and

2. they aren't new: anything you can do with FPGA today, you could do it in 1995 already.