wtype icon indicating copy to clipboard operation
wtype copied to clipboard

Default delay isn't 0

Open danielgafni opened this issue 11 months ago • 1 comments

It's clear that there is some sort of a delay when running wtype without -d specified. Long texts take some time to get flushed. I'd like it to be immediate instead (ydotool type achieves that with delay set to 0).

danielgafni avatar Dec 17 '25 11:12 danielgafni

I measured an opt-in zero-delay batched implementation against a baseline that had already removed generated-key sleeps but retained wtype 0.4's per-event Wayland roundtrips.

Method: isolated headless Sway compositor with an Alacritty receiver; seven synthetic text profiles, 30 rounds each, for 210 trials per implementation. Both implementations produced exact output in 210/210 trials and exactly one Return per trial.

P50 results:

  • 53-character ASCII: 17.80 ms → 7.33 ms, a 2.43× speedup and 58.80% reduction
  • 53-character Unicode: 18.51 ms → 7.45 ms, a 2.49× speedup and 59.76% reduction
  • Three 481-character profiles: 103.32–104.29 ms → 10.65–11.43 ms, paired results of 9.13–9.75× speedup and 89.04–89.74% reduction

Important limits: this is not a comparison against stock wtype's default delay—the baseline already had generated-key sleeps set to zero. The measured gain is from batching complete press/release pairs instead of synchronizing each event. It is isolated headless output testing, not representative application/compositor compatibility testing or end-to-end speech latency.

The local patch therefore keeps the existing 2 ms behavior as the compatibility default and makes zero-delay batching explicit with --key-delay 0. Representative real-application testing is still needed before downstream projects should select it by default.

derekszen avatar Jul 18 '26 17:07 derekszen