Better HN
topnewbestaskshowjobs
Log inSign up

slashdev

17,493 karma · joined May 14, 2013 (13y ago) · 5,497 submissions

Founder of revscope.co

Revenue focused web analytics to help you quickly identify where to focus your effort to best increase revenue.

And embersofvictory.com

Retro turn-based strategy game.

Submissions

comment 10y ago · link · parent

That likely had more to do with the sugar than the acid in the juice.

4982.

Norway plans to cull more than two-thirds of its wolf population(theguardian.com ↗)

63 points · by eloff · 10y ago · 51 comments

comment 10y ago · link · parent

Sorry, yes I omitted that detail. You do need the cache flush still for each written cache line.

comment 10y ago · link · parent

This is a nice improvement. Now instead of having sfence/pcommit/sfence to flush writes to nvram, you would use just an sfence to ensure ordering with subsequent stores (e.g. a store that publishes the written data.)

Its analogous to fysnc() to ensure data reaches the disk in a way that survives power failure. This is like just treating all writes as fsynced and not needing to worry about fsync at all, like with O_DIRECT writes.

comment 10y ago · link · parent

I believe that Go routines are implemented as work-stealing under the hood. Idle threads pick up runable Go routines from other threads.

There was a design document about this from 4 years ago, but I'm not sure how well it reflects the current implementation:

https://docs.google.com/document/d/1TTj4T2JO42uD5ID9e89oa0sL...

comment 10y ago · link · parent

"TSMC’s 10nm shrink would retain a 20nm minimum feature size, while its 7nm would deliver a 14nm minimum feature size (10/20 and 7/14, respectively)."[1]

Intel is the only company with a "true" 14nm and 10nm process.

Considering the number of people that don't seem to realize TSMC 10nm != Intel 10nm, Intel should change their marketing.

[1] http://www.extremetech.com/computing/228806-arm-announces-ne...

comment 10y ago · link · parent

"TSMC’s 10nm shrink would retain a 20nm minimum feature size, while its 7nm would deliver a 14nm minimum feature size (10/20 and 7/14, respectively)."[1]

Intel is the only company with a "true" 14nm and 10nm process.

[1] http://www.extremetech.com/computing/228806-arm-announces-ne...

comment 10y ago · link · parent

This article is written by someone who clearly doesn't understand the industry well. And 10 nm for Intel is not directly comparable with 10 nm for TMC. Intel still maintains their fab lead by pretty much a whole process generation.

comment 10y ago · link · parent

> So all the author is saying is that giving a "black box" a lot of money, and letting it opaquely invest however it wants, will be a winning investment strategy in the future, even though right now it isn't working out so well.

That's the best description of a hedge fund that I've heard. Likewise, I don't see how that will ever be a winning investment strategy. You'd be better off with just an index ETF.

comment 10y ago · link · parent

It's an interesting technique that I haven't seen before in the context of a queue.

It's not without drawbacks, relying on handling sigsegv is a pain to make portable (libsigsegv helps!) HotSpot handles sigsegv, but I think it's possible to install your own handler as well by setting it before loading the JVM. When the JVM loads it will chain pre-existing signal handlers behind its own, and they'll be invoked if the signal doesn't pertain to HotSpot. LD_PRELOAD can be used to accomplish that. My information may only apply to an older version of HotSpot though, I don't know if that's still the case.

The other thing is relying on the TLB here becomes trickier with huge pages. It seems to me that the section and queue boundary trap pages are set just once at queue init and then never changed - so one could do the same with 2mb huge pages, without wasting memory, if the sections are sufficiently large. The problem is that requires the producer and consumer to be at least 2mb of queue apart, which is probably too much delay for many applications where latency is important. But I really don't see the need for huge pages here. A queue where both producer and consumer are repeatedly touching the same page seems like the ideal use case for the TLB anyway.

Not all applications can tolerate a sectioned queue though, for example what happens when the producer writes less than a full section of items to the queue and then pauses for a long time? The consumer won't be able to access that data until the producer finishes the section.

comment 10y ago · link · parent

Your reaction is like an Ostrich burying its head in the sand. A profane Ostrich.

It's unwise to ignore the unintended consequences of your actions, and that's still true even if you wish said consequences didn't exist.

comment 10y ago · link · parent

Between current value (what it should be fairly priced at) and future worth (what it may one day be priced at.) You know what I mean.

comment 10y ago · link · parent

Yes but that's a strawman. You also won't be paying the current value. You'll pay something between what it's worth now and what the market thinks it will be worth one day. That will be discounted for risk and for the delayed gratification.

comment 10y ago · link · parent

Ok. Effectively don't have to think about it 95% of the time then. Close enough.

comment 10y ago · link · parent

Bikeshedding much? I can't see this being a real problem. There are a lot of other decision that the Go team made, for better or for worse that have much greater effects on real code. Unused imports is a joke.

var _ = unusedImport

Or use goimports. Then you don't even have to think about it.

comment 10y ago · link · parent

No, that's not likely to happen. Photosynthesis is pretty inefficient, typical plants have a radiant energy to chemical energy conversion efficiency between 0.1% and 2%. Most commercially available solar panels have more than 10 times this efficiency.[1]

[1] http://physics.stackexchange.com/questions/109739/is-plant-p...

comment 10y ago · link · parent

I'm going to say yes, very much so.

Remember the carbon here is coming from the atmosphere, so it's carbon neutral and won't contribute to climate change.

If the process can be scaled up to produce a gallon of gasoline for less than the costs of extracting crude from the ground and refining it - then it will quickly kill off new investment into the fossil fuel extraction industry. As opposed to alternate energy technologies, like electric cars which will take a long time to replace internal combustion engine cars. It would use all of the existing infrastructure, so all it has to be is cheaper for market forces to work their magic.

