Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>It is not clear that you are really asking about realtime. There is a difference between realtime and real fast. For real fast, it is sufficient to consider the average case behavior. Throughput is the main concern. Realtime means be able to finish some task within a fixed amount of time each and every time. Or course, there are applications that need both.</p> <p>In a conventional Java implementation, such as OpenJDK, the garbage collector is the biggest problem for attaining realtime behavior. This is because the garbage collector can interrupt the program at any point to do its work. My company, aicas, has implementation of Java that does not require a separate thread for garbage collection. Instead, a bit of GC work is done at allocation time. Effectively, allocation is payed for by marking or sweeping a few blocks for each block freed. This has required a full reimplemenation of the virtual machine.</p> <p>Compilation is another point where realtime Java differs from conventional Java implementations. Realtime Java technology tends to use static or Ahead-of-Time (AoT) compilation instead of JIT compilation. JiT may be okay for your application, as you may be able to tolerate the "warm up" time required by a conventional VM to compile the most used classes. If this is so, than you probably do not have realtime requirements, just throughput ones.</p> <p>If you are interested in ensuring that frame decoding is not interrupted by garbage collection, then it would make sense to use a realtime implementation of Java and perhaps AoT compilation as well. The Real-Time Specification for Java (RTSJ) also provides other support for realtime and embedded programming such as RelatimeThread, AsyncEventHandler, and RawMemoryAccess.</p> <p>Of course, obtaining good performance, whether realtime or real fast, requires attention to details. The over use of temporary object is not helpful. Allocation always entails extra cost, so should be minimized. This is a major challenge for functional languages, which do not allow changing the state of object. However, one should take care to understand the critical paths of the code being written to avoid unnecessary optimizations. Profiling is essential for understanding where optimization effort is best spent.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload