Eliot Miranda uploaded a new version of Files to project The Trunk: http://source.squeak.org/trunk/Files-eem.195.mcz
==================== Summary ====================
Name: Files-eem.195 Author: eem Time: 13 July 2022, 9:09:36.427827 pm UUID: 7ccbfb5c-e5d3-4911-9497-09fdc484d09c Ancestors: Files-eem.194
Occasionally FileDirectory>>exists fails. The old implementation seems unreliable, but it's also slow. So if possible, implement it above primLookupEntryIn:name:
Old: | foo bar baz | foo := FileDirectory on: '/no/where/at/all'. bar := FileDirectory on: '/Users/eliot/Desktop/not there'. baz := FileDirectory default. [foo exists. bar exists. baz exists] bench '8,070 per second. 124 microseconds per run. 0 % GC time.'
New: | foo bar baz | foo := FileDirectory on: '/no/where/at/all'. bar := FileDirectory on: '/Users/eliot/Desktop/not there'. baz := FileDirectory default. [foo exists. bar exists. baz exists] bench '73,700 per second. 13.6 microseconds per run. 0.64 % GC time.'
=============== Diff against Files-eem.194 ===============
Item was changed: ----- Method: FileDirectory>>exists (in category 'testing') ----- exists + "Answer whether the directory exists" + ^self class currentDirectoryNickname + ifNotNil: + [:me| + (self primLookupEntryIn: pathName asVmPathName name: me asVmPathName) + ifNil: [false] + ifNotNil: [:maybeErr| maybeErr ~~ #primFailed]] + ifNil: + [(self primLookupEntryIn: pathName asVmPathName index: 1) ~~ #badDirectoryPath]! - "Answer whether the directory exists" - - | result | - result := self primLookupEntryIn: pathName asVmPathName index: 1. - ^ result ~= #badDirectoryPath - !
Much smaller improvement on Windows but still nice to have. Old: '10,100 per second. 98.6 microseconds per run. 0 % GC time.' New: '14,700 per second. 67.8 microseconds per run. 0 % GC time.'
(paths used '\no\where\at\all', '\Users\eliot\Desktop\not there' FileDirectory default)
On Wed, Jul 13, 2022 at 9:09 PM commits@source.squeak.org wrote:
Eliot Miranda uploaded a new version of Files to project The Trunk: http://source.squeak.org/trunk/Files-eem.195.mcz
==================== Summary ====================
Name: Files-eem.195 Author: eem Time: 13 July 2022, 9:09:36.427827 pm UUID: 7ccbfb5c-e5d3-4911-9497-09fdc484d09c Ancestors: Files-eem.194
Occasionally FileDirectory>>exists fails. The old implementation seems unreliable, but it's also slow. So if possible, implement it above primLookupEntryIn:name:
Old: | foo bar baz | foo := FileDirectory on: '/no/where/at/all'. bar := FileDirectory on: '/Users/eliot/Desktop/not there'. baz := FileDirectory default. [foo exists. bar exists. baz exists] bench '8,070 per second. 124 microseconds per run. 0 % GC time.'
New: | foo bar baz | foo := FileDirectory on: '/no/where/at/all'. bar := FileDirectory on: '/Users/eliot/Desktop/not there'. baz := FileDirectory default. [foo exists. bar exists. baz exists] bench '73,700 per second. 13.6 microseconds per run. 0.64 % GC time.'
=============== Diff against Files-eem.194 ===============
Item was changed: ----- Method: FileDirectory>>exists (in category 'testing') ----- exists
"Answer whether the directory exists"
^self class currentDirectoryNickname
ifNotNil:
[:me|
(self primLookupEntryIn: pathName asVmPathName
name: me asVmPathName)
ifNil: [false]
ifNotNil: [:maybeErr| maybeErr ~~
#primFailed]]
ifNil:
[(self primLookupEntryIn: pathName asVmPathName
index: 1) ~~ #badDirectoryPath]!
- "Answer whether the directory exists"
| result |
result := self primLookupEntryIn: pathName asVmPathName index: 1.
^ result ~= #badDirectoryPath
- !
Thanks! Especially for the benchmarks. :-)
Best, Marcel Am 14.07.2022 06:27:28 schrieb Eliot Miranda eliot.miranda@gmail.com: Much smaller improvement on Windows but still nice to have. Old: '10,100 per second. 98.6 microseconds per run. 0 % GC time.' New: '14,700 per second. 67.8 microseconds per run. 0 % GC time.'
(paths used '\no\where\at\all', '\Users\eliot\Desktop\not there' FileDirectory default)
On Wed, Jul 13, 2022 at 9:09 PM <commits@source.squeak.org [mailto:commits@source.squeak.org]> wrote:
Eliot Miranda uploaded a new version of Files to project The Trunk: http://source.squeak.org/trunk/Files-eem.195.mcz [http://source.squeak.org/trunk/Files-eem.195.mcz]
==================== Summary ====================
Name: Files-eem.195 Author: eem Time: 13 July 2022, 9:09:36.427827 pm UUID: 7ccbfb5c-e5d3-4911-9497-09fdc484d09c Ancestors: Files-eem.194
Occasionally FileDirectory>>exists fails. The old implementation seems unreliable, but it's also slow. So if possible, implement it above primLookupEntryIn:name:
Old: | foo bar baz | foo := FileDirectory on: '/no/where/at/all'. bar := FileDirectory on: '/Users/eliot/Desktop/not there'. baz := FileDirectory default. [foo exists. bar exists. baz exists] bench '8,070 per second. 124 microseconds per run. 0 % GC time.'
New: | foo bar baz | foo := FileDirectory on: '/no/where/at/all'. bar := FileDirectory on: '/Users/eliot/Desktop/not there'. baz := FileDirectory default. [foo exists. bar exists. baz exists] bench '73,700 per second. 13.6 microseconds per run. 0.64 % GC time.'
=============== Diff against Files-eem.194 ===============
Item was changed: ----- Method: FileDirectory>>exists (in category 'testing') ----- exists + "Answer whether the directory exists" + ^self class currentDirectoryNickname + ifNotNil: + [:me| + (self primLookupEntryIn: pathName asVmPathName name: me asVmPathName) + ifNil: [false] + ifNotNil: [:maybeErr| maybeErr ~~ #primFailed]] + ifNil: + [(self primLookupEntryIn: pathName asVmPathName index: 1) ~~ #badDirectoryPath]! - "Answer whether the directory exists" - - | result | - result := self primLookupEntryIn: pathName asVmPathName index: 1. - ^ result ~= #badDirectoryPath - !
--
_,,,^..^,,,_
best, Eliot
On 2022-07-13, at 9:27 PM, Eliot Miranda eliot.miranda@gmail.com wrote:
Occasionally FileDirectory>>exists fails. The old implementation seems unreliable, but it's also slow. So if possible, implement it above primLookupEntryIn:name:
Which reminds me - we have a lot of cleaning up and improving to do wrt filenames etc. Some of which we've been discussing since circa 1998.
It might be time to consider things like Lukas' FileSystem (http://www.squeaksource.com/fs.html) for example.
tim -- tim Rowledge; tim@rowledge.org; http://www.rowledge.org/tim Strange OpCodes: PIC: Permute Instruction Codes
Am Do., 14. Juli 2022 um 19:43 Uhr schrieb tim Rowledge tim@rowledge.org:
It might be time to consider things like Lukas' FileSystem ( http://www.squeaksource.com/fs.html) for example.
Here is the version that I continued to develop, to get FileSystem-Git to work in Squeak: https://github.com/squeak-smalltalk/squeak-filesystem If somebody does attempt to push it forward, it may be better to start from there.
Looks like Pharo has since added yet another Files API on top of, around, or next to FileSystem: https://github.com/pharo-project/pharo/tree/Pharo7.0/src/Files https://github.com/pharo-project/pharo/tree/Pharo11/src/Files
Am Do., 14. Juli 2022 um 19:51 Uhr schrieb Jakob Reschke < jakres+squeak@gmail.com>:
Am Do., 14. Juli 2022 um 19:43 Uhr schrieb tim Rowledge <tim@rowledge.org
:
It might be time to consider things like Lukas' FileSystem ( http://www.squeaksource.com/fs.html) for example.
Here is the version that I continued to develop, to get FileSystem-Git to work in Squeak: https://github.com/squeak-smalltalk/squeak-filesystem If somebody does attempt to push it forward, it may be better to start from there.
On 2022-07-14, at 10:51 AM, Jakob Reschke jakres+squeak@gmail.com wrote:
Am Do., 14. Juli 2022 um 19:43 Uhr schrieb tim Rowledge tim@rowledge.org:
It might be time to consider things like Lukas' FileSystem (http://www.squeaksource.com/fs.html) for example.
Here is the version that I continued to develop, to get FileSystem-Git to work in Squeak: https://github.com/squeak-smalltalk/squeak-filesystem If somebody does attempt to push it forward, it may be better to start from there.
Thanks for that - any chance you could persuade Lukas to add a pointer to your version to the squeaksource project page? It would save some confusion in the future.
tim -- tim Rowledge; tim@rowledge.org; http://www.rowledge.org/tim "Yummy" said Pooh, as he rotated Piglet slowly on the spit.
On Thu, Jul 14, 2022 at 10:43:25AM -0700, tim Rowledge wrote:
On 2022-07-13, at 9:27 PM, Eliot Miranda eliot.miranda@gmail.com wrote:
Occasionally FileDirectory>>exists fails. The old implementation seems unreliable, but it's also slow. So if possible, implement it above primLookupEntryIn:name:
Which reminds me - we have a lot of cleaning up and improving to do wrt filenames etc. Some of which we've been discussing since circa 1998.
It might be time to consider things like Lukas' FileSystem (http://www.squeaksource.com/fs.html) for example.
Or the FileMan package that has been adopted by Cuis.
https://wiki.squeak.org/squeak/6333
I find FileMan to be clean in design and nicely factored to support various OS eccentricities. Consistency with Cuis would be a plus in my opinion.
Dave
I've been able to load both to look at (with some problems to do with metacello if you load FileMan first and then try to do Installer ensureRecentMetacello) and I'd say FileMan is much simpler to understand. Cuis compatibility is certainly a good point to raise.
On 2022-07-14, at 12:36 PM, David T. Lewis lewis@mail.msen.com wrote:
On Thu, Jul 14, 2022 at 10:43:25AM -0700, tim Rowledge wrote:
On 2022-07-13, at 9:27 PM, Eliot Miranda eliot.miranda@gmail.com wrote:
Occasionally FileDirectory>>exists fails. The old implementation seems unreliable, but it's also slow. So if possible, implement it above primLookupEntryIn:name:
Which reminds me - we have a lot of cleaning up and improving to do wrt filenames etc. Some of which we've been discussing since circa 1998.
It might be time to consider things like Lukas' FileSystem (http://www.squeaksource.com/fs.html) for example.
Or the FileMan package that has been adopted by Cuis.
https://wiki.squeak.org/squeak/6333
I find FileMan to be clean in design and nicely factored to support various OS eccentricities. Consistency with Cuis would be a plus in my opinion.
Dave
tim -- tim Rowledge; tim@rowledge.org; http://www.rowledge.org/tim Strange OpCodes: WFL: Wave FLag
Hi Eliot,
thanks for the speed-up! Would you mind to have a short look at Files-ct.198? I think there might be a regression in this patch for Windows. :-)
Best, Christoph
--- Sent from Squeak Inbox Talk
On 2022-07-13T21:27:01-07:00, eliot.miranda@gmail.com wrote:
Much smaller improvement on Windows but still nice to have. Old: '10,100 per second. 98.6 microseconds per run. 0 % GC time.' New: '14,700 per second. 67.8 microseconds per run. 0 % GC time.'
(paths used '\no\where\at\all', '\Users\eliot\Desktop\not there' FileDirectory default)
On Wed, Jul 13, 2022 at 9:09 PM <commits at source.squeak.org> wrote:
Eliot Miranda uploaded a new version of Files to project The Trunk: http://source.squeak.org/trunk/Files-eem.195.mcz
==================== Summary ====================
Name: Files-eem.195 Author: eem Time: 13 July 2022, 9:09:36.427827 pm UUID: 7ccbfb5c-e5d3-4911-9497-09fdc484d09c Ancestors: Files-eem.194
Occasionally FileDirectory>>exists fails. The old implementation seems unreliable, but it's also slow. So if possible, implement it above primLookupEntryIn:name:
Old: | foo bar baz | foo := FileDirectory on: '/no/where/at/all'. bar := FileDirectory on: '/Users/eliot/Desktop/not there'. baz := FileDirectory default. [foo exists. bar exists. baz exists] bench '8,070 per second. 124 microseconds per run. 0 % GC time.'
New: | foo bar baz | foo := FileDirectory on: '/no/where/at/all'. bar := FileDirectory on: '/Users/eliot/Desktop/not there'. baz := FileDirectory default. [foo exists. bar exists. baz exists] bench '73,700 per second. 13.6 microseconds per run. 0.64 % GC time.'
=============== Diff against Files-eem.194 ===============
Item was changed: ----- Method: FileDirectory>>exists (in category 'testing') ----- exists
"Answer whether the directory exists"
^self class currentDirectoryNickname
ifNotNil:
[:me|
(self primLookupEntryIn: pathName asVmPathName
name: me asVmPathName)
ifNil: [false]
ifNotNil: [:maybeErr| maybeErr ~~
#primFailed]]
ifNil:
[(self primLookupEntryIn: pathName asVmPathName
index: 1) ~~ #badDirectoryPath]!
- "Answer whether the directory exists"
| result |
result := self primLookupEntryIn: pathName asVmPathName index: 1.
^ result ~= #badDirectoryPath
- !
-- _,,,^..^,,,_ best, Eliot
squeak-dev@lists.squeakfoundation.org