SlideShare uma empresa Scribd logo
1 de 33
Baixar para ler offline
Code & Coffee #22
Low-latency Java:
breaking the boundaries
Ruslan Shevchenko
<ruslan@shevchenko.kiev.ia>
@rssh1
Overview
❖ What is low-latency and when it needed.
❖ LL-specific programming techniques:
❖ Concurrent flows
❖ Memory
❖ Layout issues,
❖ GC
❖ Unmanaged memory access.
❖ JNI
HPC != HPC
throughput
efficiency
speed
compromise
//low latency
low-latency java:
❖ Ineffective
❖ hardware is underused.
❖ Non-scalable
❖ operational range is strictly defined.
❖ Uncomfortable
❖ api reflect low-level details.
// needed: soft realtime
soft realtime
❖ trading (HTF)
❖ video/audio processing:
❖ orchestration infrastructure:
// NYSE trading floor.
// was closed for humans in 200
softrealtime: why JVM (?)
❖ Balance (99 % - ‘Usual code’, 1% -
soft realtime)
❖ crossing JVM boundaries is expensive.
❖ don’t do this. [if you can]
Softrealtime & JVM: Programming techniques.
❖ Don’t guess, know.
❖ Measure
❖ profiling [not alw. practical];
❖ sampling (jvm option: -hprof) [jvisualvm, jconsole, flight recorder]
❖ log safepoint / gc pauses
❖ Experiments
❖ benchmarks: http://openjdk.java.net/projects/code-tools/jmh/
❖ critical patch: N2N flow.
❖ Know details, how code is executed.
Programming techniques: Concurrent models
❖ Concurrent flows:
❖ minimise context switches:
❖ don’t switch [ number of flows < number of all
processor cores].
❖ Java: main-thread + service-thread + listener-
thread; [ user threads: cores-3 ]
❖ pin thread to core [thread affinity]
❖ JNI [JNA], exists OSS libraries [OpenHFT]
Programming techniques: data exchange
❖ Concurrent flows:
❖ data exchange between threads:
❖ each thread have own ‘local’ memory state.
// state can be unsynchronised
// local access is match faster than volatile
L1 cache: 0.3ns
L2 cache: 1ns
L3 cache: 10ns
RAM: 120ns
Volatile write = RAM write + invalidate cache lines.
❖ queue between threads is faster then shared access.
❖ locks are evil.
Programming techniques: memory issues
❖ GC
❖ young generation (relative short)
❖ full.
❖ [Stop-the-world], pause ~ heap size
❖ Contention
❖ flushing cache lines is expensive
Soft-realtime: memory
❖ Object: what is java object for the JVM ?
class Order
{
long id
int timestamp;
String symbol;
long price;
int quantity;
Side side;
boolean limit;
Party party;
Venue venue;
}
1002,t,”APPL”,p,q,Bu
y/Sell, Owner,
Venue.
Soft-realtime: memory
❖ Object: what is java object for the JVM ?
class Order
{
long id;
int timestamp;
String symbol;
long price;
int quantity;
Side side;
boolean limit;
Party party;
Venue venue;
}
t,”APPL”,p,q,Buy/
Sell, Owner, Venue.
header [64]:
class [32|64]
id [64]:
timestamp 32:
symbol [32-64];
price [64]
quantity[32]
side [32|64]
limit [32]
party [32|64]
venue [32|64]
… padding [0-63]
header,class:128
data: 64 “APPL”
header,class: 128
………..
header,class:128
………..
pointer (direct or compressed)
direct = address in memory
Soft-realtime: memory
❖ Object: what JMV do ?
Order order = new Order() // alloc 80 bytes from heap
// order in a local variables (GC root)
int t = order.getTimestamp(); // memory read
Party p = order.getParty(); // memory read
order.setParty(p1);
// memory write +
//mark object to be rechecked in next GC cycle
//can force GC is memory reached threshold.
Soft-realtime: memory
❖ How ‘idiomatic’ Java code will behave ?
List<Order> send = new ArrayList<>();
while(!buffer.isEmpty()) {
Order order = buffer.readOrder();
int fullPrice = order.price*order.quantity;
if (order.getParty().getLimit()+fullPrice > maxLimit) {
client.rejected(order,”party-limit”)
}else{
engine.process(order);
send.add(order);
}
}
Soft-realtime: memory
❖ How ‘idiomatic’ Java code will behave ?
List<Order> send = new ArrayList<>();
while(!buffer.isEmpty()) {
Order order = buffer.readOrder();
int fullPrice = order.price*order.quantity;
if (order.getParty().getLimit()+fullPrice > maxLimit) {
client.rejected(order,”party-limit”)
}else{
engine.process(order);
send.add(order);
}
}
- order will be created
- added to long-lived collections
will cause ‘StopTheWorld’
Soft-realtime: memory
❖ V1: Die young or live forever.
LongSet send = LongSet.create();
while(!buffer.isEmpty()) {
Order order = buffer.readOrder();
int fullPrice = order.price*order.quantity;
if (order.getParty().getLimit()+fullPrice > maxLimit) {
client.rejected(order,”party-limit”)
}else{
engine.process(order);
send.add(order.getId());
}
}
- order will be created
- collected in young generation
Soft-realtime: memory
❖ V2: Preallocate all.
LongSet send = LongSet.create();
Order order = new Order();
while(!buffer.isEmpty()) {
buffer.fillOrder(order);
int fullPrice = order.price*order.quantity;
if (order.getParty().getLimit()+fullPrice > maxLimit) {
client.rejected(order,”party-limit”)
}else{
engine.process(order);
send.add(order.getId());
}
}
- order will be created
- one ‘static’ object per thread
- no allocations.
Soft-realtime: memory
❖ V3: Access to serialised data instead object
class OrderAccess
{
static void getId(Buffer b,int offset)
{ return b.getLong(offset+0) }
static void putId(Buffer b, int offset, long id)
{ b.putLong(offset+0,id) }
static int getTimestamp(Buffer b, int offset)
{ return b.getInt(offset+8); }
……..
}
Soft-realtime: memory
❖ V3: Access to serialised data instead object
LongSet send = LongSet.create();
for(int offset=0; !buffer.atEnd(offset);
offset+=OrderAccess.SIZE) {
long price = OrderAccess.getPrice(buffer,offset);
int quantity = OrderAccess.getQuantity(buffer,offset);
int fullPrice = price * quantity;
long partyLimit = OrderAccess.getPartyLimit(buffer,offset
if (partyLimit > maxLimit) {
client.rejected(buffer,offset,”party-limit”)
}else{
engine.process(buffer,offset);
send.add(order.getId());
}
}
- no temporary objects
- no allocations
- slightly unusual API
Soft-realtime: memory
❖ V4: Offheap memory access via unsafe
sun.misc.Unsafe
❖ internal low-level sun API
❖ implemented by JIT intrinsic
❖ JVM crash on error
❖ widely used but not recommended
❖ will be deprecated in Java-9
❖ (removed in Java 10)
❖ (we will discuss alternatives)
class Unsafe
{
byte getByte(long addr)
void setByte(long addr, byte value)
….
byte getByte(Object value, long offs)
….
//same for primitive types.
….
// access to Object internals.
}
Soft-realtime: memory
❖ V4: Offheap memory access via unsafe
class OrderAccess
{
static void getId(long address)
{ return unsafe.getLong(address) }
static void putId(long address, long id)
{ unsafe.putLong(offset+0,id) }
static int getTimestamp(Buffer b, int offset)
{ return b.getInt(offset+8); }
……..
}
Soft-realtime: memory
❖ V4: Offheap memory access via unsafe
LongSet send = LongSet.create();
for(long address=buffer.begin; address!=buffer.end();
address=advance(address,OrderAccess.SIZE) ) {
long price = OrderAccess.getPrice(address);
int quantity = OrderAccess.getQuantity(address);
int fullPrice = price * quantity;
long partyLimit = OrderAccess.getPartyLimit(address)
if (partyLimit > maxLimit) {
client.rejected(address,”party-limit”)
}else{
engine.process(address);
send.add(order.getId());
}
}
- no allocations
- any memory
- subtle bugs are possible.
// better wrap by more hight-level interfaces (buffer, etc)
Soft-realtime: memory
❖ V3, V4 Problem: Verbose API
- bytecode transformation from more convenient API
- Metaprogramming within hight-level JVM languages.
http://scala-miniboxing.org/ildl/
https://github.com/densh/scala-offheap
- Integration with unmanaged languages
- JVM with time-limited GC pauses. [Azul Systems]
Memory access API in next JVM versions
❖ VarHandlers (like methodHandlers)
❖ inject custom logic for variable access
❖ JEP 193 http://openjdk.java.net/jeps/193
❖ Value objects.
❖ can be located on stack
❖ JEP 169. http://openjdk.java.net/jeps/169
❖ Own intrinsics [project Panama]
❖ insert assembler instructions into JIT code.
❖ http://openjdk.java.net/projects/panama/
❖ JEP 191. http://openjdk.java.net/jeps/191
❖ ObjectLayout [Arrays 2.0]
❖ better contention
❖ http://objectlayout.github.io/ObjectLayout/
Low latency Java: access to native code
❖ JNA
❖ (idea — API to build native stack call and get result)
❖ pro: not require packaging native libraries.
❖ cons: SLOWWWW (but one-time: ok)
❖ JNI
❖ (idea — bridge between JNI/native code)
❖ pro: faster than JNA, exists critical jni
❖ cons: need packaging native library
❖ Shares Memory
❖ (idea — use same binary address from native & jvm code)
❖ pro: fast
❖ cons: unsafe, unusual API
Low latency Java: JNI
❖ JNI
❖ (idea — bridge between JNI/native code)
❖ Java Object => Handle for native (maintain table)
❖ Callbacks are extremely slow
❖ Critical JNI
❖ not in official documentation
❖ substituted instead JNI after JI
// part of Cliff Click presentation
(advise for VM writers)
Low latency Java: JNI
❖ JNI
❖ (idea — bridge between JNI/native code)
❖ Java Object => Handle for native (maintain table)
❖ Callbacks are extremely slow
extern Java_nativeEventLoop(JEnv jenv, JObject job) {
while(!endOfBuffer(buff)) {
packet p = getData(buff);
if (checked(p)) {
processInJavaCallback(p);
}
}
}
C:
class JNIWrapper
{
void native eventLoop();
void processCallback(Packet p);
}
- p will be marshalled/ unmarshalled each time
- slow
Low latency Java: JNI
extern Java_nativeEvent(JEnv jenv, JObject job) {
static int state = START;
switch(state) {
case START:
state = LOOP;
while(! endOfBuffer()) {
case LOOP:
Packet p = readData();
if (checked(p)) {
return (long)p;
}
}
}
return -1;
}
class JNIWrapper
{
void native event();
void process(long packetAddr
}
…
for(;;) {
p=event();
if (p==-1L) break;
process(p);
}
// better use return instead callback
Low latency Java: JNI
❖ Critical JNI
❖ not in official documentation
❖ substituted instead JNI after JIT warm-up.
❖ only primitive types; static calls.
❖ must not be long-running. (GC is disabled)
extern long Java_nativeEvent(JEnv jenv, JObject job)
->
extern long JavaCritical_nativeEvent()
// want add timeout to satisfy ‘last’ condition
Low latency java: shared memory interface
❖ idea:
❖ spawn process or native thread.
❖ mmap file with given name to memory on ‘native
side’.
❖ mmap file with given name to memory on ‘java’ side.
❖ have shared memory persist to the same file in java &
native code.
Low latency Java/Native code data exchange
// buffer space
shared access
structure
struct BufferAccess
{
volatile long readIndex;
long[7] rpadding;
volatile long writeIndex;
long[7] wpadding;
}
C
class BufferAccessAccess // Java (example)
{
long getReadAddress(long baseAddr)
void setReadAddress(long baseAddr, long readAddr);
long getWriteAddress(long baseAddr)
}
base addr
Java
Low latency Java/fw
❖ Low-latency on JVM is
❖ possible
❖ sometimes non-trivial
❖ special techniques exists, in future will be better.
Thanks for attention.
❖ Questions ?
// ruslan@shevchenko.kiev.ua
// @rssh1
// https://github.com/rssh

Mais conteúdo relacionado

Mais procurados

Swift 2 Under the Hood - Gotober 2015
Swift 2 Under the Hood - Gotober 2015Swift 2 Under the Hood - Gotober 2015
Swift 2 Under the Hood - Gotober 2015Alex Blewitt
 
Swift - Under the Hood
Swift - Under the HoodSwift - Under the Hood
Swift - Under the HoodC4Media
 
A new execution model for Nashorn in Java 9
A new execution model for Nashorn in Java 9A new execution model for Nashorn in Java 9
A new execution model for Nashorn in Java 9Marcus Lagergren
 
Open Source Swift Under the Hood
Open Source Swift Under the HoodOpen Source Swift Under the Hood
Open Source Swift Under the HoodC4Media
 
Java Performance Tuning
Java Performance TuningJava Performance Tuning
Java Performance TuningMinh Hoang
 
Neo4 + Grails
Neo4 + GrailsNeo4 + Grails
Neo4 + Grailsstasimus
 
Concurrency Constructs Overview
Concurrency Constructs OverviewConcurrency Constructs Overview
Concurrency Constructs Overviewstasimus
 
2008 07-24 kwpm-threads_and_synchronization
2008 07-24 kwpm-threads_and_synchronization2008 07-24 kwpm-threads_and_synchronization
2008 07-24 kwpm-threads_and_synchronizationfangjiafu
 
Lagergren jvmls-2014-final
Lagergren jvmls-2014-finalLagergren jvmls-2014-final
Lagergren jvmls-2014-finalMarcus Lagergren
 
Using Smalltalk for controlling robotics systems
Using Smalltalk for controlling robotics systemsUsing Smalltalk for controlling robotics systems
Using Smalltalk for controlling robotics systemsSerge Stinckwich
 
The Ongoing Democratization of Robotics Development
The Ongoing Democratization of Robotics DevelopmentThe Ongoing Democratization of Robotics Development
The Ongoing Democratization of Robotics Developmentukdpe
 
Running Ruby on Solaris (RubyKaigi 2015, 12/Dec/2015)
Running Ruby on Solaris (RubyKaigi 2015, 12/Dec/2015)Running Ruby on Solaris (RubyKaigi 2015, 12/Dec/2015)
Running Ruby on Solaris (RubyKaigi 2015, 12/Dec/2015)ngotogenome
 
Chris Fregly, Research Scientist, PipelineIO at MLconf ATL 2016
Chris Fregly, Research Scientist, PipelineIO at MLconf ATL 2016Chris Fregly, Research Scientist, PipelineIO at MLconf ATL 2016
Chris Fregly, Research Scientist, PipelineIO at MLconf ATL 2016MLconf
 
An introduction and future of Ruby coverage library
An introduction and future of Ruby coverage libraryAn introduction and future of Ruby coverage library
An introduction and future of Ruby coverage librarymametter
 
WTF is Twisted?
WTF is Twisted?WTF is Twisted?
WTF is Twisted?hawkowl
 
Java 7 Whats New(), Whats Next() from Oredev
Java 7 Whats New(), Whats Next() from OredevJava 7 Whats New(), Whats Next() from Oredev
Java 7 Whats New(), Whats Next() from OredevMattias Karlsson
 

Mais procurados (19)

Swift 2 Under the Hood - Gotober 2015
Swift 2 Under the Hood - Gotober 2015Swift 2 Under the Hood - Gotober 2015
Swift 2 Under the Hood - Gotober 2015
 
Swift - Under the Hood
Swift - Under the HoodSwift - Under the Hood
Swift - Under the Hood
 
A new execution model for Nashorn in Java 9
A new execution model for Nashorn in Java 9A new execution model for Nashorn in Java 9
A new execution model for Nashorn in Java 9
 
Open Source Swift Under the Hood
Open Source Swift Under the HoodOpen Source Swift Under the Hood
Open Source Swift Under the Hood
 
Java Performance Tuning
Java Performance TuningJava Performance Tuning
Java Performance Tuning
 
How DSL works on Ruby
How DSL works on RubyHow DSL works on Ruby
How DSL works on Ruby
 
Neo4 + Grails
Neo4 + GrailsNeo4 + Grails
Neo4 + Grails
 
Concurrency Constructs Overview
Concurrency Constructs OverviewConcurrency Constructs Overview
Concurrency Constructs Overview
 
2008 07-24 kwpm-threads_and_synchronization
2008 07-24 kwpm-threads_and_synchronization2008 07-24 kwpm-threads_and_synchronization
2008 07-24 kwpm-threads_and_synchronization
 
Lagergren jvmls-2014-final
Lagergren jvmls-2014-finalLagergren jvmls-2014-final
Lagergren jvmls-2014-final
 
Using Smalltalk for controlling robotics systems
Using Smalltalk for controlling robotics systemsUsing Smalltalk for controlling robotics systems
Using Smalltalk for controlling robotics systems
 
IDLs
IDLsIDLs
IDLs
 
The Ongoing Democratization of Robotics Development
The Ongoing Democratization of Robotics DevelopmentThe Ongoing Democratization of Robotics Development
The Ongoing Democratization of Robotics Development
 
DSLs in JavaScript
DSLs in JavaScriptDSLs in JavaScript
DSLs in JavaScript
 
Running Ruby on Solaris (RubyKaigi 2015, 12/Dec/2015)
Running Ruby on Solaris (RubyKaigi 2015, 12/Dec/2015)Running Ruby on Solaris (RubyKaigi 2015, 12/Dec/2015)
Running Ruby on Solaris (RubyKaigi 2015, 12/Dec/2015)
 
Chris Fregly, Research Scientist, PipelineIO at MLconf ATL 2016
Chris Fregly, Research Scientist, PipelineIO at MLconf ATL 2016Chris Fregly, Research Scientist, PipelineIO at MLconf ATL 2016
Chris Fregly, Research Scientist, PipelineIO at MLconf ATL 2016
 
An introduction and future of Ruby coverage library
An introduction and future of Ruby coverage libraryAn introduction and future of Ruby coverage library
An introduction and future of Ruby coverage library
 
WTF is Twisted?
WTF is Twisted?WTF is Twisted?
WTF is Twisted?
 
Java 7 Whats New(), Whats Next() from Oredev
Java 7 Whats New(), Whats Next() from OredevJava 7 Whats New(), Whats Next() from Oredev
Java 7 Whats New(), Whats Next() from Oredev
 

Destaque

Low latency Java apps
Low latency Java appsLow latency Java apps
Low latency Java appsSimon Ritter
 
Low latency in java 8 by Peter Lawrey
Low latency in java 8 by Peter Lawrey Low latency in java 8 by Peter Lawrey
Low latency in java 8 by Peter Lawrey J On The Beach
 
Java Concurrency Quick Guide
Java Concurrency Quick GuideJava Concurrency Quick Guide
Java Concurrency Quick GuideAnton Shchastnyi
 
Presentation Erfolgreiche Software mit großartiger Dokumentation - Asciidoctor
Presentation Erfolgreiche Software mit großartiger Dokumentation - AsciidoctorPresentation Erfolgreiche Software mit großartiger Dokumentation - Asciidoctor
Presentation Erfolgreiche Software mit großartiger Dokumentation - AsciidoctorRobert Panzer
 
Robust and Scalable Concurrent Programming: Lesson from the Trenches
Robust and Scalable Concurrent Programming: Lesson from the TrenchesRobust and Scalable Concurrent Programming: Lesson from the Trenches
Robust and Scalable Concurrent Programming: Lesson from the TrenchesSangjin Lee
 
IBM Java PackedObjects
IBM Java PackedObjectsIBM Java PackedObjects
IBM Java PackedObjectsMarcel Mitran
 
Was jeder Java-Entwickler über Strings wissen sollte
Was jeder Java-Entwickler über Strings wissen sollteWas jeder Java-Entwickler über Strings wissen sollte
Was jeder Java-Entwickler über Strings wissen sollteberndmueller
 
(GAM404) Hunting Monsters in a Low-Latency Multiplayer Game on EC2
(GAM404) Hunting Monsters in a Low-Latency Multiplayer Game on EC2(GAM404) Hunting Monsters in a Low-Latency Multiplayer Game on EC2
(GAM404) Hunting Monsters in a Low-Latency Multiplayer Game on EC2Amazon Web Services
 
What are the Cool Kids Doing With Continuous Delivery?
What are the Cool Kids Doing With Continuous Delivery?What are the Cool Kids Doing With Continuous Delivery?
What are the Cool Kids Doing With Continuous Delivery?CA Technologies
 
A Post-Apocalyptic sun.misc.Unsafe World
A Post-Apocalyptic sun.misc.Unsafe WorldA Post-Apocalyptic sun.misc.Unsafe World
A Post-Apocalyptic sun.misc.Unsafe WorldChristoph Engelbert
 
Pitfalls of migrating projects to JDK 9
Pitfalls of migrating projects to JDK 9Pitfalls of migrating projects to JDK 9
Pitfalls of migrating projects to JDK 9Pavel Bucek
 
Technische Schulden in Architekturen erkennen und beseitigen
Technische Schulden in Architekturen erkennen und beseitigenTechnische Schulden in Architekturen erkennen und beseitigen
Technische Schulden in Architekturen erkennen und beseitigenCarola Lilienthal
 
Workshop: Introduction to the Disruptor
Workshop: Introduction to the DisruptorWorkshop: Introduction to the Disruptor
Workshop: Introduction to the DisruptorTrisha Gee
 
Java9 and the impact on Maven Projects (JFall 2016)
Java9 and the impact on Maven Projects (JFall 2016)Java9 and the impact on Maven Projects (JFall 2016)
Java9 and the impact on Maven Projects (JFall 2016)Robert Scholte
 
Introduction to the Disruptor
Introduction to the DisruptorIntroduction to the Disruptor
Introduction to the DisruptorTrisha Gee
 
Continuous Delivery and Infrastructure as Code
Continuous Delivery and Infrastructure as CodeContinuous Delivery and Infrastructure as Code
Continuous Delivery and Infrastructure as CodeSascha Möllering
 
Java 9 – The Ultimate Feature List
Java 9 – The Ultimate Feature ListJava 9 – The Ultimate Feature List
Java 9 – The Ultimate Feature ListTakipi
 

Destaque (20)

Low latency Java apps
Low latency Java appsLow latency Java apps
Low latency Java apps
 
Low latency in java 8 by Peter Lawrey
Low latency in java 8 by Peter Lawrey Low latency in java 8 by Peter Lawrey
Low latency in java 8 by Peter Lawrey
 
Java Concurrency Quick Guide
Java Concurrency Quick GuideJava Concurrency Quick Guide
Java Concurrency Quick Guide
 
Get Back in Control of your SQL
Get Back in Control of your SQLGet Back in Control of your SQL
Get Back in Control of your SQL
 
Die Java Plattform Strategie
Die Java Plattform StrategieDie Java Plattform Strategie
Die Java Plattform Strategie
 
Presentation Erfolgreiche Software mit großartiger Dokumentation - Asciidoctor
Presentation Erfolgreiche Software mit großartiger Dokumentation - AsciidoctorPresentation Erfolgreiche Software mit großartiger Dokumentation - Asciidoctor
Presentation Erfolgreiche Software mit großartiger Dokumentation - Asciidoctor
 
Robust and Scalable Concurrent Programming: Lesson from the Trenches
Robust and Scalable Concurrent Programming: Lesson from the TrenchesRobust and Scalable Concurrent Programming: Lesson from the Trenches
Robust and Scalable Concurrent Programming: Lesson from the Trenches
 
IBM Java PackedObjects
IBM Java PackedObjectsIBM Java PackedObjects
IBM Java PackedObjects
 
Was jeder Java-Entwickler über Strings wissen sollte
Was jeder Java-Entwickler über Strings wissen sollteWas jeder Java-Entwickler über Strings wissen sollte
Was jeder Java-Entwickler über Strings wissen sollte
 
(GAM404) Hunting Monsters in a Low-Latency Multiplayer Game on EC2
(GAM404) Hunting Monsters in a Low-Latency Multiplayer Game on EC2(GAM404) Hunting Monsters in a Low-Latency Multiplayer Game on EC2
(GAM404) Hunting Monsters in a Low-Latency Multiplayer Game on EC2
 
What are the Cool Kids Doing With Continuous Delivery?
What are the Cool Kids Doing With Continuous Delivery?What are the Cool Kids Doing With Continuous Delivery?
What are the Cool Kids Doing With Continuous Delivery?
 
A Post-Apocalyptic sun.misc.Unsafe World
A Post-Apocalyptic sun.misc.Unsafe WorldA Post-Apocalyptic sun.misc.Unsafe World
A Post-Apocalyptic sun.misc.Unsafe World
 
Pitfalls of migrating projects to JDK 9
Pitfalls of migrating projects to JDK 9Pitfalls of migrating projects to JDK 9
Pitfalls of migrating projects to JDK 9
 
Technische Schulden in Architekturen erkennen und beseitigen
Technische Schulden in Architekturen erkennen und beseitigenTechnische Schulden in Architekturen erkennen und beseitigen
Technische Schulden in Architekturen erkennen und beseitigen
 
Workshop: Introduction to the Disruptor
Workshop: Introduction to the DisruptorWorkshop: Introduction to the Disruptor
Workshop: Introduction to the Disruptor
 
Infrastructure as Code
Infrastructure as CodeInfrastructure as Code
Infrastructure as Code
 
Java9 and the impact on Maven Projects (JFall 2016)
Java9 and the impact on Maven Projects (JFall 2016)Java9 and the impact on Maven Projects (JFall 2016)
Java9 and the impact on Maven Projects (JFall 2016)
 
Introduction to the Disruptor
Introduction to the DisruptorIntroduction to the Disruptor
Introduction to the Disruptor
 
Continuous Delivery and Infrastructure as Code
Continuous Delivery and Infrastructure as CodeContinuous Delivery and Infrastructure as Code
Continuous Delivery and Infrastructure as Code
 
Java 9 – The Ultimate Feature List
Java 9 – The Ultimate Feature ListJava 9 – The Ultimate Feature List
Java 9 – The Ultimate Feature List
 

Semelhante a Low-latency Java Techniques

QEMU Disk IO Which performs Better: Native or threads?
QEMU Disk IO Which performs Better: Native or threads?QEMU Disk IO Which performs Better: Native or threads?
QEMU Disk IO Which performs Better: Native or threads?Pradeep Kumar
 
The State of Managed Runtimes 2013, by Attila Szegedi
The State of Managed Runtimes 2013, by Attila SzegediThe State of Managed Runtimes 2013, by Attila Szegedi
The State of Managed Runtimes 2013, by Attila SzegediZeroTurnaround
 
"You Don't Know NODE.JS" by Hengki Mardongan Sihombing (Urbanhire)
"You Don't Know NODE.JS" by Hengki Mardongan Sihombing (Urbanhire)"You Don't Know NODE.JS" by Hengki Mardongan Sihombing (Urbanhire)
"You Don't Know NODE.JS" by Hengki Mardongan Sihombing (Urbanhire)Tech in Asia ID
 
Evented Ruby VS Node.js
Evented Ruby VS Node.jsEvented Ruby VS Node.js
Evented Ruby VS Node.jsNitin Gupta
 
Engineer Engineering Software
Engineer Engineering SoftwareEngineer Engineering Software
Engineer Engineering SoftwareYung-Yu Chen
 
What’s Slowing Down Your Kafka Pipeline? With Ruizhe Cheng and Pete Stevenson...
What’s Slowing Down Your Kafka Pipeline? With Ruizhe Cheng and Pete Stevenson...What’s Slowing Down Your Kafka Pipeline? With Ruizhe Cheng and Pete Stevenson...
What’s Slowing Down Your Kafka Pipeline? With Ruizhe Cheng and Pete Stevenson...HostedbyConfluent
 
Talk 160920 @ Cat System Workshop
Talk 160920 @ Cat System WorkshopTalk 160920 @ Cat System Workshop
Talk 160920 @ Cat System WorkshopQuey-Liang Kao
 
(phpconftw2012) PHP as a Middleware in Embedded Systems
(phpconftw2012) PHP as a Middleware in Embedded Systems(phpconftw2012) PHP as a Middleware in Embedded Systems
(phpconftw2012) PHP as a Middleware in Embedded Systemssosorry
 
introduction to node.js
introduction to node.jsintroduction to node.js
introduction to node.jsorkaplan
 
GOTO Night with Charles Nutter Slides
GOTO Night with Charles Nutter SlidesGOTO Night with Charles Nutter Slides
GOTO Night with Charles Nutter SlidesAlexandra Masterson
 
Experiences with Microservices at Tuenti
Experiences with Microservices at TuentiExperiences with Microservices at Tuenti
Experiences with Microservices at TuentiAndrés Viedma Peláez
 
GeekCampSG - Nodejs , Websockets and Realtime Web
GeekCampSG - Nodejs , Websockets and Realtime WebGeekCampSG - Nodejs , Websockets and Realtime Web
GeekCampSG - Nodejs , Websockets and Realtime WebBhagaban Behera
 
Byteman and The Jokre, Sanne Grinovero (JBoss by RedHat)
Byteman and The Jokre, Sanne Grinovero (JBoss by RedHat)Byteman and The Jokre, Sanne Grinovero (JBoss by RedHat)
Byteman and The Jokre, Sanne Grinovero (JBoss by RedHat)OpenBlend society
 
Highly concurrent yet natural programming
Highly concurrent yet natural programmingHighly concurrent yet natural programming
Highly concurrent yet natural programmingInfinit
 
Jvm profiling under the hood
Jvm profiling under the hoodJvm profiling under the hood
Jvm profiling under the hoodRichardWarburton
 
Node js
Node jsNode js
Node jshazzaz
 
Node.js for Rubists
Node.js for RubistsNode.js for Rubists
Node.js for RubistsSagiv Ofek
 
Streaming 101: Hello World
Streaming 101:  Hello WorldStreaming 101:  Hello World
Streaming 101: Hello WorldJosh Fischer
 

Semelhante a Low-latency Java Techniques (20)

QEMU Disk IO Which performs Better: Native or threads?
QEMU Disk IO Which performs Better: Native or threads?QEMU Disk IO Which performs Better: Native or threads?
QEMU Disk IO Which performs Better: Native or threads?
 
The State of Managed Runtimes 2013, by Attila Szegedi
The State of Managed Runtimes 2013, by Attila SzegediThe State of Managed Runtimes 2013, by Attila Szegedi
The State of Managed Runtimes 2013, by Attila Szegedi
 
"You Don't Know NODE.JS" by Hengki Mardongan Sihombing (Urbanhire)
"You Don't Know NODE.JS" by Hengki Mardongan Sihombing (Urbanhire)"You Don't Know NODE.JS" by Hengki Mardongan Sihombing (Urbanhire)
"You Don't Know NODE.JS" by Hengki Mardongan Sihombing (Urbanhire)
 
Evented Ruby VS Node.js
Evented Ruby VS Node.jsEvented Ruby VS Node.js
Evented Ruby VS Node.js
 
Engineer Engineering Software
Engineer Engineering SoftwareEngineer Engineering Software
Engineer Engineering Software
 
What’s Slowing Down Your Kafka Pipeline? With Ruizhe Cheng and Pete Stevenson...
What’s Slowing Down Your Kafka Pipeline? With Ruizhe Cheng and Pete Stevenson...What’s Slowing Down Your Kafka Pipeline? With Ruizhe Cheng and Pete Stevenson...
What’s Slowing Down Your Kafka Pipeline? With Ruizhe Cheng and Pete Stevenson...
 
Talk 160920 @ Cat System Workshop
Talk 160920 @ Cat System WorkshopTalk 160920 @ Cat System Workshop
Talk 160920 @ Cat System Workshop
 
(phpconftw2012) PHP as a Middleware in Embedded Systems
(phpconftw2012) PHP as a Middleware in Embedded Systems(phpconftw2012) PHP as a Middleware in Embedded Systems
(phpconftw2012) PHP as a Middleware in Embedded Systems
 
introduction to node.js
introduction to node.jsintroduction to node.js
introduction to node.js
 
GOTO Night with Charles Nutter Slides
GOTO Night with Charles Nutter SlidesGOTO Night with Charles Nutter Slides
GOTO Night with Charles Nutter Slides
 
Node
NodeNode
Node
 
Experiences with Microservices at Tuenti
Experiences with Microservices at TuentiExperiences with Microservices at Tuenti
Experiences with Microservices at Tuenti
 
GeekCampSG - Nodejs , Websockets and Realtime Web
GeekCampSG - Nodejs , Websockets and Realtime WebGeekCampSG - Nodejs , Websockets and Realtime Web
GeekCampSG - Nodejs , Websockets and Realtime Web
 
Byteman and The Jokre, Sanne Grinovero (JBoss by RedHat)
Byteman and The Jokre, Sanne Grinovero (JBoss by RedHat)Byteman and The Jokre, Sanne Grinovero (JBoss by RedHat)
Byteman and The Jokre, Sanne Grinovero (JBoss by RedHat)
 
Highly concurrent yet natural programming
Highly concurrent yet natural programmingHighly concurrent yet natural programming
Highly concurrent yet natural programming
 
Jvm profiling under the hood
Jvm profiling under the hoodJvm profiling under the hood
Jvm profiling under the hood
 
Node js
Node jsNode js
Node js
 
Node.js for Rubists
Node.js for RubistsNode.js for Rubists
Node.js for Rubists
 
Get your teeth into Plack
Get your teeth into PlackGet your teeth into Plack
Get your teeth into Plack
 
Streaming 101: Hello World
Streaming 101:  Hello WorldStreaming 101:  Hello World
Streaming 101: Hello World
 

Mais de Ruslan Shevchenko

Embedding Generic Monadic Transformer into Scala. [Tfp2022]
Embedding Generic Monadic Transformer into Scala. [Tfp2022]Embedding Generic Monadic Transformer into Scala. [Tfp2022]
Embedding Generic Monadic Transformer into Scala. [Tfp2022]Ruslan Shevchenko
 
Papers We Love / Kyiv : PAXOS (and little about other consensuses )
Papers We Love / Kyiv :  PAXOS (and little about other consensuses )Papers We Love / Kyiv :  PAXOS (and little about other consensuses )
Papers We Love / Kyiv : PAXOS (and little about other consensuses )Ruslan Shevchenko
 
Scala / Technology evolution
Scala  / Technology evolutionScala  / Technology evolution
Scala / Technology evolutionRuslan Shevchenko
 
{co/contr} variance from LSP
{co/contr} variance  from LSP{co/contr} variance  from LSP
{co/contr} variance from LSPRuslan Shevchenko
 
Scala-Gopher: CSP-style programming techniques with idiomatic Scala.
Scala-Gopher: CSP-style programming techniques with idiomatic Scala.Scala-Gopher: CSP-style programming techniques with idiomatic Scala.
Scala-Gopher: CSP-style programming techniques with idiomatic Scala.Ruslan Shevchenko
 
SE 20016 - programming languages landscape.
SE 20016 - programming languages landscape.SE 20016 - programming languages landscape.
SE 20016 - programming languages landscape.Ruslan Shevchenko
 
Few simple-type-tricks in scala
Few simple-type-tricks in scalaFew simple-type-tricks in scala
Few simple-type-tricks in scalaRuslan Shevchenko
 
Jslab rssh: JS as language platform
Jslab rssh:  JS as language platformJslab rssh:  JS as language platform
Jslab rssh: JS as language platformRuslan Shevchenko
 
Behind OOD: domain modelling in post-OO world.
Behind OOD:  domain modelling in post-OO world.Behind OOD:  domain modelling in post-OO world.
Behind OOD: domain modelling in post-OO world.Ruslan Shevchenko
 
scala-gopher: async implementation of CSP for scala
scala-gopher:  async implementation of CSP  for  scalascala-gopher:  async implementation of CSP  for  scala
scala-gopher: async implementation of CSP for scalaRuslan Shevchenko
 
Programming Languages: some news for the last N years
Programming Languages: some news for the last N yearsProgramming Languages: some news for the last N years
Programming Languages: some news for the last N yearsRuslan Shevchenko
 
JDays Lviv 2014: Java8 vs Scala: Difference points & innovation stream
JDays Lviv 2014:  Java8 vs Scala:  Difference points & innovation streamJDays Lviv 2014:  Java8 vs Scala:  Difference points & innovation stream
JDays Lviv 2014: Java8 vs Scala: Difference points & innovation streamRuslan Shevchenko
 
Ruslan.shevchenko: most functional-day-kiev 2014
Ruslan.shevchenko: most functional-day-kiev 2014Ruslan.shevchenko: most functional-day-kiev 2014
Ruslan.shevchenko: most functional-day-kiev 2014Ruslan Shevchenko
 
Web architecture - overview of techniques.
Web architecture - overview of  techniques.Web architecture - overview of  techniques.
Web architecture - overview of techniques.Ruslan Shevchenko
 

Mais de Ruslan Shevchenko (20)

Embedding Generic Monadic Transformer into Scala. [Tfp2022]
Embedding Generic Monadic Transformer into Scala. [Tfp2022]Embedding Generic Monadic Transformer into Scala. [Tfp2022]
Embedding Generic Monadic Transformer into Scala. [Tfp2022]
 
Svitla talks 2021_03_25
Svitla talks 2021_03_25Svitla talks 2021_03_25
Svitla talks 2021_03_25
 
Akka / Lts behavior
Akka / Lts behaviorAkka / Lts behavior
Akka / Lts behavior
 
Papers We Love / Kyiv : PAXOS (and little about other consensuses )
Papers We Love / Kyiv :  PAXOS (and little about other consensuses )Papers We Love / Kyiv :  PAXOS (and little about other consensuses )
Papers We Love / Kyiv : PAXOS (and little about other consensuses )
 
Scala / Technology evolution
Scala  / Technology evolutionScala  / Technology evolution
Scala / Technology evolution
 
{co/contr} variance from LSP
{co/contr} variance  from LSP{co/contr} variance  from LSP
{co/contr} variance from LSP
 
N flavors of streaming
N flavors of streamingN flavors of streaming
N flavors of streaming
 
Scala-Gopher: CSP-style programming techniques with idiomatic Scala.
Scala-Gopher: CSP-style programming techniques with idiomatic Scala.Scala-Gopher: CSP-style programming techniques with idiomatic Scala.
Scala-Gopher: CSP-style programming techniques with idiomatic Scala.
 
SE 20016 - programming languages landscape.
SE 20016 - programming languages landscape.SE 20016 - programming languages landscape.
SE 20016 - programming languages landscape.
 
Few simple-type-tricks in scala
Few simple-type-tricks in scalaFew simple-type-tricks in scala
Few simple-type-tricks in scala
 
Scala jargon cheatsheet
Scala jargon cheatsheetScala jargon cheatsheet
Scala jargon cheatsheet
 
Csp scala wixmeetup2016
Csp scala wixmeetup2016Csp scala wixmeetup2016
Csp scala wixmeetup2016
 
R ext world/ useR! Kiev
R ext world/ useR!  KievR ext world/ useR!  Kiev
R ext world/ useR! Kiev
 
Jslab rssh: JS as language platform
Jslab rssh:  JS as language platformJslab rssh:  JS as language platform
Jslab rssh: JS as language platform
 
Behind OOD: domain modelling in post-OO world.
Behind OOD:  domain modelling in post-OO world.Behind OOD:  domain modelling in post-OO world.
Behind OOD: domain modelling in post-OO world.
 
scala-gopher: async implementation of CSP for scala
scala-gopher:  async implementation of CSP  for  scalascala-gopher:  async implementation of CSP  for  scala
scala-gopher: async implementation of CSP for scala
 
Programming Languages: some news for the last N years
Programming Languages: some news for the last N yearsProgramming Languages: some news for the last N years
Programming Languages: some news for the last N years
 
JDays Lviv 2014: Java8 vs Scala: Difference points & innovation stream
JDays Lviv 2014:  Java8 vs Scala:  Difference points & innovation streamJDays Lviv 2014:  Java8 vs Scala:  Difference points & innovation stream
JDays Lviv 2014: Java8 vs Scala: Difference points & innovation stream
 
Ruslan.shevchenko: most functional-day-kiev 2014
Ruslan.shevchenko: most functional-day-kiev 2014Ruslan.shevchenko: most functional-day-kiev 2014
Ruslan.shevchenko: most functional-day-kiev 2014
 
Web architecture - overview of techniques.
Web architecture - overview of  techniques.Web architecture - overview of  techniques.
Web architecture - overview of techniques.
 

Último

Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Velvetech LLC
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...Technogeeks
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesPhilip Schwarz
 
cpct NetworkING BASICS AND NETWORK TOOL.ppt
cpct NetworkING BASICS AND NETWORK TOOL.pptcpct NetworkING BASICS AND NETWORK TOOL.ppt
cpct NetworkING BASICS AND NETWORK TOOL.pptrcbcrtm
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfMarharyta Nedzelska
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceBrainSell Technologies
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfDrew Moseley
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsChristian Birchler
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfExploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfkalichargn70th171
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Natan Silnitsky
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...OnePlan Solutions
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesŁukasz Chruściel
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Hr365.us smith
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based projectAnoyGreter
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 

Último (20)

Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
 
cpct NetworkING BASICS AND NETWORK TOOL.ppt
cpct NetworkING BASICS AND NETWORK TOOL.pptcpct NetworkING BASICS AND NETWORK TOOL.ppt
cpct NetworkING BASICS AND NETWORK TOOL.ppt
 
Advantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your BusinessAdvantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your Business
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdf
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. Salesforce
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdf
 
Odoo Development Company in India | Devintelle Consulting Service
Odoo Development Company in India | Devintelle Consulting ServiceOdoo Development Company in India | Devintelle Consulting Service
Odoo Development Company in India | Devintelle Consulting Service
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfExploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New Features
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based project
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 

Low-latency Java Techniques

  • 1. Code & Coffee #22 Low-latency Java: breaking the boundaries Ruslan Shevchenko <ruslan@shevchenko.kiev.ia> @rssh1
  • 2. Overview ❖ What is low-latency and when it needed. ❖ LL-specific programming techniques: ❖ Concurrent flows ❖ Memory ❖ Layout issues, ❖ GC ❖ Unmanaged memory access. ❖ JNI
  • 4. low-latency java: ❖ Ineffective ❖ hardware is underused. ❖ Non-scalable ❖ operational range is strictly defined. ❖ Uncomfortable ❖ api reflect low-level details. // needed: soft realtime
  • 5. soft realtime ❖ trading (HTF) ❖ video/audio processing: ❖ orchestration infrastructure: // NYSE trading floor. // was closed for humans in 200
  • 6. softrealtime: why JVM (?) ❖ Balance (99 % - ‘Usual code’, 1% - soft realtime) ❖ crossing JVM boundaries is expensive. ❖ don’t do this. [if you can]
  • 7. Softrealtime & JVM: Programming techniques. ❖ Don’t guess, know. ❖ Measure ❖ profiling [not alw. practical]; ❖ sampling (jvm option: -hprof) [jvisualvm, jconsole, flight recorder] ❖ log safepoint / gc pauses ❖ Experiments ❖ benchmarks: http://openjdk.java.net/projects/code-tools/jmh/ ❖ critical patch: N2N flow. ❖ Know details, how code is executed.
  • 8. Programming techniques: Concurrent models ❖ Concurrent flows: ❖ minimise context switches: ❖ don’t switch [ number of flows < number of all processor cores]. ❖ Java: main-thread + service-thread + listener- thread; [ user threads: cores-3 ] ❖ pin thread to core [thread affinity] ❖ JNI [JNA], exists OSS libraries [OpenHFT]
  • 9. Programming techniques: data exchange ❖ Concurrent flows: ❖ data exchange between threads: ❖ each thread have own ‘local’ memory state. // state can be unsynchronised // local access is match faster than volatile L1 cache: 0.3ns L2 cache: 1ns L3 cache: 10ns RAM: 120ns Volatile write = RAM write + invalidate cache lines. ❖ queue between threads is faster then shared access. ❖ locks are evil.
  • 10. Programming techniques: memory issues ❖ GC ❖ young generation (relative short) ❖ full. ❖ [Stop-the-world], pause ~ heap size ❖ Contention ❖ flushing cache lines is expensive
  • 11. Soft-realtime: memory ❖ Object: what is java object for the JVM ? class Order { long id int timestamp; String symbol; long price; int quantity; Side side; boolean limit; Party party; Venue venue; } 1002,t,”APPL”,p,q,Bu y/Sell, Owner, Venue.
  • 12. Soft-realtime: memory ❖ Object: what is java object for the JVM ? class Order { long id; int timestamp; String symbol; long price; int quantity; Side side; boolean limit; Party party; Venue venue; } t,”APPL”,p,q,Buy/ Sell, Owner, Venue. header [64]: class [32|64] id [64]: timestamp 32: symbol [32-64]; price [64] quantity[32] side [32|64] limit [32] party [32|64] venue [32|64] … padding [0-63] header,class:128 data: 64 “APPL” header,class: 128 ……….. header,class:128 ……….. pointer (direct or compressed) direct = address in memory
  • 13. Soft-realtime: memory ❖ Object: what JMV do ? Order order = new Order() // alloc 80 bytes from heap // order in a local variables (GC root) int t = order.getTimestamp(); // memory read Party p = order.getParty(); // memory read order.setParty(p1); // memory write + //mark object to be rechecked in next GC cycle //can force GC is memory reached threshold.
  • 14. Soft-realtime: memory ❖ How ‘idiomatic’ Java code will behave ? List<Order> send = new ArrayList<>(); while(!buffer.isEmpty()) { Order order = buffer.readOrder(); int fullPrice = order.price*order.quantity; if (order.getParty().getLimit()+fullPrice > maxLimit) { client.rejected(order,”party-limit”) }else{ engine.process(order); send.add(order); } }
  • 15. Soft-realtime: memory ❖ How ‘idiomatic’ Java code will behave ? List<Order> send = new ArrayList<>(); while(!buffer.isEmpty()) { Order order = buffer.readOrder(); int fullPrice = order.price*order.quantity; if (order.getParty().getLimit()+fullPrice > maxLimit) { client.rejected(order,”party-limit”) }else{ engine.process(order); send.add(order); } } - order will be created - added to long-lived collections will cause ‘StopTheWorld’
  • 16. Soft-realtime: memory ❖ V1: Die young or live forever. LongSet send = LongSet.create(); while(!buffer.isEmpty()) { Order order = buffer.readOrder(); int fullPrice = order.price*order.quantity; if (order.getParty().getLimit()+fullPrice > maxLimit) { client.rejected(order,”party-limit”) }else{ engine.process(order); send.add(order.getId()); } } - order will be created - collected in young generation
  • 17. Soft-realtime: memory ❖ V2: Preallocate all. LongSet send = LongSet.create(); Order order = new Order(); while(!buffer.isEmpty()) { buffer.fillOrder(order); int fullPrice = order.price*order.quantity; if (order.getParty().getLimit()+fullPrice > maxLimit) { client.rejected(order,”party-limit”) }else{ engine.process(order); send.add(order.getId()); } } - order will be created - one ‘static’ object per thread - no allocations.
  • 18. Soft-realtime: memory ❖ V3: Access to serialised data instead object class OrderAccess { static void getId(Buffer b,int offset) { return b.getLong(offset+0) } static void putId(Buffer b, int offset, long id) { b.putLong(offset+0,id) } static int getTimestamp(Buffer b, int offset) { return b.getInt(offset+8); } …….. }
  • 19. Soft-realtime: memory ❖ V3: Access to serialised data instead object LongSet send = LongSet.create(); for(int offset=0; !buffer.atEnd(offset); offset+=OrderAccess.SIZE) { long price = OrderAccess.getPrice(buffer,offset); int quantity = OrderAccess.getQuantity(buffer,offset); int fullPrice = price * quantity; long partyLimit = OrderAccess.getPartyLimit(buffer,offset if (partyLimit > maxLimit) { client.rejected(buffer,offset,”party-limit”) }else{ engine.process(buffer,offset); send.add(order.getId()); } } - no temporary objects - no allocations - slightly unusual API
  • 20. Soft-realtime: memory ❖ V4: Offheap memory access via unsafe sun.misc.Unsafe ❖ internal low-level sun API ❖ implemented by JIT intrinsic ❖ JVM crash on error ❖ widely used but not recommended ❖ will be deprecated in Java-9 ❖ (removed in Java 10) ❖ (we will discuss alternatives) class Unsafe { byte getByte(long addr) void setByte(long addr, byte value) …. byte getByte(Object value, long offs) …. //same for primitive types. …. // access to Object internals. }
  • 21. Soft-realtime: memory ❖ V4: Offheap memory access via unsafe class OrderAccess { static void getId(long address) { return unsafe.getLong(address) } static void putId(long address, long id) { unsafe.putLong(offset+0,id) } static int getTimestamp(Buffer b, int offset) { return b.getInt(offset+8); } …….. }
  • 22. Soft-realtime: memory ❖ V4: Offheap memory access via unsafe LongSet send = LongSet.create(); for(long address=buffer.begin; address!=buffer.end(); address=advance(address,OrderAccess.SIZE) ) { long price = OrderAccess.getPrice(address); int quantity = OrderAccess.getQuantity(address); int fullPrice = price * quantity; long partyLimit = OrderAccess.getPartyLimit(address) if (partyLimit > maxLimit) { client.rejected(address,”party-limit”) }else{ engine.process(address); send.add(order.getId()); } } - no allocations - any memory - subtle bugs are possible. // better wrap by more hight-level interfaces (buffer, etc)
  • 23. Soft-realtime: memory ❖ V3, V4 Problem: Verbose API - bytecode transformation from more convenient API - Metaprogramming within hight-level JVM languages. http://scala-miniboxing.org/ildl/ https://github.com/densh/scala-offheap - Integration with unmanaged languages - JVM with time-limited GC pauses. [Azul Systems]
  • 24. Memory access API in next JVM versions ❖ VarHandlers (like methodHandlers) ❖ inject custom logic for variable access ❖ JEP 193 http://openjdk.java.net/jeps/193 ❖ Value objects. ❖ can be located on stack ❖ JEP 169. http://openjdk.java.net/jeps/169 ❖ Own intrinsics [project Panama] ❖ insert assembler instructions into JIT code. ❖ http://openjdk.java.net/projects/panama/ ❖ JEP 191. http://openjdk.java.net/jeps/191 ❖ ObjectLayout [Arrays 2.0] ❖ better contention ❖ http://objectlayout.github.io/ObjectLayout/
  • 25. Low latency Java: access to native code ❖ JNA ❖ (idea — API to build native stack call and get result) ❖ pro: not require packaging native libraries. ❖ cons: SLOWWWW (but one-time: ok) ❖ JNI ❖ (idea — bridge between JNI/native code) ❖ pro: faster than JNA, exists critical jni ❖ cons: need packaging native library ❖ Shares Memory ❖ (idea — use same binary address from native & jvm code) ❖ pro: fast ❖ cons: unsafe, unusual API
  • 26. Low latency Java: JNI ❖ JNI ❖ (idea — bridge between JNI/native code) ❖ Java Object => Handle for native (maintain table) ❖ Callbacks are extremely slow ❖ Critical JNI ❖ not in official documentation ❖ substituted instead JNI after JI // part of Cliff Click presentation (advise for VM writers)
  • 27. Low latency Java: JNI ❖ JNI ❖ (idea — bridge between JNI/native code) ❖ Java Object => Handle for native (maintain table) ❖ Callbacks are extremely slow extern Java_nativeEventLoop(JEnv jenv, JObject job) { while(!endOfBuffer(buff)) { packet p = getData(buff); if (checked(p)) { processInJavaCallback(p); } } } C: class JNIWrapper { void native eventLoop(); void processCallback(Packet p); } - p will be marshalled/ unmarshalled each time - slow
  • 28. Low latency Java: JNI extern Java_nativeEvent(JEnv jenv, JObject job) { static int state = START; switch(state) { case START: state = LOOP; while(! endOfBuffer()) { case LOOP: Packet p = readData(); if (checked(p)) { return (long)p; } } } return -1; } class JNIWrapper { void native event(); void process(long packetAddr } … for(;;) { p=event(); if (p==-1L) break; process(p); } // better use return instead callback
  • 29. Low latency Java: JNI ❖ Critical JNI ❖ not in official documentation ❖ substituted instead JNI after JIT warm-up. ❖ only primitive types; static calls. ❖ must not be long-running. (GC is disabled) extern long Java_nativeEvent(JEnv jenv, JObject job) -> extern long JavaCritical_nativeEvent() // want add timeout to satisfy ‘last’ condition
  • 30. Low latency java: shared memory interface ❖ idea: ❖ spawn process or native thread. ❖ mmap file with given name to memory on ‘native side’. ❖ mmap file with given name to memory on ‘java’ side. ❖ have shared memory persist to the same file in java & native code.
  • 31. Low latency Java/Native code data exchange // buffer space shared access structure struct BufferAccess { volatile long readIndex; long[7] rpadding; volatile long writeIndex; long[7] wpadding; } C class BufferAccessAccess // Java (example) { long getReadAddress(long baseAddr) void setReadAddress(long baseAddr, long readAddr); long getWriteAddress(long baseAddr) } base addr Java
  • 32. Low latency Java/fw ❖ Low-latency on JVM is ❖ possible ❖ sometimes non-trivial ❖ special techniques exists, in future will be better.
  • 33. Thanks for attention. ❖ Questions ? // ruslan@shevchenko.kiev.ua // @rssh1 // https://github.com/rssh