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
I meant this project: https://github.com/node-gh/gh
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
(In reply to alexxcons from comment #2) > Posible duplicate: 15871 Not a duplicate .. 15871 is about trashing files
(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.
Andre Miranda referenced this bugreport in commit 06cf2124cdb4455ba3e79ec9ad677c9ac6ae4cf9 Delete native files faster (Bug #16641) https://git.xfce.org/xfce/thunar/commit?id=06cf2124cdb4455ba3e79ec9ad677c9ac6ae4cf9
Andre Miranda referenced this bugreport in commit 12a1b72b86d9632cad9e619d30128151692a1be2 Delete native files faster (Bug #16641) https://git.xfce.org/xfce/thunar/commit?id=12a1b72b86d9632cad9e619d30128151692a1be2
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.