News for hackers. Stuff that matters.
Re:Efficient music players remain elusive by jnordwick on Monday June 26, 2017 @03:57AM (#14634888)
The dirty secret in software development: most think they how to write efficient software when they need to, but very few can.

Sometimes the excuse is that cpu and memory are cheap as if resources aren't under constant pressure from the hundreds of processes that all pretend they are the only one on the machine.

Many also don't know how to draw simple, low-overhead abstraction boundaries. Everybody wants to make the most generic code planning for things that will never happen or at least not in the way they think. You can't call out most people on this because this one piece of code they are working on is always the exception.

And most developers don't know how to optimize as they write code. They often don't understand the problem or have enough mechanical sympathy to understand what code you should probably be careful with and should be made quick to start off with. They probably don't understand the cache system enough to know why that linked hash table is probably the wrong data structure. Hash means fast to them, and to them this is all premature optimization even when the correct solution is probably no more difficult than what they are doing. Calling something premature optimization is often used to shut down discussion of how their code can be improved.

The field is too in love with horribly inefficient frameworks. Writing network code and protocols is now considered too low level for people. Many are too caught up it what is tech-cool. They're like the holistic medicine practitioners of software and they don't even know it.

Re:Efficient music players remain elusive by GuB-42 on Monday June 26, 2017 @05:01AM (#14635184)
If you ask developers to write efficient code and give them the means to do it, they will write efficient code.

But unless they work in embedded software, this is rarely a priority. In fact, this tends to be actively discouraged : in the good shops, reliability, robustness and security is the goal, in bad shops, that's bullet-point features and meeting unrealistic deadlines.

To get an idea of how optimization is poorly regarded, look no further than the infamous Heartbleed exploit of OpenSSL. One of the contributing factor for this bug was that the team used a custom memory allocator for performance reasons. After the bug was discovered, the team was actually blamed for it more than anything else that lead to the bug. And FYI, it was a real performance improvement, at least on some platforms.

Re:Efficient music players remain elusive by sclangdon on Monday June 26, 2017 @07:00AM (#14635764)
You seem to be under the impression that writing efficient code is at odds with writing reliable or robust code. Efficient does not mean unsafe. Efficient code does not have to shoot-from-the-hip. Efficiency means that the task is completed with the minimum wasted effort. To assume that you cannot have relieable code that is also efficient is absurd.

If reliability is the top priority for your project, it just means you factor that in to your optimizations. It doesn't mean you just ignore efficiency and write any old shit, as seems to be the custom today.

Your OpenSSL example seems to suggest the Heartbleed exploit was a result of developers daring to write performant code, and not that they simply wrote buggy or insecure code, performant or not.

Re:Efficient music players remain elusive by TeMPOraL on Monday June 26, 2017 @09:48AM (#14636740)
I feel the problem here is what I imagine as this formula:

  reliability * efficiency = developer skill
I.e. for a given level of reliability, you need more skilled[0] developers to be able to write efficient code. And I'm not thinking about premature optimizations here - just that the code an experienced developer will write the first time around will be efficient enough.

So in short, if you aim for certain level of reliability and employ cheap/unskilled developers, efficiency will suffer. And as long as companies don't really care about performance, developers will not gain the necessary experience to write efficient code with just-in-time optimizations.

--

[0] - for "skilled" meaning probably mostly some knowledge and experience in writing fast code; it's probably not the experience you'll get when all coding you've ever done is for the web.

Re:Efficient music players remain elusive by Brockenstein on Monday June 26, 2017 @11:22AM (#14637487)
I think he's referring to the pressures to produce working solutions. And there's a whole laundry list of attributes people attach to that process. And everyone has the opinion that they're ideals represent the best/most important subset of all the possibilities and/or that you should just meet them all or go work at McDonalds.

You can certainly write efficient code, that's reliable and robust and secure given the time and resources to do so. It usually comes down to money, and how no matter how efficient or high minded you are, crafting the optimal solution takes more time and resources. IE more money. If you can sell users and clients on the extra costs, great. Otherwise you need to figure out what you can do, with the time and resources you have, that will sufficiently satisfy your customers.

And yeah, the problem is with the gobs of resources available on modern computers writing efficient code matters less because most users aren't going to care if their music player is using 1% of the CPU or 10% of the CPU.

Of course I say that with the annoying exception I've experienced where the custom MP3 player in GTA V requires a relatively huge amount of resources and will easily reduce performance by 10-20FPS even on an overclocked i5.

Re:Efficient music players remain elusive by BearGoesChirp on Monday June 26, 2017 @12:16PM (#14637894)
>You seem to be under the impression that writing efficient code is at odds with writing reliable or robust code.

For a given amount of resources invested it is. From a business perspective this includes not just the time a developer spends on a given piece of code, but how good a developer one is willing to pay to work on the code. Perhaps those making the business decisions overestimate the cost of writing more efficient code and underestimate the costs of not writing more efficient code, but they there is a cost that will be taken into account.

Re:Efficient music players remain elusive by aninhumer on Monday June 26, 2017 @10:13AM (#14636922)
>To assume that you cannot have relieable code that is also efficient is absurd.

Of course you can, but often it takes more time (or more expensive developers) than inefficient code, and the people paying the bill don't necessarily benefit from the efficiency.

Re:Efficient music players remain elusive by taeric on Monday June 26, 2017 @12:11PM (#14637861)
I want to believe this. Evidence shows that people tend to grow their problem so that they are attempting to solve the problem of writing software with every other developer. Hence the rise of frameworks.

Sometimes, people get a knock out and do a good job. Bootstrap was seen that way for a while. (I've not heard much of it lately, so assuming it has waned in popularity?) By and large though, we all have different requirements for development. And none of them are shared by the customers/users of our software.

Re:Efficient music players remain elusive by mattgreenrocks on Monday June 26, 2017 @02:51PM (#14639251)
There's also this weird collectivist thing going on with software development, where not using frameworks is looked down upon. Or rather, frameworks are considered a best practice without taking project requirements into consideration. Sometimes, said developers then blog about how they used a nailgun to swat a fly, and the hype cycle continues.

Example: everybody wants their web pages to be smaller but nobody wants to part with massive JS frameworks for sites that everyone are using, even if their site is mostly text. Instead, endless amounts of blogging and engineering time are dumped into things like minification, compiler tech, and other esoterica to solve a problem created by developers. This is incidental complexity, and it lays waste to software systems.

In short, the zeitgeist selects what it wants to hear.

Re:Efficient music players remain elusive by regularfry on Monday June 26, 2017 @04:12AM (#14634957)
In my observation, this puts the blame in the wrong place. It's simply that most software development is feature-driven, and efficiency is rarely held to be a feature by the business that's paying for them. That is, until it becomes a problem, at which point there are enough low-hanging fruit left by the constant scramble for user-facing shiny that making it not a problem again is relatively straightforward.
Re:Efficient music players remain elusive by jnordwick on Monday June 26, 2017 @04:52AM (#14635140)
I didn't buy that excuse at all. Devs have a habitual problem blaming others for their poor code.

Often better code takes only marginally longer or even less time since you aren't having to deal with all the extra complexity that tends to be a part of "modern" development.

The complexity is of our own making. We spend too much time on this extra cool and extensible way to use json and xml in case we even want to run on a quantum computer in in 50 years or avoid a simple recompilation when we need to change a constant that will likely never need to be changed when we should have been spending that time on more important things.

Re:Efficient music players remain elusive by regularfry on Monday June 26, 2017 @06:01AM (#14635482)
You're conflating "better" with "more efficient to execute." That's only one possible interpretation of "better", and it's usually not the most important one.
Re:Efficient music players remain elusive by marrs on Monday June 26, 2017 @09:46AM (#14636722)
but it very often is. If you're a web developer, for example, little matters more to your users than performance. This has been demonstrated an almost infinite number of times by now, but surprisingly few industry professionals seem to pay any attention to it
Re:Efficient music players remain elusive by regularfry on Monday June 26, 2017 @10:02AM (#14636854)
Yes, and we can point that out to our business owners until we're blue in the face, but until they see the benefit they won't pay us to do that work. It can be surprisingly difficult to get this point across.
Re:Efficient music players remain elusive by Brockenstein on Monday June 26, 2017 @11:38AM (#14637609)
Just because something matters objectively, doesn't mean it matters to the client/business (at the moment). And unless you as the developer are in the position to dictate that, sometimes you're at the mercy of non-technical requirements or demands. You can be right about everything, but unless you're the boss, at least sometimes you can only do what you're told.
Re:Efficient music players remain elusive by aoeuasdf1 on Monday June 26, 2017 @12:59PM (#14638304)
Little matters more to your users than performance, specifically, only features and security matter more than performance :)
Re:Efficient music players remain elusive by jononor on Monday June 26, 2017 @03:28PM (#14639554)
And that the software is available (ie actually shipped). And to use it they need to know it exists and what it's for, which usually involves some marketing.
Re:Efficient music players remain elusive by TeMPOraL on Monday June 26, 2017 @09:50AM (#14636753)
I think it unfortunately takes experience to write efficient code the first time around. Experience people are not gaining, since there is little to no focus on performance outside embedded and gamedev circles.
Re:Efficient music players remain elusive by Gravityloss on Monday June 26, 2017 @03:48PM (#14639719)
Well for some reason it's those people [1] who have the money so they call the shots.

Do you know of organizations where an internal drive for excellence is cultivated? Where technical people communicate directly across hierarchy levels and horizontally? Maybe even outside the company?

[1]: People who are relatively close to the customer and not the implementation. Those people don't tend to understand how efficient some things are because they can't estimate how long something should take from lower principles which they have a benchmark for. This makes them much happier software users.

Re:Efficient music players remain elusive by ClassyJacket on Monday June 26, 2017 @04:29AM (#14635032)
"Sometimes the excuse is that cpu and memory are cheap as if resources aren't under constant pressure from the hundreds of processes that all pretend they are the only one on the machine."

Does anyone know if there's a generalized name for this problem? It's the same one where your teacher gives you "only two hours of homework tonight" but forgets you have four other classes all doing the same thing.

Re:Efficient music players remain elusive by pjmorris on Monday June 26, 2017 @06:19AM (#14635579)
Maybe 'Tragedy of the Commons'? [0]

[0] https://en.wikipedia.org/wiki/Tragedy_of_the_commons

Re:Efficient music players remain elusive by TeMPOraL on Monday June 26, 2017 @09:53AM (#14636775)
Tragedy of the Commons, as mentioned by others, sounds most adequate. In general this is one of the whole class of coordination problems - where actors reach globally suboptimal outcomes by failing to coordinate with one another.

Tragedy of the Commons seems to imply some harm is happening to the actors themselves; the coordination problem with computing resources here is a little different, because most of the time, application vendors don't feel any impact of the problem they contribute to, which makes them even less incentivized to coordinate.

Re:Efficient music players remain elusive by tboettch on Tuesday June 27, 2017 @01:21PM (#14647305)
It's not exactly what you're looking for, but I've always been fond of Raymond Chen's "What if two programs did this?" thought experiment:

https://blogs.msdn.microsoft.com/oldnewthing/20050607-00/?p=...

Re:Efficient music players remain elusive by Daishiman on Monday June 26, 2017 @04:54AM (#14635147)
Parkinson's Law
Re:Efficient music players remain elusive by ClassyJacket on Monday June 26, 2017 @05:07AM (#14635226)
"Originally, Parkinson's law is the adage that "work expands so as to fill the time available for its completion", and the title of a book which made it well-known. However, in current understanding, Parkinson's law is a reference to the self-satisfying uncontrolled growth of the bureaucratic apparatus in an organization."

Hmm, I can see how they're related, but it doesn't seem to be quite what I'm talking about. I'm more referring to the overuse of resources by individual elements assuming or acting as if they're the only thing using it, like in the above examples of a teacher acting like their class is your only one, or a thread consuming resources like no others are active.

Parkinson's law more seems to be the result of the effect that I'm talking about (among others, like procrastination).

Re:Efficient music players remain elusive by vtbassmatt on Monday June 26, 2017 @05:49AM (#14635428)
Tragedy of the commons?
Re:Efficient music players remain elusive by posterboy on Monday June 26, 2017 @12:56PM (#14638281)
willful ignorance?
Re:Efficient music players remain elusive by posterboy on Monday June 26, 2017 @12:53PM (#14638237)
"to throw money at it" is a general expression for the solution to overcommitment, schedule conflicts and resource exhaustion.
Re:Efficient music players remain elusive by ajuc on Monday June 26, 2017 @08:44AM (#14636283)
I'd call it Assumption of Isolation.
Re:Efficient music players remain elusive by skratlo on Monday June 26, 2017 @05:01AM (#14635182)
> premature optimization is often used to shut down discussion of how their code can be improved

and

> The field is too in love with horribly inefficient frameworks

Dude, I can't emphasize this enough. One of the best things I read in past week.

Re:Efficient music players remain elusive by omginternets on Monday June 26, 2017 @04:45AM (#14635109)
And so where can a self-taught programmer self-teach himself about this stuff?

I'm probably guiltier of this than I realize, especially since I loooooove me some abstraction.

Re:Efficient music players remain elusive by sn9 on Monday June 26, 2017 @08:03AM (#14636049)
If you know C at the level of K&R, a good start would be learning from Bryant and O'Hallaron's book: http://csapp.cs.cmu.edu/

From there, you would be well served by working through Hennessy and Patterson's Computer Architecture and Computer Organization and Design.

In parallel, you could work through a book on Operating Systems, maybe even playing with the code for a toy system (e.g., http://pages.cs.wisc.edu/~remzi/OSTEP/ or https://pdos.csail.mit.edu/6.828/2016/xv6.html).

An alternative or perhaps parallel approach would be to play the assembly games put out by Zachtronics.

Re:Efficient music players remain elusive by chandler on Monday June 26, 2017 @07:28AM (#14635892)
A simple thing is to figure out if you can restrict the runtime environment during development (available memory, clock speed, network speed, etc), and develop to that. The nice side effect is there's more of your computer available for IDE's and browser tabs.

Secondly, abstraction doesn't necessarily track with efficiency/inefficiency.

Re:Efficient music players remain elusive by lj3 on Monday June 26, 2017 @10:34AM (#14637098)
Efficient programming is all about knowing how to use CPU features and memory to your advantage. If you don't already know C, I suggest "Learn C the Hard Way"[0]. After that, here's two great places to start: "What Every Programmer Should Know About Memory"[1] and "What's new in CPUs since the 80s and how does it affect programmers?"[2]

[0]: https://learncodethehardway.org/c/

[1]: https://people.freebsd.org/~lstewart/articles/cpumemory.pdf

[2]: https://danluu.com/new-cpu-features/

Re:Efficient music players remain elusive by TeMPOraL on Monday June 26, 2017 @09:57AM (#14636808)
Go learn yourself some embedded, if you want to deal with extreme resource constraints, or some gamedev, if you want to know how to write performant code with enough tasty high-level architecture decisions to satisfy your abstraction needs.
Re:Efficient music players remain elusive by pjc50 on Monday June 26, 2017 @04:57AM (#14635166)
"Arduino" and other small-system programming. Or get an emulator and try to write an Atari 2600 game: you have 128 bytes of RAM, don't use it all at once.
Re:Efficient music players remain elusive by omginternets on Monday June 26, 2017 @05:20AM (#14635285)
I should have been clearer: I'm mostly interested in books and articles. I like to approach things theoretically before approaching them practically.

(Nonetheless, thanks for your suggestion!)

Re:Efficient music players remain elusive by gradstudent on Monday June 26, 2017 @06:01AM (#14635486)
Try "Racing the Beam"; a neat book describing the programming challenges with writing software for the Atari 2600.

https://www.amazon.com/Racing-Beam-Computer-Platform-Studies...

Though, instead of reading, you really should just get over your complex and try writing some efficient code.

Re:Efficient music players remain elusive by omginternets on Monday June 26, 2017 @06:08AM (#14635515)
>get over your complex

It's not a complex. I'm always very surprised by this attitude. Theory serves practice.

Case and point: the OP mentions that an understanding of cache architecture enables you to reason about which data-structures exhibit good cache locality. Discovering that hashtables have poor cache locality by trial-and-error seems like a waste of time compared to gaining theoretical insights.

Re:Efficient music players remain elusive by pjc50 on Monday June 26, 2017 @07:17AM (#14635832)
I'll second "Racing the Beam", although it's a history rather than a theoretical approach.

I think you may have hit a linguistic snag here; there's lots of "theory" in the classical CS sense dealing with performance from an O(n) point of view, such as Knuth's work. But for producing fast results on actual hardware you end up having to take into account lots of ugly details of the platform. Learning about cache behaviour doesn't really fit into CS so it's not the first thing people think of when you ask for theory.

"Knowledge transmitted by practitioners through written and oral culture outside of the academy": what's the word for this?

Re:Efficient music players remain elusive by bradleyjg on Monday June 26, 2017 @12:49PM (#14638190)
Part of the problem is that some of this stuff has a pretty short shelf life. There's a lot of optimization knowledge that was useful at one time but is now flat out wrong.

Oral culture is especially prone to this -- at least a blog post or a physical book has a date on it. You have no idea when the your co-worker's suggested optimization technique was developed.

Re:Efficient music players remain elusive by vinceguidry on Monday June 26, 2017 @09:23AM (#14636576)
I think 'theory' is just fine, you can't fix all communication failures by throwing moar words at it. At some point you have to make peace with the fact that not everybody uses words the same way you do.
Re:Efficient music players remain elusive by yellowapple on Monday June 26, 2017 @10:27AM (#14637045)
"what's the word for this?"

I think the word (or phrase, rather) is "tribal knowledge".

Re:Efficient music players remain elusive by posterboy on Monday June 26, 2017 @01:13PM (#14638458)
tools of the trade

* from the book

secrets of the cult

Re:Efficient music players remain elusive by TeMPOraL on Monday June 26, 2017 @10:03AM (#14636857)
I think there's a miscommunication here. By "write some efficient code" GP presumably meant the "pull" approach, in which you identify the code that's causing you performance problems and then try to make it faster, learning everything you need on the way. Rinse and repeat. It's a very efficient way to learn, and also good at teaching you those intutions that are hard to put down in writing.

That said, if anyone knows some kind of collected guide to writing efficient software, I'd be happy to learn about it, 'cause I haven't seen anything like this published.

Re:Efficient music players remain elusive by pjc50 on Monday June 26, 2017 @10:45AM (#14637168)
I suppose the legendary "PC Game Programmers Encyclopedia" counts, although it is very old: http://qzx.com/pc-gpe/

There are various analyses of Doom and Quake source around which look at the techniques used there.

Re:Efficient music players remain elusive by jfoutz on Monday June 26, 2017 @01:27PM (#14638619)
I am like you. Every big performance win i ever got was from changing algorithms. Sometimes i didn't write either the old or the new, but just swapped out a different implementation. A good handle on that stuff can get you a long way. And can certainly be picked up from reading. it's a lot closer to just math.

That said, spend a week with C and valgrind/cachegrind. There's a lot of theoretical stuff that is hard to get at (or is for me) without a little exposure to how the system works. a coupe hours here and there will extend your mental model to include the various layers of cache. That'll make the more esoteric stuff more accessible.

Re:Efficient music players remain elusive by Spearchucker on Monday June 26, 2017 @05:32AM (#14635341)
You could do worse than Steve McConnell's Code Complete - https://www.amazon.com/dp/0735619670.
Re:Efficient music players remain elusive by pjmorris on Monday June 26, 2017 @06:23AM (#14635595)
I think Peter Norvig's article 'Teach Yourself Programming in Ten Years' [0], might be useful to you. One of his points is to 'Remember that there is a "computer" in "computer science"', along with examples of things to investigate.

[0] http://norvig.com/21-days.html

Re:Efficient music players remain elusive by dreamcompiler on Monday June 26, 2017 @04:43AM (#14635096)
Efficiency can be done but it requires disciplines only taught in courses on real-time and embedded programming, and those seem to be fairly rare these days. Real-time and embedded programming teach the programmer how to reason about finite resources like time, energy, memory, and floating-point operations while requiring a level of mastery "down to the metal" that's also rare in overly abstraction-driven programming. RTE skills make every programmer better in the same way that glider skills make every pilot better.
Re:Efficient music players remain elusive by jnordwick on Monday June 26, 2017 @05:01AM (#14635186)
I went to Cal and aside from some hardware classes i never had a real time or embedded class.

I think it requires an open mind to want to learn these things and put effort into it instead of blowing things off as premature or something the maintainer of the code behind you will come and fix.

Re:Efficient music players remain elusive by rhodysurf on Monday June 26, 2017 @05:59AM (#14635475)
Anecdotal but this matches my experience. I went to generic public school for ocean engineering and took tons of embedded classes. I then worked on a student robot project and was shocked when the CS students were completely lost with how to approach writing drivers and interfaces for the sensors and such. I thought that would be standard for CS.
Re:Efficient music players remain elusive by RandomOpinion on Monday June 26, 2017 @10:15AM (#14636948)
> CS students were completely lost with how to approach writing drivers and interfaces for the sensors and such. I thought that would be standard for CS.

No, that would be standard for computer engineering, not CS.

Try to have a conversation about hardware to many practicing software developers who were CS majors and they'll look at you as if you've grown a second head.

Re:Efficient music players remain elusive by opportune on Monday June 26, 2017 @10:15AM (#14636943)
I think that stuff tends to be more common for EEs and CompEs.
Re:Efficient music players remain elusive by yazan94 on Tuesday June 27, 2017 @10:44AM (#14645824)
How should one learn real-time/embedded programming? Do you have any recommended readings or online resources?
Re:Efficient music players remain elusive by weberc2 on Monday June 26, 2017 @11:28AM (#14637541)
I mostly agree, but I think you're too quick to assume that everyone who doesn't write optimal code is doing so because of some tech fad. Frequently it simply doesn't pay to write optimal code; there's no viable business case. Sure, using an array can be faster and not much harder than using a hash table, but writing a network protocol is frequently not worth the effort. In my experience, poor performance comes from the inability to make a business case (whether or not one actually exists), not from chasing fads.
Re:Efficient music players remain elusive by flavio81 on Monday June 26, 2017 @11:41AM (#14637633)
I think good programmers, by default, try to write readable, easy-to-maintain code. If you ask them to write high-performance code then they will do it, knowing that readability might suffer because of it.
Re:Efficient music players remain elusive by datagram on Monday June 26, 2017 @05:12PM (#14640422)
"Sometimes the excuse is that cpu and memory are cheap as if resources aren't under constant pressure from the hundreds of processes that all pretend they are the only one on the machine."

I find that this often extends beyond performance too. Many websites/apps waste lots of screen space because they were clearly designed for, and tested at, 1080p.

Re:Efficient music players remain elusive by taeric on Monday June 26, 2017 @12:14PM (#14637878)
I think the secret is slightly different. Most think they can fully solve a problem. Such that their solution is the one everyone should use.

This manifests in assuming everyone can afford the abstraction boundaries chosen. Or that everyone needs the same tradeoffs. Or, ultimately, that everyone would come to the same conclusion.

I think of it as the desire of most people to boil software down to formulaic choices. Imagine if you came up with something as elegant as "F = ma" for software.

I feel this is somewhat related to the rise in functional programming. It is not that either of those things are bad goals to chase. But they are not ends to themselves.

Re:Efficient music players remain elusive by mfukar on Monday June 26, 2017 @05:48AM (#14635420)
The dirty secret in software development: most think they write efficient software, but very few know what to compare it to and how.
Re:Efficient music players remain elusive by kronos29296 on Monday June 26, 2017 @09:30AM (#14636617)
>The field is too in love with horribly inefficient frameworks. Writing network code and protocols is now considered too low level for people. Many are too caught up it what is tech-cool. They're like the holistic medicine practitioners of software and they don't even know it.

While the frameworks themselves are made for a particular purpose, they are often misused. One great example would be electron. I found an electron clone of Keepass. Now why would anybody want that.

And you find people justifying Huge bloated electron apps that take a minimum of 50 MB for a simple Hello World. And then they say memory is cheap. I say memory is cheap for 1 app at that size. Not running all apps at that size. If busybox can run GNU coreutils with a size less an MB then why can't they make more efficient apps?

Beats me.

Re:Efficient music players remain elusive by noxToken on Monday June 26, 2017 @09:36AM (#14636656)
>...then why can't they make more efficient apps?

They can.

>...frameworks... are often misused.

Re:Efficient music players remain elusive by naikrovek on Monday June 26, 2017 @11:39AM (#14637618)
If you're not developing for a real-time system, like most (all?) larger games or software for embedded hardware, it is likely that you are not thinking about performance very much, even if you have the time and skill to do so.

You don't think about performance, as a developer, usually, until it becomes a problem, and there are so many layers and frameworks between an MP3 player and the CPU that this kind of thing should be expected.

It is much more difficult to keep a real-time system working in real-time than it is to keep something performing as well as a desktop computer user expects it to perform.

Re:Efficient music players remain elusive by Capt-RogerOver on Monday June 26, 2017 @11:43AM (#14637647)
"Mechanical Sympathy"/empathy is a very good expression, kudos!
Re:Efficient music players remain elusive by jnordwick on Tuesday June 27, 2017 @02:23AM (#14642928)
I wish I could take credit, but i think it was Martin Thompson that coined the phrase. I think it if a perfect deception of the, often subconscious, understanding of what is going on underneath the code.
Re:Efficient music players remain elusive by amelius on Monday June 26, 2017 @08:19AM (#14636140)
> most think they how to write efficient software when they need to, but very few can

Doesn't mp3 transcoding have dedicated hardware instructions, making the job much easier?

Re:Efficient music players remain elusive by pjc50 on Monday June 26, 2017 @12:04PM (#14637810)
It's not really "dedicated", it's just SIMD for FFT like most signal processing. Takes about 25 MIPS: https://retrocomputing.stackexchange.com/questions/2672/why-...

You can get dedicated MP3 low-power decoder chips. You might have one in a fancy PC soundcard (SBLive?), but I don't think it's included in baseline AC97.

(I remember having a 486DX that could decode MP3s with the Fraunhofer player at about 95% CPU but not Winamp, which was slighly too slow to keep up)

Re:Efficient music players remain elusive by amelius on Monday June 26, 2017 @02:55PM (#14639288)
Does this also hold for modern smartphones?
Re:Efficient music players remain elusive by pjc50 on Tuesday June 27, 2017 @07:06AM (#14644196)
I don't know exactly; the chipsets tend to be closed. I've seen baseband processors which have the AMR codec in hardware (adaptive multi-rate, used for GSM phone audio).
Re:Efficient music players remain elusive by jleahy on Monday June 26, 2017 @09:14AM (#14636496)
No, because it's so easy to begin with.
Re:Efficient music players remain elusive by amelius on Monday June 26, 2017 @09:51AM (#14636759)
Satisfying a low-power constraint?