News for hackers. Stuff that matters.
Re:DRAM Prices in ‘Freefall’ by ktpsns on Thursday March 07, 2019 @02:40PM (#19331439)
A concept a High Performance Computing professor told me once: A program which is memory intensive must be slower then one which needs little memory -- just because load/write operations from the CPU take time.

That's one of the reasons why some bloated contemporary desktop software (i.e. Slack) feels as fast as its historic counterpart did in 1995 (i.e. our MSN/ICQ clients back in these days).

Re:DRAM Prices in ‘Freefall’ by fwip on Thursday March 07, 2019 @02:45PM (#19331510)
That's a nice sound bite, but isn't really true. There are many cases where we increase memory usage for faster software.

Side note, lessons from HPC aren't really that applicable for chat programs.

Re:DRAM Prices in ‘Freefall’ by NullPrefix on Thursday March 07, 2019 @03:11PM (#19331820)
>we increase memory usage for faster software.

We increase memory usage for faster software development.

Re:DRAM Prices in ‘Freefall’ by larrik on Thursday March 07, 2019 @04:44PM (#19332802)
No, lots of algorithms and data structures use more space to provide more speed. It's not simple laziness.
Re:DRAM Prices in ‘Freefall’ by tonyarkles on Friday March 08, 2019 @01:41AM (#19335621)
I don’t think that’s what Slack is doing here though :)

I’m totally with you for things that are actually doing serious numeric/algorithmic work. Matrix inversion runs a helluva lot faster when the whole matrix fits in RAM. And there are undoubtedly lots of places where you can use different algorithms for the same problem that can trade off memory usage and computational complexity.

Re:DRAM Prices in ‘Freefall’ by fuzz4lyfe on Friday March 08, 2019 @11:17AM (#19338888)
It does happen obviously: https://en.wikipedia.org/wiki/Space%E2%80%93time_tradeoff

But yes, running another browser + javascript interpreter on a machine that already has a browser + javascript interpreter running isn't what that article is talking about.

Re:DRAM Prices in ‘Freefall’ by FullyFunctional on Friday March 08, 2019 @12:10AM (#19335268)
Constraint solvers comes to mind. It's pretty much the most memory hungry application I can think of, though some of the VLSA EDA tools need triple digit GBs of memory to do anything.
Re:DRAM Prices in ‘Freefall’ by jsharf on Thursday March 07, 2019 @05:57PM (#19333478)
You can also increase memory usage for faster software, as is the case with memoization and lookup tables.
Re:DRAM Prices in ‘Freefall’ by vvanders on Thursday March 07, 2019 @03:07PM (#19331771)
Conversely cache misses are painful and largely haven't gotten faster over the years.
Re:DRAM Prices in ‘Freefall’ by mbreese on Thursday March 07, 2019 @03:19PM (#19331899)
Exactly. And the reason why programs that use a lot of memory might feel slower than one with a little is that cache miss rate.

Adding memory often makes an entire system faster (again, because you can cache things in the faster RAM rather than paging out to disk). But for two comparable programs, I could see the argument that the lower-memory footprint program would be faster. (For comparable programs).

Re:DRAM Prices in ‘Freefall’ by fwip on Thursday March 07, 2019 @04:08PM (#19332456)
If the algorithms are otherwise identical, sure.

Often the memory being used is doing things like pre-loading information from disk or the network before it's needed, or caching results for reuse.

Or it's storing the information in a faster but less dense data structure - kind of like denormalizing a database for performance reasons.

Re:DRAM Prices in ‘Freefall’ by vvanders on Thursday March 07, 2019 @03:39PM (#19332112)
Yup, as DDR clock speed increased so have CAS timings.
Re:DRAM Prices in ‘Freefall’ by segfaultbuserr on Thursday March 07, 2019 @04:13PM (#19332508)
It's a serious problem in compiler optimization. In the ideal world, a program with loop unrolling and vectorization should always be faster, but in practice, the bigger binary size induces cache misses and may produce a slower problem. Time goes by, and compilers keep adding increasingly complex techniques based on space/time tradeoffs, making the problem trickier.

Historically, under some circumstances, a problem compiled with -Os, may paradoxically be faster than -O2, and -O2 may be faster than -O3. I think the situation is getting better now, and the optimizing level mostly works as advertised. But there's still some problems in automatic loop vectorization.

Re:DRAM Prices in ‘Freefall’ by 0815test on Thursday March 07, 2019 @08:10PM (#19334275)
> In the ideal world, a program with loop unrolling and vectorization should always be faster, but in practice, the bigger binary size induces cache misses and may produce a slower problem.

The solution is to use abstract, arbitrary vectors in the ISA instead of packed SIMD and unrolled loops. RISC-V gets this right with their V extension.

Re:DRAM Prices in ‘Freefall’ by greglindahl on Thursday March 07, 2019 @08:23PM (#19334339)
There are many different kinds of loop unrolling, and RISC-V's V extension is not the only one. Itanium had the same issue: the loop unrolling assist in the instruction set was not viewed by many compiler people as being sufficient.
Re:DRAM Prices in ‘Freefall’ by colejohnson66 on Friday March 08, 2019 @03:15PM (#19341746)
ForwardCom has abitrary length vector support. http://www.forwardcom.info/ https://news.ycombinator.com/item?id=19340267
Re:DRAM Prices in ‘Freefall’ by greglindahl on Thursday March 07, 2019 @08:07PM (#19334262)
What's the paradox? The compiler simply can't tell.
Re:DRAM Prices in ‘Freefall’ by cbhl on Thursday March 07, 2019 @04:37PM (#19332732)
Reading from RAM is certainly faster than disk, but reading less is faster than reading either from RAM or from disk.

Chrome is a big application that tries to be everything for all people. If Desktop performance mattered to companies, folks would strip out the browser and use native components. (This is literally React Native on mobile, even if programmers are still mostly writing in JavaScript instead of C++ or Objective C or Swift.)

Re:DRAM Prices in ‘Freefall’ by larrik on Thursday March 07, 2019 @04:44PM (#19332791)
> Reading from RAM is certainly faster than disk, but reading less is faster than reading either from RAM or from disk.

This is just not true in a lot of ways.

For example, you can use memory to store the same data in multiple ways, and then you get blistering fast access, whereas if you only store it in a single way, you may get a range of read performance between "as good" to "really really bad".

I understand why what you said sounds true, but it's not that simple at all.

Re:DRAM Prices in ‘Freefall’ by cbhl on Friday March 08, 2019 @12:34AM (#19335378)
Yes, you're right. In hindsight, I wish I could delete that first sentence -- there are obvious counter-examples (ray tracing / movie rendering, search engines, memoization, dynamic programming).
Re:DRAM Prices in ‘Freefall’ by inetknght on Thursday March 07, 2019 @03:03PM (#19331729)
Faster, or perhaps more features.
Re:DRAM Prices in ‘Freefall’ by SimonPStevens on Thursday March 07, 2019 @03:12PM (#19331831)
I just don't think this is true.

A very common tradeoff we make is to cache the results of time consuming calculations in memory, or even cache raw data in memory to avoid database calls. Both of these techniques increase memory usage, but improve performance.

Re:DRAM Prices in ‘Freefall’ by Narishma on Friday March 08, 2019 @03:33AM (#19336014)
That depends on how expensive those calculations are relative to memory access. CPUs are very fast at doing a ton of math but very slow at reading or writing to random memory.
Re:DRAM Prices in ‘Freefall’ by SimonPStevens on Saturday March 09, 2019 @03:47PM (#19348381)
Yes, of course, but my point wasn't that if you cache all results your software will be faster. My point is just that it is possible to write code that consumes more memory, and runs faster under some circumstances, which refutes the ops claim that all software that uses more memory is slower.
Re:DRAM Prices in ‘Freefall’ by dagw on Friday March 08, 2019 @07:22AM (#19336912)
A program which is memory intensive must be slower then one which needs little memory -- just because load/write operations from the CPU take time.

Not if the alternative to reading/writing from RAM is reading writing from disk. One piece of data processing software I used to use had its roots in the early 80s and was very memory efficient. It achieved this by rewriting the input data to disk in a clever way and the reading and writing just the parts it need. I could process gigs of data using only a couple of hundred MBs of RAM. A different, more modern, program I also used would slurp in as much data as it could fit in RAM and then just go from there. It would happily use 30 of the 32 GB or RAM I had every time it ran, but it was also 1-2 orders of magnitude faster.

Re:DRAM Prices in ‘Freefall’ by CyberDildonics on Thursday March 07, 2019 @08:02PM (#19334246)
ICQ was much faster on a 150mhz pentium than slack is on a modern computer today.
Re:DRAM Prices in ‘Freefall’ by AlisdairO on Thursday March 07, 2019 @05:54PM (#19333463)
If they're algorithmically the same, that's true, otherwise not. Caching computations takes space, but can drastically speed up runtime performance.
Re:DRAM Prices in ‘Freefall’ by outworlder on Thursday March 07, 2019 @03:44PM (#19332172)
> A concept a High Performance Computing professor told me once: A program which is memory intensive must be slower then one which needs little memory -- just because load/write operations from the CPU take time.

Hi, there's this guy named 'cache' that wants to speak with you.