That's a very big IF, however, so don't get your hopes up.

comment 10y ago · link · parent

Yeah, me as well. I'm not sure the benefits will outweigh the performance costs with this approach though.

All I'd really like to do is just map some nice really huge chunks of contiguous address space to memory in an efficient way. 1GB huge pages mostly work, but they're a little painful to code with. They must be statically allocated at boot time, balanced correctly between numa nodes, and mounted to a hugetlbfs filesystem in order to use MAP_SHARED.

comment 10y ago · link · parent

There are a number of performance advantages to a virtual DOM. That's why React uses a virtual DOM - unless you're also thoroughly convinced you know more than Facebook's engineers. Google the subject a little.

comment 10y ago · link · parent

According to Intel themselves[1], REP MOVS is optimal only for large copies, above about 2kb. Below that the large startup costs of the microcode sequence can be beaten by hand-written code for the target architecture. Which explains why glibc takes that approach. The linux kernel on the other hand, just goes with:

  shrq $3, %rcx
  andl $7, %edx
  rep movsq
  movl %edx, %ecx
  rep movsb
Torvalds justified it as a way to force Intel and AMD to do the right thing and optimize the rep movs* instructions. He was annoyed at the code complexity of "more optimal" apporaches, and like you, concerned about icache effects.

A hand-written memmove is faster in microbenchmarks, but the icache effects may make the overall performance difference smaller (or even negative.) That's harder to measure.

AFAIK glibc does get better results than the kernel approach, but they've also introduced bugs[3] that way and the code is very complex by comparison. Also worth noting is that the kernel usually runs with a cold(er) icache, which is why they compile for size rather than speed (last I checked anyway, which was long ago) and why their memmove may make more sense in the context of the kernel. Also I suspect copies in the kernel are more likely to be larger (e.g. packets, pages, blocks) as opposed to small objects in userspace.

[1] http://www.intel.com/content/www/us/en/architecture-and-tech...

[2] https://github.com/torvalds/linux/blob/master/arch/x86/lib/m...

[3] https://bugzilla.redhat.com/show_bug.cgi?id=638477#c99

comment 10y ago · link · parent

A more apt description of politics I have not seen.

comment 10y ago · link · parent

It did. That was part of the sad chain of events causing one of the biggest mass extinctions ever 250m years ago. Its one of the theories anyway.

comment 10y ago · link · parent

That's my way of thinking about it too. At any rate getting nearly 200 independent nation states to agree on anything when they all individually benefit by flouting the rules - that's madness. We'll burn oil and coal and gas until it doesn't make economic sense. I very much doubt politics will change the outcome. Technology will hopefully save us from ourselves on that front.

A bigger problem is positive feedback loops. Melting ice means more dark water to absorb sunlight, and more melting. Melting permafrost releases CO2 and Methane and causes more warming. And somewhere around ~5 degrees warming the frozen methane on the ocean floor will bubble up and cause the mother of all feedback cycles. We'd be in for about 10 degrees warming and a mass extinction that would wipe out 90% or more of all species on Earth. From what I've seen of global warming predictions we won't get there - but I'm mentioning this because at some point warming temperatures doesn't just mean major changes and flooding our cities - at some point it means a terrible calamity like the Earth has only occasionally seen.

comment 10y ago · link · parent

Yeah, I wouldn't do that, that graph is hardly accurate. 9ns won't get you a L3 cache hit on most skylake chips, nevermind main memory.

For sequential access giving a latency number doesn't make sense - you need to talk throughput. You can get upwards of 20gb/s with a single core for DRAM. Here you're at least bounded by the 4x PCI interface (more likely the Optane device) so maybe 3GB/s if you're feeling generous.

comment 10y ago · link · parent

DRAM does not have 1ns latency! On a 4ghz skylake chip you can access the L1 cache at 1ns. DRAM is going to be more in the range of 60(local)-100(remote) nanoseconds. Optane will likely be > 300ns latency from what I've heard, if you access it directly through the CPU memory controller via loads and stores, which is still very impressive.

comment 10y ago · link · parent

Bird flue is a big drawback - poultry and humans living in close contact, typically because they live in poverty is how the disease usually ends up jumping to humans (when it doesn't go the normal route via pigs first.)

comment 10y ago · link · parent

You and Lazare are right on the money. And the thing with the database is that the code that inserts/updates it has to agree with all the querying code about what the implicit schema should be - but it's implicit and scattered around your code - so on a large team it's very hard for everyone to understand that implicit contract and it's going to be a constant source of production bugs.

Schemas don't change that much compared to code, having a strict schema enforced by the database saves you so much time and pain and downtime in the long run.

comment 10y ago · link · parent

As a guy who works on ACID database internals, I'm appalled that people use MongoDB. You want a document store? Use Postgres. Why on earth would you use a database that makes so little in the way of guarantees about what results you get from it? I think most people have really low load and concurrency, so things seem to work. When things get busier you're in for a world of pain. Look I get that's it's easy to use and easy to get started with, but you're going to pay for all of that later.

comment 10y ago · link · parent

IronPython uses a combination of lock-free techniques and fine-grained locking. Reference counting is of course replaced with the .NET runtime GC. Single-threaded and multi-threaded performance suffers since this approach means pessimistically synchronizing all accesses, including those that are single-threaded.

comment 10y ago · link · parent

The C methods do unfortunately matter to all implementations. They gave thread safety and almost all Python code in the wild relies on that property, so it's become an undocumented property of the Python language specification and an intrinsic flaw of the language itself.
1
166167168
184