sway icon indicating copy to clipboard operation
sway copied to clipboard

Extreme lag when transparency is drawn, only while using the pixman renderer

Open ThGrSoRu opened this issue 4 months ago • 4 comments

sway -d 2> ~/sway.log

  • Sway Version:

    • sway version 1.12-dev-0a740a2 (Jun 13 2025, branch 'master')
    • self compiled with meson configure build/ --buildtype=release -Db_lto=true
    • using sway from Arch repos results in the same issue
  • Debug Log:

  • Configuration File:

    • config
    • A vastly minimized config resulted in the same issue
  • Description:

    • Set WLR_RENDERER=pixman
    • Drag any window on top of another or use foot's scrollback search
    • Observe heavy lag and perf overhead as soon as the transparent preview rectangles are drawn or foot's overlay is drawn
    • setting client.focused's indicator color to #ffff0000, meaning no alpha, results in no lag for dragging windows

perf top -d 1 -F 1000 --call-graph dwarf for window dragging:

Click me
+   76.39%     0.12%  libpixman-1.so.0.46.2         [.] pixman_image_composite32
+   10.82%    10.82%  libpixman-1.so.0.46.2         [.] 0x00000000000785aa
+    9.53%     9.53%  libpixman-1.so.0.46.2         [.] 0x00000000000785a6
+    9.49%     9.49%  libpixman-1.so.0.46.2         [.] 0x00000000000785ae
+    9.30%     9.30%  libpixman-1.so.0.46.2         [.] 0x00000000000785b4
+    9.16%     9.16%  libpixman-1.so.0.46.2         [.] 0x00000000000785a2
+    7.42%     7.42%  libpixman-1.so.0.46.2         [.] 0x0000000000078560
     5.05%     5.05%  libpixman-1.so.0.46.2         [.] 0x000000000007859e
+    3.63%     0.01%  perf                          [.] deliver_event
     3.62%     3.62%  libpixman-1.so.0.46.2         [.] 0x0000000000078566
     3.50%     0.01%  perf                          [.] hist_entry_iter__add
     3.46%     0.01%  perf                          [.] __ordered_events__flush
     3.16%     3.16%  libpixman-1.so.0.46.2         [.] 0x000000000007856a
+    3.13%     0.01%  perf                          [.] __thread__resolve_callchain
     3.08%     3.08%  libpixman-1.so.0.46.2         [.] 0x000000000007859a
     2.96%     2.96%  libpixman-1.so.0.46.2         [.] 0x0000000000078596
     2.89%     0.01%  perf                          [.] unwind__get_entries
+    2.24%     0.06%  [kernel]                      [k] rt_spin_lock
+    2.21%     0.00%  libwlroots-0.20.so            [.] render_pass_add_rect
+    1.87%     0.02%  [kernel]                      [k] do_syscall_64
     1.82%     0.01%  [kernel]                      [k] entry_SYSCALL_64_after_hwframe
     1.43%     1.43%  libpixman-1.so.0.46.2         [.] 0x000000000007856e
+    1.33%     0.05%  [kernel]                      [k] asm_exc_page_fault
+    1.30%     0.02%  foot                          [.] render_worker_thread
+    1.24%     0.45%  foot                          [.] render_cell.isra.0
     1.24%     0.00%  libdw-0.193.so                [.] dwfl_thread_getframes
     1.20%     0.00%  libdw-0.193.so                [.] dwfl_getthread_frames
+    1.15%     0.02%  [kernel]                      [k] do_idle
     1.13%     0.00%  libdw-0.193.so                [.] dwfl_getthreads
     1.08%     0.00%  perf                          [.] frame_callback
+    1.05%     0.05%  [kernel]                      [k] exc_page_fault
+    1.04%     0.05%  [kernel]                      [k] process_scheduled_works
+    0.97%     0.01%  [kernel]                      [k] handle_mm_fault
+    0.90%     0.02%  [kernel]                      [k] __handle_mm_fault
     0.84%     0.00%  [kernel]                      [k] irq_thread
     0.83%     0.02%  perf                          [.] __report_module
+    0.79%     0.19%  libpixman-1.so.0.46.2         [.] pixman_image_fill_rectangles
     0.78%     0.06%  libdw-0.193.so                [.] dwarf_cfi_addrframe
     0.77%     0.05%  libc.so.6                     [.] __libc_calloc
+    0.76%     0.16%  libpixman-1.so.0.46.2         [.] pixman_image_fill_boxes
     0.75%     0.62%  libc.so.6                     [.] cfree
     0.73%     0.00%  [kernel]                      [k] cpuidle_enter

perf top -d 1 -F 1000 --call-graph dwarf for foot's scrollback search:

Click me
+   74.98%     0.01%  libpixman-1.so.0.46.2        [.] pixman_image_composite32
+   12.24%    12.24%  libpixman-1.so.0.46.2        [.] 0x000000000007bc80
+   12.21%    12.21%  libpixman-1.so.0.46.2        [.] 0x000000000007bc84
+   12.18%    12.18%  libpixman-1.so.0.46.2        [.] 0x000000000007bc8c
+   12.17%    12.17%  libpixman-1.so.0.46.2        [.] 0x000000000007bc7c
+   12.17%    12.17%  libpixman-1.so.0.46.2        [.] 0x000000000007bc96
+   12.13%    12.13%  libpixman-1.so.0.46.2        [.] 0x000000000007bc91
+   11.28%     0.00%  [unknown]                    [.] 0x00007fffffffd73f
+   11.28%     0.00%  libwlroots-0.20.so           [.] wlr_scene_output_build_state
+   11.28%     0.00%  libwlroots-0.20.so           [.] render_pass_add_texture
+    7.84%     0.01%  perf                         [.] deliver_event
+    7.37%     0.00%  perf                         [.] unwind__get_entries
+    6.72%     0.01%  perf                         [.] __ordered_events__flush
+    6.44%     0.01%  perf                         [.] hist_entry_iter__add
+    6.37%     0.01%  perf                         [.] __thread__resolve_callchain
+    5.54%     0.00%  perf                         [.] sample__resolve_callchain
     3.93%     2.47%  libc.so.6                    [.] __tsearch
+    3.77%     0.01%  perf                         [.] frame_callback
+    3.48%     0.14%  libdw-0.193.so               [.] dwarf_cfi_addrframe
     3.35%     0.02%  libdw-0.193.so               [.] dwfl_thread_getframes
+    3.28%     0.00%  libdw-0.193.so               [.] dwfl_frame_pc
+    1.88%     0.00%  libpixman-1.so.0.46.2        [.] 0x0000155554e64c96

ThGrSoRu avatar Jun 13 '25 07:06 ThGrSoRu