Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
DEAL: For $25 - Add A Second Phone Number To Your Smartphone for life! Use promo code SLASHDOT25. Also, Slashdot's Facebook page has a chat bot now. Message it for stories and more. Check out the new SourceForge HTML5 internet speed test! ×

Comment Re:Big-O is only a small part of performance (Score 1) 218

Programs are not just single algorithms. And data is often in some internal partially digested representation in some sort of data structure. Optimizing can't just be done by improving algorithms and thinking of the data as a black box and just blinding switching algorithms. It requires understanding why and where a program is slow including considering the representation of data. BTW, even with the same data structure it's possible for algorithms to have different "n"s. Consider multi-indexed containers (e.g. Boost's) and algorithms that might work with them*.

* - And yes I know that you can often express the extent of one index as an function on the extent of another index in which case you have the same "n".

Comment r/pebble's Smart Watch Alternatives. (Score 1) 232

After what happened with the Pebble a bunch of r/pebblers put together a list of smart watch alternatives. Might be a good place to start looking into options. I've been looking into the Garmin Fenix smart watches ( possibly the newer announced Fenix 5 ) myself as aside from looks they seem to have what I want in a smart watch. Sounds like Fibit might be looking at doing a proper watch ( as opposed to their typical fitness trackers ) as well based on their purchase of Pebble's software division and some discussions I've seen about.

Comment Re:Why wait? (Score 1) 131

Three ways I see to look at. One is they found the likely cause but want to avoid getting egg on face if it turns out they missed something. Given that they already had a double recall they probably don't want to create the appearance that they are clueless.

The second way I could see it is by pronouncing they can show down third parties releasing their own investigations and could also time when the news got released. Given that CES is this month that can be used one of two ways, either release when press is excited about some new product or to spread the impact to other companies phones that will be announced shortly by implying that it could happen to any phone using the same type of battery.

The third way I could see it is that they have developed a technology that eliminates our greatly reduces the possibility of the problem such as Utah a different type of battery. Having that ready at the same time could give them headstarts against the competitors. Look at how a lot of phones had to be reinforced after the bending iPhone cases. Once the problem is known people will start checking other phones for similar problems.

Comment Re: Big-O is only a small part of performance (Score 1) 218

Yes for the calling code the profiler found O(n log n) was actually closer to O((n+m) log (n+p)) and O(n^2) was more like O((n+q) * (n+r)). Where m was approximately a very large multiple of n; m and p were approximately equal; q and r were also approximately equal and q was approximately a small multiple of n. It was actually a bit more complicated then that, but compared to the main loops most of the rest of the algorithm was a constant. And for the record the function that highlighted as the CPU hog was an over optimized EBCDIC toupper equivalent, i.e. character_code | 0x40. ( And yes that would turn a "^" into "0". )

And no those were not the variable names used in that code. I'm infamous at work for using annoyingly_long_variable_names_that_self_document in my own code.

Comment Re:Big-O is only a small part of performance (Score 1) 218

Yes there are domains where performance is likely to be more of an issue; though not every program targets generic devices.

I work on tools ( compilers, profilers and the like ) and OSes for real-time systems some of which that had way less power and memory than modern smart phones. O(n) is awesome when you can get it but not required or possible everywhere. It's very easy to have one apparently O(n) algorithm call another O(n) algorithm even indirectly ending up with an O(n^2). In any large system complexity is easily hidden between layers, just knowing the big-O of the piece you are working on isn't enough. It's why profilers are so important. Avoid writing code that you know will be slow; but where performance may matter ( and it matters more then many may think ) the only thing to do is to test; ideally a separate tester with both real world and fuzzed data. Likewise the people I know that rewrite software for embedded devices or game consoles don't need to worry about their code running on a machine with lower specs.

That said I always did get a kick out of what happened when you took ancient code that had empty-loops for timing as was common in the 80s and ran it on more modern hardware. And yes tuned code still happens in modern systems, for example some times it actually makes since to ensure the best and worse cases are identical in performance; e.g. to avoid a side-channel attack.

Comment Big-O is only a small part of performance (Score 4, Interesting) 218

While I have a pretty good gut feel of the performance characteristics of my code these days, I know from experience Big-O and company are only part of the picture. Often choosing an algorithm in one place influences the performance of algorithms in another parts of the code. Consider various data structures, the insertion, iteration, and indexing performance; memory use; etc. all get traded off.

A lot of times what profilers point out can be surprising. I remember a couple decades ago finding a bottleneck that was a simple function that compiled to a single 1-clock-cycle inclusive-or instruction that took more of the run time after user inputs then the rest of the code. Yes, one clock cycle per call! The performance problem turned out to be that an O(n * log n) loop that called the inline function had too large an n. Ended off switching to an O(n^2) algorithm that was much faster because I was able to use a vastly smaller n. Just because some algorithm might have a better big-O form, the size of data and constants involved can make another algorithm much better in practice even if it looks like it would be worse purely by big-O.

Comment Re:1/40k devices (Score 5, Informative) 74

Apple did something similar with the iPhone chargers which is why all the new ones had the green dot ( I believe it was 3G charger, which the plugs could end up detached from the charger ). They also did a recall of knock off third party chargers and replaced them with genuine ones after a bunch of issues with including a KIRF charger killing someone.

Comment No real "main" OS (Score 1) 599

At work I use a mix of HP-UX 11.31, Linux RHEL 6, Centos 7 and Windows 8.1, but also use some tablets as reference devices. Can't really say one use is dominant as I'm constantly connecting between machines. At home I switch between OS X, Windows 10, iOS fairly frequently. ( Since Google stopped upgrading my Nexus 10 don't use Android as much. ) Was on my Mac a few minutes ago and am now using my Surface Book. I'll often use multiple machines at the same time.

Comment Fairly regularly (Score 1) 331

I do compilers, low level OS stuff, debuggers, code analysis tools, so I'm always having to switch languages or keep up with other languages. When I have more of a choice my current preferences are a mixture of C++14, Perl and Assembly ( especially PowerPC ). Modern C++ is a pretty nice language and I consider it distinct from C++98 and earlier. I also have way too much fun playing with meta-programming when I can. And template meta-programming is always fun for adding another level. Wrote a binary object file parser once that was pretty much all default member initializers ( thanks C++14 ) and template meta programming. Why write a function when the compiler will do it for you, especially when you are writing another compiler.

Comment Cool (Score 1) 49

As it's opt-in like the Apple's version was it should really be useful and not nearly as scary as it could be. There something nice about easy access to store, business and review apps while shopping. I imagine Android will do even better as it has less worry about showing off the data it already knows about you. It's one of the reasons why Google Now can do better than Siri. (Except for voice recognization. I don't know why Google needs me to say somethings like 5 or 6 times before it understands me compared to iOS only messing up ocassionally. ) While I understand the privacy concerns, this is not really a new privacy issue as Google already has the data and would just be showing it. That said it also probably makes it more obivious to users how much data Google really has.

Comment Re:100 times as long as the kernel, I wonder why (Score 1) 184

Theoretically I might be able to improve it, but several of the links involved take ~30 minutes and while I can have several links or other parts of the build at the same time it had to break down linking too much. I did a little though by subdivide the linking into partial links of related code in archive libraries. It reduces the overall optimization but speed up the linking. There still is some build system overhead that I can reduce. One of my largest savings was switching the build system from nested make files to monolithic one created by a hand tuned generator. If I did it today, I'd probably look at cmake and ninja.

I do have tricks that let developers test small changes to the code much quicker though so hard to justify optimizing more currently.

Mostly just commented to note that slow compile times are still a real thing, didn't really expect to get much into my tools work. Alas multitasking is as well, so compiling time doesn't always equal break time as implied by linked XKCD comic it equals switch gears to another task.

Slashdot Top Deals

Contemptuous lights flashed flashed across the computer's console. -- Hitchhiker's Guide to the Galaxy

Working...