Querz / mcaselector

A tool to select chunks from Minecraft worlds for deletion or export.
MIT License
3.21k stars 175 forks source link

Incredibly slow on Linux (Mint 21.2) #460

Open jaymehta-g opened 8 months ago

jaymehta-g commented 8 months ago

Describe the bug Program works as expected but is painfully slow. Scrolling around the world, zooming, selecting/unselecting, all take several seconds for the screen to update.

To Reproduce Steps to reproduce the behavior:

  1. Follow the instructions for Linux installation "the simple way" from here
  2. When running the program with that java runtime the program runs incredibly slowly

Environment (please complete the following information):

Additional context Add any other context about the problem here, e.g.:

System:
  Kernel: 5.15.0-92-generic x86_64 bits: 64 compiler: gcc v: 11.4.0
    Desktop: Cinnamon 6.0.4 tk: GTK 3.24.33 wm: muffin vt: 7 dm: LightDM 1.30.0
    Distro: Linux Mint 21.3 Virginia base: Ubuntu 22.04 jammy
Machine:
  Type: Desktop Mobo: ASRock model: B365M Pro4 serial: <superuser required>
    UEFI: American Megatrends v: P4.40 date: 05/29/2020
CPU:
  Info: 8-core model: Intel Core i9-9900K bits: 64 type: MT MCP smt: enabled
    arch: Coffee Lake rev: D cache: L1: 512 KiB L2: 2 MiB L3: 16 MiB
  Speed (MHz): avg: 800 high: 801 min/max: 800/5000 cores: 1: 800 2: 800
    3: 800 4: 800 5: 800 6: 800 7: 800 8: 800 9: 800 10: 800 11: 800 12: 800
    13: 800 14: 800 15: 801 16: 800 bogomips: 115200
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
Graphics:
  Device-1: AMD Navi 23 [Radeon RX 6600/6600 XT/6600M] vendor: ASRock
    driver: amdgpu v: kernel pcie: speed: 16 GT/s lanes: 16 ports: active: DP-3
    empty: DP-1,DP-2,HDMI-A-1 bus-ID: 03:00.0 chip-ID: 1002:73ff
    class-ID: 0300
  Display: x11 server: X.Org v: 1.21.1.4 driver: X: loaded: amdgpu,ati
    unloaded: fbdev,modesetting,radeon,vesa gpu: amdgpu display-ID: :0
    screens: 1
  Screen-1: 0 s-res: 3072x1728 s-dpi: 120 s-size: 650x366mm (25.6x14.4")
    s-diag: 746mm (29.4")
  Monitor-1: DisplayPort-2 mapped: DP-3 model: Dell P2219H serial: <filter>
    res: 3072x1728 hz: 60 dpi: 164 size: 476x267mm (18.7x10.5")
    diag: 546mm (21.5") modes: max: 1920x1080 min: 720x400
  OpenGL: renderer: AMD Radeon RX 6600 XT (navi23 LLVM 15.0.7 DRM 3.42
  5.15.0-92-generic)
    v: 4.6 Mesa 23.0.4-0ubuntu1~22.04.1 direct render: Yes
Audio:
  Device-1: Intel 200 Series PCH HD Audio vendor: ASRock
    driver: snd_hda_intel v: kernel bus-ID: 00:1f.3 chip-ID: 8086:a2f0
    class-ID: 0403
  Device-2: AMD Navi 21 HDMI Audio [Radeon RX 6800/6800 XT / 6900 XT]
    driver: snd_hda_intel v: kernel pcie: speed: 16 GT/s lanes: 16
    bus-ID: 03:00.1 chip-ID: 1002:ab28 class-ID: 0403
  Sound Server-1: ALSA v: k5.15.0-92-generic running: yes
  Sound Server-2: PulseAudio v: 15.99.1 running: yes
  Sound Server-3: PipeWire v: 0.3.48 running: yes
Network:
  Device-1: Intel Ethernet I219-V vendor: ASRock driver: e1000e v: kernel
    port: N/A bus-ID: 00:1f.6 chip-ID: 8086:15b8 class-ID: 0200
  IF: eno1 state: up speed: 1000 Mbps duplex: full mac: <filter>
  IF-ID-1: docker0 state: down mac: <filter>
Drives:
  Local Storage: total: 465.76 GiB used: 54.81 GiB (11.8%)
  ID-1: /dev/sda vendor: Samsung model: SSD 860 EVO 500GB size: 465.76 GiB
    speed: 6.0 Gb/s type: SSD serial: <filter> rev: 3B6Q scheme: GPT
Partition:
  ID-1: / size: 167.03 GiB used: 54.78 GiB (32.8%) fs: ext4 dev: /dev/sda5
  ID-2: /boot/efi size: 96 MiB used: 31.1 MiB (32.4%) fs: vfat
    dev: /dev/sda1
Swap:
  ID-1: swap-1 type: file size: 1.58 GiB used: 0 KiB (0.0%) priority: -2
    file: /swapfile
Sensors:
  System Temperatures: cpu: 34.0 C mobo: N/A gpu: amdgpu temp: 33.0 C
    mem: 34.0 C
  Fan Speeds (RPM): N/A gpu: amdgpu fan: 0
Repos:
  Packages: 2399 apt: 2376 flatpak: 23
  No active apt repos in: /etc/apt/sources.list
  Active apt repos in: /etc/apt/sources.list.d/official-package-repositories.list
    1: deb http://packages.linuxmint.com virginia main upstream import backport
    2: deb http://archive.ubuntu.com/ubuntu jammy main restricted universe multiverse
    3: deb http://archive.ubuntu.com/ubuntu jammy-updates main restricted universe multiverse
    4: deb http://archive.ubuntu.com/ubuntu jammy-backports main restricted universe multiverse
    5: deb http://security.ubuntu.com/ubuntu/ jammy-security main restricted universe multiverse
  Active apt repos in: /etc/apt/sources.list.d/playit-cloud.list
    1: deb [signed-by=/etc/apt/trusted.gpg.d/playit.gpg] https://playit-cloud.github.io/ppa/data ./
  No active apt repos in: /etc/apt/sources.list.d/steam-beta.list
  Active apt repos in: /etc/apt/sources.list.d/steam-stable.list
    1: deb [arch=amd64,i386 signed-by=/usr/share/keyrings/steam.gpg] https://repo.steampowered.com/steam/ stable steam
    2: deb-src [arch=amd64,i386 signed-by=/usr/share/keyrings/steam.gpg] https://repo.steampowered.com/steam/ stable steam
  Active apt repos in: /etc/apt/sources.list.d/teamviewer.list
    1: deb [signed-by=/usr/share/keyrings/teamviewer-keyring.gpg] https://linux.teamviewer.com/deb stable main
  Active apt repos in: /etc/apt/sources.list.d/vscode.list
    1: deb [arch=amd64,arm64,armhf] http://packages.microsoft.com/repos/code stable main
Info:
  Processes: 365 Uptime: 2h 28m wakeups: 0 Memory: 15.54 GiB
  used: 3.23 GiB (20.8%) Init: systemd v: 249 runlevel: 5 Compilers:
  gcc: 11.4.0 alt: 11/12 Shell: Bash v: 5.1.16 running-in: gnome-terminal
  inxi: 3.3.13

nelind3 commented 8 months ago

Ive been having this issue on my setup too (first Fedora 38 and now Fedora 39 both exhibiting the issue). It seemed to run smoothly when i made the window smaller (ive been using that as a temporary fix) which makes it seem like its a rendering thing. I ran cpu profiling with visualvm and that indeed does seem to be where the slow down is coming from:

I first maximized mcaselector and opened a world, then started the profiling and began moving around in mcaselector a bit until i had gone on for a bit the results looked like this: linux_with_chunk_grid

Noticing the high usage on drawing the chunk grid i then turned it off and did it again yielding these results: linux_without_chunk_grid

I wonder if switching to a drawing method other than canvas (like the ones suggested here) would help. To me it seems a bit like the javafx canvas implementation on linux is just slow (though more testing and research is probably needed to confirm or deny that) so there might not be much else than switching to something more performant that can be done.

Addition: Researched a bit more and found mentions of some people experiencing slow downs because JavaFX was failing to use hardware acceleration however after checking that it wasnt that. JavaFX was using hardware acceleration just fine.

Seegras commented 2 months ago

"-Dprism.forceGPU=true" did the trick for me