Slashdot Mirror


User: Pseudonym

Pseudonym's activity in the archive.

Stories
0
Comments
5,184
First seen
Last seen
Profile
(view on slashdot.org)

Comments · 5,184

  1. Re:Perversion of Capitalism on How and Why Wall Street Programmers Earn Top Salaries · · Score: 2

    Many slashdotters are pushing 40 these days, and did their CS degrees back in the day when pipelines were shorter and even Booth multipliers were relatively slow.

    The shift/add combination probably won't take "multiple trips through the pipeline" on any modern non-embedded core. If it's an x86 or x86_64, the compiler will probably generate a single LEA instruction (i.e. it won't pollute the I-cache), which is probably compiled to several uops which are issued together. Rather than round-tripping through the entire pipeline, the intermediate values will just get circulated around the CDB, which is fairly quick.

    If you're as old as I am, chances are that you may not know this because Tomasulo schedulers weren't in vogue during your CS degree.

    But as you are a fellow compiler writer, you must know that even on a modern CPU, the most optimal strategy depends on a lot of context. Using the multiplier isn't always a good idea, for example, since it's usually a more scarce resource than other functional units. Even a relatively recent AMD K10 core only has a single integer multiplier unit (which admittedly only costs a couple of cycles, but there's still only one), and a single floating-point combined multiplier/divider/square root unit (for non-SIMD operations, anyway).

    You probably also know that simple integer operations can be effectively "free" if you really know what you're doing, since they can be used to fill pipeline delays from other operations.

    But your central point is valid: This is the sort of optimisation that the programmer should not be wasting their time with. Leave the micro-optimisations up to the compiler, because it will almost always do a better job.

  2. Re:Yes, No on Ask Slashdot: Do We Need Pseudonymous Social Networking? · · Score: 1

    I hear the Prisoner's Dilemma.

  3. Re:Yes. on Ask Slashdot: Do We Need Pseudonymous Social Networking? · · Score: 1

    I disagree.

  4. Re:Biased summary on Release of 33GiB of Scientific Publications · · Score: 1

    That's reading a lot into a single word. You're assuming that the anonymous reader has a perfect grasp of English and knows how to express precisely what they mean with a few well-chosen words. These are skills that you may well have, but most don't.

  5. Re:More than 4 bases in DNA on Personal DNA Sequencing Machine One Step Closer · · Score: 1

    If by "sequencing method" you mean the whole process from wet lab to assembly, then we can indeed detect methylation. Look up, for example, methylation-specific PCR.

  6. Re:Biased summary on Release of 33GiB of Scientific Publications · · Score: 0

    Additional note to readers: "lying" implies an intent to deceive. The "anonymous reader" may have been mistaken.

  7. Re:But most employers don't want "good" on Study Shows Programmers Get Better With Age · · Score: 1

    That's why I work in government-funded R&D in a country other than the US. Best of both worlds: Reasonably secure income stream, plus I get to do actual science instead of "the next killer app".

  8. Re:But most employers don't want "good" on Study Shows Programmers Get Better With Age · · Score: 1

    But on the other hand, people with families, kids and mortgages often can't work at a startup, because the cash flow is too unreliable. People with responsibilities to those other than themselves need stability.

  9. Re:Not fear - disgust on Women Arrested For Refusing TSA Search of Children · · Score: 1

    A duck!

  10. Re:Not fear - disgust on Women Arrested For Refusing TSA Search of Children · · Score: 1

    Traveling by a car is a part of vacation. You see places, people, dine in towns that you never saw. Basically you see the world.

    I'm willing to bet that there's very little of this between where you live and Hawaii.

  11. Re:Well on Could PSTN Go Away By 2018? · · Score: 1

    VoIP doesn't work when the power is out, which makes it less than useful in domestic emergency situations, such as fire.

  12. Re:Been using it for years on Canada Rolls Out Plastic Money · · Score: 1

    I don't like inflation either, but the alternative is to have interest rates which can go negative in some circumstances. If the mean official interest rate is zero (no net inflation), then it must fluctuate between positive and negative over time.

    The cost of inflation is that your money is worth less if you store it in your mattress for 20 years. The cost of no inflation is that your money is worth less if you store it in the bank for 20 years. Take your pick.

  13. Re:Been using it for years on Canada Rolls Out Plastic Money · · Score: 1

    Swings and roundabouts.

    On one hand, European (and Australian for that matter) pocket change can often buy you lunch. On the other hand, I wouldn't be bragging about coins if you're still using pennies.

  14. Re:Old school on The 8-Bit Computer That's Been Built By Hand · · Score: 1

    Not really, no. 25 years ago you could buy a Z80 or 8085 in that kind of store for cheap, so there was no need to build your own CPU from TTL.

    Yes, I was there.

  15. Re:Common knowledge on C++ the Clear Winner In Google's Language Performance Tests · · Score: 1

    People used to worry about memory being scarce, and page misses being slow, and caches being amazingly expensive.

    Still very much true in any kind of data-intensive application (e.g. large databases, visual effects, bioinformatics). RAM is tiny compared to the amount of data that typical modern data-intensive systems have to cope with.

  16. Re:Common knowledge on C++ the Clear Winner In Google's Language Performance Tests · · Score: 1

    There's an old saying that an assembly programmer will always beat a programmer working in a high-level language, if the assembly programmer also gets to use the high-level language.

  17. Re:Common knowledge on C++ the Clear Winner In Google's Language Performance Tests · · Score: 1

    I've always felt that deallocating in a different thead should be avoided except in the very rare cases when it can't, even if it means some extra work.

    Sribe gave some good examples, but just for completeness, the last time it bit me was in a large shared cache. The thread which invalidates a cache entry is almost never the thread which made it.

  18. Re:TMBG... on John Linnell of They Might Be Giants Talks Tech · · Score: 1

    You're last comment also applies to all other eras as well.

    Of course! Every era in music has its good and its bad, by whatever measure you use. Especially if this is the era you grew up in, you tend to remember the good and filter out the bad.

  19. Re:C/C++ faster but produces more bugs on C++ the Clear Winner In Google's Language Performance Tests · · Score: 1

    No more worrying about whether you've allocated the right buffer size for your data...and maybe allocated too little resulting in an overrun screw, or allocated too much and wasted the memory.

    You've clearly never programmed in C++. Or, more likely, all of your C++ code has been C code in a very thin disguise.

  20. Re:Common knowledge on C++ the Clear Winner In Google's Language Performance Tests · · Score: 3, Interesting

    Why shouldn't a GC language where the GC has to search through lists regularly instead of you telling the memory management what to clean up by giving it the pointer be faster?

    When you're doing serious structure-hackery (as opposed to, say, string-hackery or numeric-hackery) in a non-GC language, you often end up having to structure your code around variable lifetimes, rather than structuring it around the algorithms like you're supposed to. The lack of GC can mean that some algorithms are not viable, and can result in the developer picking a worse algorithm instead. This kind of cost won't easily show up on a profile, but the cost is there, and it's nonzero.

    Compiler writers in particular know this, which is why even GCC uses GC. Yes, it's home-built application-specific carefully-applied-and-tuned GC, but it's GC nonetheless. I have a theory that one of the reasons why most languages use GC is that most languages are optimised for writing their own compiler in.

    Oh, and in a multi-threaded application, free() can be more expensive (in a latency sense) than malloc(). A well-tuned memory allocator maintains multiple arenas, so it can can allocate memory from whichever one has the lowest thread contention. But deallocating memory requires returning it to the arena from whence it came; you have no choice in this. Some high-performance applications (e.g. database servers) have been known to avoid the latency of free() by handing off critical memory blocks to a dedicated thread which just sits in a loop calling free(). Essentially, it's a GC thread, only it's a manual one.

    Don't get me wrong. I don't use Java for pretty much anything (definitely more of a C++-head). But one should never underestimate the cost of manual memory management, or of any other resource for that matter.

  21. Re:Well damn... on Terry Pratchett Considers Assisted Suicide · · Score: 1

    The laws on suicide were around long, long before laws on assisted suicide. Those laws were written by religion.

    That's about half accurate, but I'd argue that it's highly misleading. Even if the current laws on suicide were written by, or influenced by, religion, that doesn't mean that they don't serve a legitimate secular purpose. Few would argue that this is the case for the laws on theft or murder.

    If we leave aside the terminally ill for the moment, pretty much everyone else who attempts suicide is mentally ill, or in some other way not in their right frame of mind, and hence not competent to make a decision. Even from a purely economic rationalist point of view, every failed attempt at suicide is a net drain on the economy, both on the public health system (if you're in one of the countries which have one, which is every developed nation except one). Even if the attempt succeeds, you need to deal with the health issues of the loved ones left behind.

    So I would think that outlawing the helping of someone to commit suicide is a good thing for the general case. The case of the terminally ill is the exception, not the rule.

  22. Re:Well damn... on Terry Pratchett Considers Assisted Suicide · · Score: 1

    I don't live in the UK. I live in Australia. Our Prime Minister is a woman, openly atheist, unmarried but in a long-term relationship... and personally against same-sex marriage.

    Same-sex marriage is different from medical assisted suicide because it's a wedge issue. People can and will change their votes on that issue, and I'd be lying if I said religion wasn't a critical part of that. However, as George Lakoff quite correctly pointed out, it actually has more to do with the conservative framing of the nation-as-a-family. Liberal people who happen to be religious (which is not identical with the group of people from liberal religions) may be personally against same-sex marriage, but still tend to vote for candidates who support it.

  23. Re:TMBG... on John Linnell of They Might Be Giants Talks Tech · · Score: 1

    What I tend to find when people have the "80s music was shit" attitude is that I reel off a few band names from that era, and they respond with "apart from them".

    I hate to break it to you, but they're correct. The problem isn't their memory, it's yours. The worst of 80s music was very, very bad indeed. For every Depeche Mode, there were a dozen Mel and Kims or Milli Vanillis that you've conveniently forgotten, and a few Phil Collinses, Paul McCartneys and Stevie Wonders who were going through their career low periods.

    The 1980s was a magnificent decade for music. Drab was out and optimism was in. It was the decade in which pop music came into its own; there was a critical mass of fairly decent pop around, so it became respectable to listen to it for the first time in history. It was the era of MIDI and FM synthesis. It was the peak of the analogue magnetic tape era, before Pro Tools made audio engineers lazy.

    But in the end, you can't beat Sturgeon's Revelation. Most 80s music was crap because most of everything is crap.

  24. Re:Well damn... on Terry Pratchett Considers Assisted Suicide · · Score: 1

    If Pratchett wants to kill himself, I won't sit in judgement. If he wants to hire someone to murder him, I might have a few problems with his solution.

    We're talking about someone else supplying the wet copper armour and delivering him to the hilltop in the thunder storm. He still has to yell "all gods are bastards", otherwise it won't work.

  25. Re:Well damn... on Terry Pratchett Considers Assisted Suicide · · Score: 1

    It basically shows that our laws are written by religions.

    No. Our laws are written by politicians who are conscious of the wide variety of people in their electorate. They and their faceless lackeys are well aware of who votes for them and why, and what issues will cause people to change their votes and why. They are also well aware of which issues matter the most to the lobbyists who fund them.

    I don't live in the US and I never have. However, one factoid recently jumped out at me. Think of all of the important issues facing the US at the moment. There's still a crisis in health care, debt, unemployment, there are uprisings in the Middle East... lots of important stuff going on.

    Last month, the US Congress spent most of its time working on the problem of who pays the transaction fees on credit cards.

    No, I'm not kidding. The reason is that both sides (financial institutions on one side and retailers on the other) were playing duelling lobbyists. There were something like 250 lobbyists employed by both sides working on politicians to make sure that their side got the best deal.

    The laws on assisted suicide are the way they are because there is no money-raising potential in fixing it, nor is it a "wedge issue" that could mobilise a voting bloc.

    Religion gets invoked a lot in politics, but contrary to popular belief, it's almost never a deciding factor. Remember, Roman Catholics in the US mostly vote for the Democratic Party, which is largely in favour of legal access to abortion. For all that it's thrown up as a key issue, it isn't really.

    It's all about the Pentiums. Uh, I mean Benjamins.