! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
[PATCH] Delete files faster
Status:
RESOLVED: FIXED
Severity:
enhancement

Comments

Description Andre Miranda editbugs 2020-04-05 23:49:04 CEST
Created attachment 9676 
fast-delete.diff

The attached patch is an optimization based on Nemo: https://github.com/linuxmint/nemo/commit/1ff745e

Benchmark:
Grab this project and run "npm i": https://github.com/node-gh/
node_modules contains around 54k files
Thunar git master takes 1m32s to delete that folder (HDD here)
Thunar with this patch takes about 2s
Comment 1 Andre Miranda editbugs 2020-04-06 00:08:41 CEST
I meant this project: https://github.com/node-gh/gh
Comment 2 alexxcons editbugs 2020-04-06 00:32:23 CEST
42sec vs 4sec here (a SSD)  .. very nice !

+  if ((errsv = errno) == EEXIST)
+    errsv = ENOTEMPTY;
.. so errno is assigned to errsv in the if ? I would ad an extra line for readibility.
I dont get the comment above that if block .. so nautilus(thunar) expects G_IO_ERROR_NOT_FOUND ? Why we add ENOTEMPTY than instead ? Possibly comment is just outdated and can be removed.

Posible duplicate: 15871
Comment 3 alexxcons editbugs 2020-04-06 00:37:50 CEST
(In reply to alexxcons from comment #2)
> Posible duplicate: 15871
Not a duplicate .. 15871 is about trashing files
Comment 4 Andre Miranda editbugs 2020-04-06 17:52:07 CEST
(In reply to alexxcons from comment #2)
> .. so errno is assigned to errsv in the if ? I would ad an extra line for
> readibility.
That's my doing, I can change this before pushing.

> I dont get the comment above that if block .. so nautilus(thunar) expects
> G_IO_ERROR_NOT_FOUND ? Why we add ENOTEMPTY than instead ? Possibly comment
> is just outdated and can be removed.
Me neither, it was just there and I thought it'd safe to let it be.
Comment 5 Git Bot editbugs 2020-04-10 23:18:09 CEST
Andre Miranda referenced this bugreport in commit 06cf2124cdb4455ba3e79ec9ad677c9ac6ae4cf9

Delete native files faster (Bug #16641)

https://git.xfce.org/xfce/thunar/commit?id=06cf2124cdb4455ba3e79ec9ad677c9ac6ae4cf9
Comment 6 Git Bot editbugs 2020-04-10 23:18:32 CEST
Andre Miranda referenced this bugreport in commit 12a1b72b86d9632cad9e619d30128151692a1be2

Delete native files faster (Bug #16641)

https://git.xfce.org/xfce/thunar/commit?id=12a1b72b86d9632cad9e619d30128151692a1be2
Comment 7 Andre Miranda editbugs 2020-04-10 23:19:53 CEST
glib still contains that error handle snippet:
https://github.com/GNOME/glib/blob/fa76bde25282b40f108e52cc38e172aef13cfabb/gio/glocalfile.c#L1502

Anyway, I removed it because Thunar doesn't handle G_IO_ERROR_NOT_FOUND.

Bug #16641

Reported by:
Andre Miranda
Reported on: 2020-04-05
Last modified on: 2020-04-10

People

Assignee:
Xfce Bug Triage
CC List:
1 user

Version

Attachments

fast-delete.diff (3.40 KB, patch)
2020-04-05 23:49 CEST , Andre Miranda
no flags

Additional information