Please create an account to participate in the Slashdot moderation system

 



Forgot your password?
typodupeerror

Comment Comparison sort cannot be way better than N*log(N) (Score 1) 98

It can be proven that sorting by comparison will take in the worst case scenario around N*log(N) comparisons. The actual lower limit is log2(N!) - like in sorting by insertion. However, this is close to N*log(N) for big N. One thing that you can optimize is the cache access, that can really make a huge time difference (like 10*X) at the same number of operations. Another thing is to optimize common cases. Often you need to sort arrays that contain many parts that are already monotonic. The sort used in PHP will be very efficient for such cases. A curiosity: you can sort 32bits integers in O(N) operations, adding each number to a binary tree with 32 levels, based on its bits: 0=left, 1=right. In the leafs, you just count the occurrences. Then walk the tree from left to right. This seems to contradict the above. The catch is that there are 2^32 distinct integers and log2(N) = log2(2^32) = 32. So, for integers, log(N) is really a small constant that can be ignored. You can sort more than 2^32 integers with the same complexity, because there will be duplicates but the tree will have at most 2^32 leafs. However, the memory access pattern and additional memory might make this algorithm less appealing in practice. And a half joke: sorting is computationally harder than chess: https://meaningofstuff.blogspo...

Comment Re:It's not supposed to be faster ... (Score 1) 270

For me Java NIO (SocketChannel/select/read) worked a lot better then the multi-threaded/blocking version (Socket/read). I had to simulate 5000 TCP clients reading at 128kbps (radio streams), on Linux 2.6 64bits with 4GB RAM, CPU DualCore (Java 1.6). With the multi-threaded version is was a bit easier to code, but it consumed 2*100% CPU before reaching the target. The context switches between threads consumed a lot of CPU. Even before reaching the CPU limit, the Thread.sleep() between reads started to have big delays (>1second), probably because of the scheduler that had to schedule 5000 active threads. With the single-threader, NIO version it reached the target consuming about 20% of one CPU. I had to tweak a bit the reads for this. The problem was that reading in a close loop, there were many short reads, producing many switches between user/kernel space, consuming too much CPU. Putting a small sleep (50-100ms) between each select() resulted in bigger and fewer reads, in the same time consuming all the received data in a single loop.
Linux

According to Linus, Linux Is "Bloated" 639

mjasay writes "Linus Torvalds, founder of the Linux kernel, made a somewhat surprising comment at LinuxCon in Portland, Ore., on Monday: 'Linux is bloated.' While the open-source community has long pointed the finger at Microsoft's Windows as bloated, it appears that with success has come added heft, heft that makes Linux 'huge and scary now,' according to Torvalds." TuxRadar provides a small capsule of his remarks as well, as does The Register.
Security

Submission + - ELF Knocks Down AM Towers To Save Earth, Intercoms

ScentCone writes: The ELF (Earth Liberation Front) has claimed responsibility for destroying the primary AM towers used by KRKO in Washington state. From their statement, 'AM radio waves cause adverse health effects including a higher rate of cancer, harm to wildlife, and that the signals have been interfering with home phone and intercom lines.' The poor intercom performance must have been the last straw.
Google

Google To Host International SVG Conference 38

stelt writes "On Oct.2–4 Google will host the international conference on Scalable Vector Graphics at its campus in Mountain View, California. The SVG Open conference schedule shows developers and designers of various backgrounds. Major brands, open source projects, universities, and individuals are presenting on a variety of subjects like interactive scientific visualizations, mobile web animation art, internationalization and localization in print, geo-systems, etc. A couple of weeks back we discussed Google's adding SVG support to IE, and details of this project will be presented during the keynote 'SVG in Internet Explorer and at Google.'" Early-bird registration has already ended for this conference, but the pricing is not steep.
Oracle

Oracle Kills Virtual Iron 189

rhathar writes in with news that Oracle is killing off the products of Virtual Iron, a month after purchasing the company. Reports say that all but 10 to 15 staff were let go. The Reg article speculates that Oracle bought VI for its technology and considers its customers and partners expendable. When the Sun purchase finalizes, Oracle will be in possession of three separate virtualization technologies all based on Xen. "In a letter to Virtual Iron's sales partners, Oracle says it 'will suspend development of existing Virtual Iron products and will suspend delivery of orders to new customers.' One partner said, 'So basically, anyone that built their hosting infrastructure on VI... is now totally in the s–.'"
Sun Microsystems

Oracle Top Execs Answer Sun Employee Questions 207

The Register writes "Sun invited Oracle president Charles Phillips and chief corporate architect Edward Screven to an employee-only town hall this Wednesday, where they took questions on what's coming. They said they'd be 'crazy' to close Java, that Oracle 'needs' MySQL, and all Sun's processors look appealing. They hedged on OpenOffice — Phillips said he couldn't comment on any product line — and on Sun's work in high-performance computing. Screven made it pretty clear the Sun vision of cloud computing does not fit with Oracle's; Oracle sees itself as a provider of infrastructure like virtualization to make clouds, not a provider of hosted services. As for who's staying and who's getting cut at Sun: Phillips said Oracle needs Sun, but warned 'tough decisions' will be coming. Don't forget, this is the company that couriered pink slips to the PeopleSoft staff it cut following that acquisition."

Slashdot Top Deals

Nothing succeeds like success. -- Alexandre Dumas

Working...