Skip to content

Conversation

@bep
Copy link
Collaborator

@bep bep commented Jul 19, 2022

  • Use ReadDir when available
  • Don't repeat Stat in equal
name     old time/op    new time/op    delta
Sync-10    2.10ms ± 1%    1.96ms ± 3%   -6.72%  (p=0.029 n=4+4)

name     old alloc/op   new alloc/op   delta
Sync-10     919kB ± 0%     892kB ± 0%   -2.88%  (p=0.029 n=4+4)

name     old allocs/op  new allocs/op  delta
Sync-10       866 ± 0%       707 ± 0%  -18.36%  (p=0.029 n=4+4)

Which makes it a little faster in the common case:

```bash
name     old time/op    new time/op    delta
Sync-10    2.09ms ± 1%    2.03ms ± 2%  -3.01%  (p=0.029 n=4+4)

name     old alloc/op   new alloc/op   delta
Sync-10     919kB ± 0%     909kB ± 0%  -1.06%  (p=0.029 n=4+4)

name     old allocs/op  new allocs/op  delta
Sync-10       866 ± 0%       832 ± 0%  -3.93%  (p=0.029 n=4+4)
```

Note that this changes the signature in the DeleteFilter slightly.
```bash
name     old time/op    new time/op    delta
Sync-10    2.04ms ± 2%    1.98ms ± 1%   -2.96%  (p=0.029 n=4+4)

name     old alloc/op   new alloc/op   delta
Sync-10     909kB ± 0%     892kB ± 0%   -1.84%  (p=0.029 n=4+4)

name     old allocs/op  new allocs/op  delta
Sync-10       832 ± 0%       707 ± 0%  -15.02%  (p=0.029 n=4+4)
```
@bep bep merged commit 4f1e77b into spf13:master Jul 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant