Posts Tagged ‘latency’

Typing with pleasure

Posted in Programming on December 20th, 2015 by Pavel – 57 Comments

Keyboard with a smileIn this article I examine human- and machine aspects of typing latency (“typing lag”) and present experimental data on latency of popular text / code editors. The article is inspired by my work on implementing “zero-latency typing” in IntelliJ IDEA.

Latency recently became a hot topic in computer world — now we have low-latency keyboards, 144 Hz monitors, special technologies to reduce latency (like FreeSync or G-Sync), dedicated communities and whatnot… Sure, a part of the buzz is marketing, however the truth is that low latency became both feasible and desirable.

Apparently, gamers are the first who gain form those advancements. In some areas, like virtual reality latency turned out to be a crucial factor, where even a single millisecond matters. But what about programmers? Do we need “typing with pleasure” to “develop with pleasure”? Let’s find out.

The article is also (independently) translated into Russian.

See also: Scrolling with pleasure.

Contents:

  1. Human side
    1.1. Feedback
    1.2. Motor skill
    1.3. Internal model
    1.4. Multisensory integration
    1.5. Effects
  2. Machine side
    2.1. Input latency
    2.2. Processing latency
    2.3. Output latency
    2.4. Total latency
  3. Editor benchmarks
    3.1. Configuration
    3.2. Methodology
    3.3. Windows
    3.4. Linux
    3.5. VirtualBox
  4. Summary
  5. Links
    Continue reading →

Typometer

Posted in Programming, Software on December 20th, 2015 by Pavel – 3 Comments

Technical drawing of keyboard keysTypometer is a tool to measure and analyze visual latency of text / code editors.

Editor latency is delay between an input event and a corresponding screen update, in particular case – delay between keystroke and character appearance. While there are many kinds of delays (caret movement, line editing, etc.), typing latency is a major predictor of editor usability.

Check my article Typing with pleasure to learn more about editor latency and its effects on typing performance.

Project source code is available as a GitHub repository.

Download: typometer-1.0.1-bin.zip (0.5 MB)

Java 8 or latter is required to run the program. You can download Java from the official site.
Continue reading →

Low-latency painting in AWT and Swing

Posted in Programming on December 20th, 2015 by Pavel – 7 Comments

00:00:00In this article I enumerate reasons why typical approach to painting in AWT / Swing can result in substantial visual lags, provide examples that demonstrate the problem and propose methods to significantly reduce the drawing latency.

Despite the focus on Java platform, the key ideas can be extended to most modern operation systems and GUI frameworks.

Contents:

  1. Problem statement
  2. Typical implementation
  3. Asynchronous painting
    3.1. Queue delay
    3.2. Request skip
    3.3. Region extension
    3.4. Component reordering
  4. Synchronous painting
    4.1. Component opacity
    4.2. Buffering overhead
    4.3. Showing delay
    4.4. Buffer reuse
  5. Active rendering
    5.1. Incremental painting
    5.2. Pipeline flush
  6. Summary

All key points are accompanied by short, shelf contained, compilable examples that clearly demonstrate the theoretical concepts in practice. The code is also accessible as a GitHub repository.
Continue reading →