[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#56355: 29.0.50; Implement file-parent-directory
From: |
daanturo |
Subject: |
bug#56355: 29.0.50; Implement file-parent-directory |
Date: |
Wed, 31 Aug 2022 17:26:24 +0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.0 |
About the comparator again, I hope that we use equal instead of file-equal-p.
The former gives far better performance.
Let my-parent-directory be a version of file-parent-directory with file-equal-p
replaced by equal, both are natively compiled.
```
(length recentf-list)
=> 659
(benchmark 1 '(mapcar 'my-parent-directory recentf-list))
=> "Elapsed time: 0.006954s"
(benchmark 1 '(mapcar 'file-parent-directory recentf-list))
=> "Elapsed time: 0.230073s"
```
That's about a 33-time difference in speed.
Also it's not like that (file-name-directory (directory-file-name <>)) is
supposed to resolve symbolic/hard links anyway.
--
Daanturo.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- bug#56355: 29.0.50; Implement file-parent-directory,
daanturo <=