Commit 283871f
committed
Use fstat to access the current file size of a FilePlugin file on unices.
This is much faster than the old seek method. e.g. on a 2021 MBP with an SSD
running Sequoia 15.6.1
| f fid |
fid := (f := SourceFiles at: 1) fileID.
[f primSize: fid] bench
answers
'654,000 per second. 1.53 microseconds per run. 0 % GC time.'
using the old seek here, seek end, seek here method, but answers
'2,410,000 per second. 414 nanoseconds per run. 0 % GC time.'
using the new fstat method.1 parent 81d66a6 commit 283871f
1 file changed
+6
-0
lines changedLines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
133 | 139 | | |
134 | 140 | | |
135 | 141 | | |
| |||
0 commit comments