HNHacker News
TopNewBestAskShowJobs

vitalyd

80 karma · joined May 12, 2015

submissionscomments
vitalyd··on Random Acts of Optimization
>For example, error paths are generally very cold, but how is a compiler supposed to know that a path is an error path? They just look like regular conditionals.

At least for .NET that path is likely throwing an exception. If you don't have a profile, statically assuming those paths are cold is likely to be correct.

vitalyd··on Random Acts of Optimization
Profiling comes with its own baggage, nothing's perfect. A lot of times one actually knows the likely/unlikely paths at development time; that's certainly true for error conditions. It makes sense to inform the compiler of those cases using the builtins.
vitalyd··on Performance in Big Data Land: Every CPU cycle matters
Rust is exciting, no doubt, and I have high hopes for its adoption, but I've personally not seen/heard of any visible OSS big data style projects using it. I see Frank McSherry's stuff has been mentioned, but I think that's still his pet project (hopefully not putting words in his mouth).

But really I was using C++ as an example of something more fit for these types of projects than Java, it doesn't have to be only C++ of course.

vitalyd··on Performance in Big Data Land: Every CPU cycle matters
I think this trend may stop soon. There are already OSS big data projects written in more performant languages (e.g. c++) coming around (e.g. scylladb, cloudera's kudu).
vitalyd··on Performance in Big Data Land: Every CPU cycle matters
Memory indirection is the biggest issue indeed. However, I'd also add that java has a terrible performance model, as a language. Unless you stick to primitives only, the abstraction costs start to add up (beyond pointer chasing). It shoves the entire optimization burden onto the JVM which by the time it runs has lost a bunch of semantic and type information in some cases. There are also codegen deficiencies in current hotspot C2 compiler (i.e. generated code subpar compared to roughly equivalent gcc).
vitalyd··on Functional Reactive Programming in Java
You're getting to performance left on the table. Unfortunately, java and the existing JVM jit compilers will not fold away all the abstractions (nevermind the allocations if you have capturing lambdas).

Whether this matters is circumstantial, but for serious game dev it most definitely will.

vitalyd··on High-Speed Trading Firm Deleted Some Code by Accident
I'd be surprised if they didn't make postmortem changes to prevent such incidents in the future. Your posts in this thread imply that no mistake should ever happen, but let's be real - mistakes will always happen, the key is to do proper postmortem analysis and learn from them (and obviously prevent recurrences).
vitalyd··on Kudu – Fast Analytics on Fast Data
+1 on writing up a blog post on c++ vs java. I suspect given your background in java, people may heed your words a bit more than usual. There's definitely a lot of outdated thinking in java land with regards to (modern) c++ and accompanying toolchain. Many big data projects could benefit from being written in c++ rather than java (or another jvm language).
vitalyd··on Clarifications about Redis and Memcached
I think once you implement threaded i/o, requests for hot keys will hit in the cpu cache and you'll become NIC limited. At that point, read replicas is the best solution rather than shared memory since contention will move to NIC and adding more cpus won't help.

Edit: Salvatore, you should also look at the Seastar/ScyllaDB design (if you haven't yet) - that architecture would work well for redis as well. And if user has access to DPDK (or other kernel bypass enabled NICs, like Solarflare), their performance will go up even further.

vitalyd··on ScyllaDB: Drop-in replacement for Cassandra that claims to be 10x faster
>However, a lot of the IO overhead with disk, for example.

That's why they benchmarked this workload on a 4x SSD RAID configuration :). Given that i/o bandwidth and throughput continues to increase, processor frequency isn't, and core counts are going up, it's prudent to design a system that can take advantage of this.

vitalyd··on ScyllaDB: Drop-in replacement for Cassandra that claims to be 10x faster
I believe dpdk supports non-Intel NICs as well. Would also be interesting to compare scylla with kernel networking vs Cassandra.
vitalyd··on ScyllaDB: Drop-in replacement for Cassandra that claims to be 10x faster
http://www.scylladb.com/technology/memory/

By the way, I think you're replying to one of the devs of Scylla.

vitalyd··on ScyllaDB: Drop-in replacement for Cassandra that claims to be 10x faster
Not dedicated NIC per core, but multi-queue NIC having its queues serviced by dedicated cores.
vitalyd··on ScyllaDB: Drop-in replacement for Cassandra that claims to be 10x faster
Where did you get this from? I hope that's not a conclusion from the benchmark doing single server load testing.
vitalyd··on Go GC: Prioritizing low latency and simplicity
>It's fair to call it that when comparing against any language or runtime targetting general-purpose development

Unless you consider, e.g., C, C++, and Rust as not general-purpose. Even C# has StructLayout where you can control the struct layout. Heck, Go and C# allow you to embed a fixed size array into a struct (this facility is not in the works for Java at the moment).

vitalyd··on Go GC: Prioritizing low latency and simplicity
Padding is possible with today's java (at least Hotspot), although it's ugly and relies on Hotspot's existing layout implementation.

Yes, you can group but as I mentioned in the other reply, you get "blob" granularity/control. This is unlikely to be an issue for a value type instance itself, but say you want to have multiple value types (each with several fields) embedded into a heap allocated object. Assume this total embedded blog spans multiple cachelines, but you have clustered access patterns. So you've grouped some data together into value types, but you have no control over how that will be laid out in the "host" object.

Again, I'm happy that Oracle will be adding value types -- they will definitely help. I contend, however, that calling it "layout control" is a slight stretch in the general sense; it's perhaps fair to call it that when comparing against today's java, but not against languages that allow explicit field-by-field layout (along with padding, alignment, etc).

vitalyd··on Go GC: Prioritizing low latency and simplicity
>But value types do let you group fields (with sub-component values).

They let you treat the fields of a value type as a "blob", you have no control over how they're laid out within that blob.

>Also, I've noticed that whenever I say Java does X, you say, "Oh, no! It does X - ε!" Now, to me, that's nitpicking, especially considering that a perfect general-purpose language/runtime designed to be simple (for some definition of simple) should give you 90+% performance in 99% of general-purpose use cases (or 95% in 95% etc.). If it does any better then one of two possibilities is true: 1/ it's magic, or 2/ it's not a perfect simple language/runtime because it could have been made simpler (by whatever definition of simple it's chosen).

Nothing personal, but I find your JVM related posts as borderline fanboyism (and I say this as someone that greatly respects the engineering in Hotspot, despite certain things bugging me). It's not about 100% or 95% performance; it's about not making exaggerated claims since, as you say, there's no magic.

vitalyd··on Go GC: Prioritizing low latency and simplicity
This is mostly an issue for large objects (i.e. span multiple cache lines), but have different access patterns for various fields (i.e. clusters of fields accessed together).

The other aspect of layout control is cacheline padding, which is also not present in the JVM. There's @Contended, but it's a blunt tool and not currently a public API (it's in sun.misc).

>The fact that Java's optimizer is much better than that of Go will make a much larger difference in execution speed

Yes, but that's orthogonal.

vitalyd··on Go GC: Prioritizing low latency and simplicity
99.99% is perhaps your estimate, but not necessarily others. This is also not likely what people would consider "layout control" if they're coming from a language that allows field-level layout control. Being able to place frequently used together fields manually is quite useful in quite a few circumstances.
vitalyd··on Go GC: Prioritizing low latency and simplicity
I don't know if Azul Zing throughput is "extremely low" but it does sacrifice it for latency. I had a discussion with Gil Tene on this recently where he dove into some details: https://groups.google.com/forum/m/#!topic/mechanical-sympath...

In particular, the LVB is akin to an array range check on each reference read.

vitalyd··on Go GC: Prioritizing low latency and simplicity
Value types will provide ability to allocate storage embedded in heap object or stack, but it doesn't provide layout control (i.e. order of fields in the layout). It's a good change, but let's not exaggerate.
vitalyd··on Go GC: Prioritizing low latency and simplicity
Vtune gives access to PMU counters as well as attributing them to assembly. JProfiler is a purely java level profiler (it won't even tell you Hotspots in the JVM itself, nevermind assembly). They're not really comparable.
vitalyd··on Rust web framework, Iron
Maybe I didn't make myself clear. If you want to compare speed cross lang, take fastest impl of each and compare that; so long as we're talking about real compilers existing today.

Also, fundamentally C# and java aren't designed on zero-cost abstractions as core principle, which is fine in and of itself. Implementations try to recover performance but it's an uphill battle as compilers will always be limited by various constraints.

vitalyd··on Rust web framework, Iron
I'm aware of PackedObjects. Note it's not a value type in the sense it doesn't get allocated on the stack (if used as a local), it's a flattened object graph on heap with a shared header.

More to the point, implementations are interesting to compare when they're for the same language, but not so much across languages as languages have different semantics and features that dictate how amenable they are to optimization with today's compilation techniques.

vitalyd··on Rust web framework, Iron
Language vs implementation is Sufficiently Smart Compiler phrased differently. The main difference between Rust (and say C++) and .NET/Java is the former has a stronger performance model baked into the language which makes it easier to make an implementation fast.
vitalyd··on Rust web framework, Iron
Perhaps you're discounting the importance of LLVM and at the same time overestimating performance of some of the languages you mentioned.

.NET: type system has some performance oriented features, but JIT compiler isn't all that great (currently).

Java: java has terrible performance model but JVM does heavy lifting to recover a good amount. However, there are still problems once your perf targets get tighter and tighter (ergonomics also degrade the more you push performance).

vitalyd··on BEAM languages, Hindley–Milner type systems, and new technologies
Indeed, they have good marketing :). Don't get me wrong, I think Azul and its C4 GC is very nice. However, beyond some absolute best case on smallish heaps, I do not see it hitting guaranteed 20 micros on large server heaps. Also, Azul sacrifices some throughput in favor of minimizing GC latency, which is fine as most things need tradeoffs but should be mentioned (G1 also has lower throughput than parallel due to heavier write barriers).
vitalyd··on Ignition: V8 Interpreter
I got the same impression from a cursory read. Profiling in the interpreter has its downsides, chief among them is lack of inlining causing profiles sometimes to be less useful. Tiered compilation can help here, but requires more careful code cache management.
vitalyd··on Getting Garbage Collection for Free
JVMs can try to dynamically adjust their GC heuristics by trying to match pause time goals. The thing they'd be missing is a "global" scheduler that can inform it of upcoming work and its latency sensitivity.
vitalyd··on BEAM languages, Hindley–Milner type systems, and new technologies
I know Azul, it doesn't guarantee pauses of 20 micros; <10 millis maybe. G1 isn't even close.
← PreviousPage 2 of 4Next →