CudaText: Cuda is slow to load files from external action (e.g. double click a file in file manager or desktop)

If I open a small file from CudaText window, using File > Open Recent or File > Open file, it opens instantly as expected.

But if I open from any external action, like double-clicking the same file from my file manager, from desktop, from browser downloads list… it always takes more than a second.

This is not a defect of the operation system, because other editors aren’t affected. If I use “Open with…” in my file manager context menu and choose to open with editors such as Kate, Sublime Text, SciTE… file loads instantly too, so it’s something to be improved in Cuda.

Tests were done with the window of tabbed editors already open, I’m not talking about the time it takes for the software to start, the window is already open and ready, it’s just about opening a new tab with the file.

It looks like Cuda does an unnecessary heavy and slow work to check if an instance is already open. As I said, when I open the file from within Cuda window it’s instant as it should be,

I use Linux.

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 1
  • Comments: 67 (24 by maintainers)

Commits related to this issue

Most upvoted comments

Compiling FPC 3.2.3 migtht be easy for me, but I did not find a source tar ball yet for this version. I’m not very familiar with fpcdeluxe and lazarus gui’s, but I’ll give it a try. This will take me some time.

This build is slow for me too.

From all the builds I tried, the only one fast for me is the one you posted here, now unavailable because you overwritten the file with this version from comment above.

I still have all of them here and I can confirm 100% of the time, the difference is very noticeable:

  • Cuda release: slow
  • Latest build from artist-linux: slow
  • Latest build from Alexey: slow
  • The build compiled by artist-linux on 2023/05/18: fast.

Supposedly, this is the only patch that works for me, since artist-linux said this was the change they made to compile the version that works fast for me: https://github.com/Alexey-T/CudaText/files/11509781/appuniqueinstance.patch.txt

Tumbleweed KDE Plasma.

You said you could upload the new binary with Alexey’s patch, I can test with it to check if your build is as slow for me as the one from Alexey.

If @pintassilgo can let us know his OS and Desktop env, I might try to reproduce the issue. Given some time of course.

Here’s my recording with your binary:

https://github.com/Alexey-T/CudaText/assets/5483864/d0f69021-07d2-435b-bee3-4195144078cc

Dropping the file into Cuda opens the file instantly.

But when I open the file externally from file manager, triggering the code to force single instance, there’s a noticeable delay.

But as I said, I’m fine with that, it’s small enough. It has already improved a lot with the patch.

Once the frame of the left window turns black and the mouse pointer stops moving, that is when the file starts to get opened; there’s hardly a noticable delay.

This is the patch: appuniqueinstance.patch.txt

But before this can be released it needs to be tested as it’s timer/timing related, especially on slow systems under load. Introducing new issues without fixing them is not an option of course.

Lowering the updatetimer was tried before I see, but without improvement. I did something simlilar but with a different result it seems, while there still is no noticable difference in Cudatext’s CPU usage.

This video captures Cudatext running on Artix Linux and opening several files from a file-manager: https://github.com/Alexey-T/CudaText/assets/76697611/722cd1b1-fec1-4609-b36f-6a21d5bf8fd3

The cudatext binary file - signed with my public Artix Dev key - can be downloaded from https://omniverse.artixlinux.org/x86_64/cudatext along with its sig file.

It’s the Qt5 version, but I can provide the GTK2 version as well if needed.

I’ll test later on an old laptop running under load and would very much like to know about your experiences while testing, including any stability or other issues. Also the Linux distro and if it’s on fast or slow hardware.

artist