Skip to content

Commit

Permalink
Remove unused function
Browse files Browse the repository at this point in the history
  • Loading branch information
linxGnu committed Jul 27, 2021
1 parent 02cf5a0 commit 906df8e
Show file tree
Hide file tree
Showing 3 changed files with 90 additions and 108 deletions.
180 changes: 90 additions & 90 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,36 +88,36 @@ cpu: AMD Ryzen 9 3950X 16-Core Processor
PASS
benchmark iter time/iter bytes alloc allocs
--------- ---- --------- ----------- ------
BenchmarkPQueueWriting_16-32 44 27.06 ms/op 137089 B/op 10293 allocs/op
BenchmarkDQueueWriting_16-32 13 81.94 ms/op 10452544 B/op 160338 allocs/op
BenchmarkBigQueueWriting_16-32 20 56.87 ms/op 9917 B/op 37 allocs/op
BenchmarkPQueueWriting_64-32 42 27.01 ms/op 137512 B/op 10294 allocs/op
BenchmarkDQueueWriting_64-32 13 88.54 ms/op 13335051 B/op 180337 allocs/op
BenchmarkBigQueueWriting_64-32 20 57.00 ms/op 10238 B/op 38 allocs/op
BenchmarkPQueueWriting_256-32 38 29.29 ms/op 138994 B/op 10292 allocs/op
BenchmarkDQueueWriting_256-32 13 90.40 ms/op 17503163 B/op 180345 allocs/op
BenchmarkBigQueueWriting_256-32 19 58.69 ms/op 11912 B/op 39 allocs/op
BenchmarkPQueueWriting_2048-32 22 51.28 ms/op 153278 B/op 10292 allocs/op
BenchmarkDQueueWriting_2048-32 9 126.54 ms/op 56574402 B/op 180362 allocs/op
BenchmarkBigQueueWriting_2048-32 14 78.10 ms/op 25688 B/op 36 allocs/op
BenchmarkPQueueWriting_16K-32 5 218.72 ms/op 271150 B/op 10326 allocs/op
BenchmarkDQueueWriting_16K-32 3 339.32 ms/op 379261010 B/op 180443 allocs/op
BenchmarkBigQueueWriting_16K-32 5 211.49 ms/op 141206 B/op 48 allocs/op
BenchmarkPQueueRW_16-32 16 71.78 ms/op 388231 B/op 20392 allocs/op
BenchmarkDQueueRW_16-32 10 103.99 ms/op 10452658 B/op 161524 allocs/op
BenchmarkBigQueueRW_16-32 20 61.13 ms/op 170384 B/op 10046 allocs/op
BenchmarkPQueueRW_64-32 15 70.40 ms/op 388646 B/op 20390 allocs/op
BenchmarkDQueueRW_64-32 10 108.91 ms/op 13337388 B/op 181600 allocs/op
BenchmarkBigQueueRW_64-32 20 62.01 ms/op 650662 B/op 10044 allocs/op
BenchmarkPQueueRW_256-32 30 38.48 ms/op 201353 B/op 10226 allocs/op
BenchmarkDQueueRW_256-32 19 57.82 ms/op 8762733 B/op 90822 allocs/op
BenchmarkBigQueueRW_256-32 16 63.27 ms/op 2572310 B/op 10045 allocs/op
BenchmarkPQueueRW_2048-32 21 52.46 ms/op 229580 B/op 10225 allocs/op
BenchmarkDQueueRW_2048-32 15 75.09 ms/op 28306604 B/op 90907 allocs/op
BenchmarkBigQueueRW_2048-32 12 91.33 ms/op 20506824 B/op 10048 allocs/op
BenchmarkPQueueRW_16K-32 7 157.67 ms/op 459536 B/op 10231 allocs/op
BenchmarkDQueueRW_16K-32 6 186.61 ms/op 189714586 B/op 91322 allocs/op
BenchmarkBigQueueRW_16K-32 4 275.95 ms/op 163986880 B/op 10095 allocs/op
BenchmarkPQueueWriting_16-32 46 26.89 ms/op 137198 B/op 10294 allocs/op
BenchmarkDQueueWriting_16-32 13 83.03 ms/op 10452559 B/op 160336 allocs/op
BenchmarkBigQueueWriting_16-32 20 56.47 ms/op 10595 B/op 41 allocs/op
BenchmarkPQueueWriting_64-32 44 26.12 ms/op 137440 B/op 10292 allocs/op
BenchmarkDQueueWriting_64-32 13 87.86 ms/op 13336084 B/op 180339 allocs/op
BenchmarkBigQueueWriting_64-32 20 56.13 ms/op 10612 B/op 39 allocs/op
BenchmarkPQueueWriting_256-32 37 29.24 ms/op 138896 B/op 10292 allocs/op
BenchmarkDQueueWriting_256-32 12 92.28 ms/op 17502718 B/op 180341 allocs/op
BenchmarkBigQueueWriting_256-32 19 58.27 ms/op 11453 B/op 36 allocs/op
BenchmarkPQueueWriting_2048-32 22 50.84 ms/op 153693 B/op 10296 allocs/op
BenchmarkDQueueWriting_2048-32 9 125.29 ms/op 56574461 B/op 180361 allocs/op
BenchmarkBigQueueWriting_2048-32 14 77.72 ms/op 26446 B/op 37 allocs/op
BenchmarkPQueueWriting_16K-32 5 213.86 ms/op 269112 B/op 10305 allocs/op
BenchmarkDQueueWriting_16K-32 3 335.20 ms/op 379263413 B/op 180487 allocs/op
BenchmarkBigQueueWriting_16K-32 5 218.02 ms/op 141072 B/op 47 allocs/op
BenchmarkPQueueRW_16-32 15 67.40 ms/op 388322 B/op 20392 allocs/op
BenchmarkDQueueRW_16-32 10 102.80 ms/op 10452107 B/op 161569 allocs/op
BenchmarkBigQueueRW_16-32 20 63.98 ms/op 170869 B/op 10049 allocs/op
BenchmarkPQueueRW_64-32 16 69.52 ms/op 388616 B/op 20390 allocs/op
BenchmarkDQueueRW_64-32 10 108.71 ms/op 13338842 B/op 181578 allocs/op
BenchmarkBigQueueRW_64-32 20 60.42 ms/op 650542 B/op 10044 allocs/op
BenchmarkPQueueRW_256-32 30 37.71 ms/op 200731 B/op 10223 allocs/op
BenchmarkDQueueRW_256-32 19 58.51 ms/op 8762558 B/op 90838 allocs/op
BenchmarkBigQueueRW_256-32 19 62.62 ms/op 2572937 B/op 10049 allocs/op
BenchmarkPQueueRW_2048-32 21 51.89 ms/op 229431 B/op 10223 allocs/op
BenchmarkDQueueRW_2048-32 14 76.85 ms/op 28306245 B/op 90895 allocs/op
BenchmarkBigQueueRW_2048-32 13 90.80 ms/op 20508233 B/op 10056 allocs/op
BenchmarkPQueueRW_16K-32 7 155.29 ms/op 460169 B/op 10238 allocs/op
BenchmarkDQueueRW_16K-32 6 209.55 ms/op 189712445 B/op 91280 allocs/op
BenchmarkBigQueueRW_16K-32 4 282.87 ms/op 163983708 B/op 10072 allocs/op
```

#### NVMe - Corsair Force MP600
Expand All @@ -137,36 +137,36 @@ cpu: AMD Ryzen 9 3950X 16-Core Processor
PASS
benchmark iter time/iter bytes alloc allocs
--------- ---- --------- ----------- ------
BenchmarkPQueueWriting_16-32 74 15.10 ms/op 136119 B/op 10284 allocs/op
BenchmarkDQueueWriting_16-32 19 60.36 ms/op 10449888 B/op 160336 allocs/op
BenchmarkBigQueueWriting_16-32 139 8.22 ms/op 9499 B/op 36 allocs/op
BenchmarkPQueueWriting_64-32 73 15.62 ms/op 136532 B/op 10284 allocs/op
BenchmarkDQueueWriting_64-32 18 64.45 ms/op 13333902 B/op 180339 allocs/op
BenchmarkBigQueueWriting_64-32 144 8.64 ms/op 9917 B/op 36 allocs/op
BenchmarkPQueueWriting_256-32 64 17.21 ms/op 137921 B/op 10283 allocs/op
BenchmarkDQueueWriting_256-32 16 69.30 ms/op 17501067 B/op 180341 allocs/op
BenchmarkBigQueueWriting_256-32 133 8.99 ms/op 11287 B/op 36 allocs/op
BenchmarkPQueueWriting_2048-32 38 28.95 ms/op 152199 B/op 10283 allocs/op
BenchmarkDQueueWriting_2048-32 12 95.34 ms/op 56572654 B/op 180365 allocs/op
BenchmarkBigQueueWriting_2048-32 58 20.04 ms/op 25649 B/op 36 allocs/op
BenchmarkPQueueWriting_16K-32 9 124.60 ms/op 266861 B/op 10283 allocs/op
BenchmarkDQueueWriting_16K-32 5 250.31 ms/op 379251190 B/op 180384 allocs/op
BenchmarkBigQueueWriting_16K-32 9 111.19 ms/op 140832 B/op 46 allocs/op
BenchmarkPQueueRW_16-32 28 48.08 ms/op 385505 B/op 20381 allocs/op
BenchmarkDQueueRW_16-32 15 72.69 ms/op 10450650 B/op 161245 allocs/op
BenchmarkBigQueueRW_16-32 97 12.13 ms/op 170414 B/op 10046 allocs/op
BenchmarkPQueueRW_64-32 24 47.86 ms/op 385929 B/op 20378 allocs/op
BenchmarkDQueueRW_64-32 15 77.61 ms/op 13335108 B/op 181333 allocs/op
BenchmarkBigQueueRW_64-32 94 12.52 ms/op 650692 B/op 10046 allocs/op
BenchmarkPQueueRW_256-32 44 25.20 ms/op 199529 B/op 10219 allocs/op
BenchmarkDQueueRW_256-32 27 41.57 ms/op 8760670 B/op 90698 allocs/op
BenchmarkBigQueueRW_256-32 81 13.98 ms/op 2572554 B/op 10048 allocs/op
BenchmarkPQueueRW_2048-32 33 36.86 ms/op 228140 B/op 10219 allocs/op
BenchmarkDQueueRW_2048-32 20 55.98 ms/op 28303725 B/op 90805 allocs/op
BenchmarkBigQueueRW_2048-32 33 34.34 ms/op 20506774 B/op 10049 allocs/op
BenchmarkPQueueRW_16K-32 10 103.49 ms/op 457606 B/op 10219 allocs/op
BenchmarkDQueueRW_16K-32 8 139.35 ms/op 189707096 B/op 91242 allocs/op
BenchmarkBigQueueRW_16K-32 6 173.72 ms/op 163985705 B/op 10098 allocs/op
BenchmarkPQueueWriting_16-32 79 15.57 ms/op 136164 B/op 10284 allocs/op
BenchmarkDQueueWriting_16-32 19 61.08 ms/op 10449512 B/op 160333 allocs/op
BenchmarkBigQueueWriting_16-32 138 8.65 ms/op 9516 B/op 36 allocs/op
BenchmarkPQueueWriting_64-32 70 15.84 ms/op 136540 B/op 10285 allocs/op
BenchmarkDQueueWriting_64-32 16 65.65 ms/op 13334318 B/op 180340 allocs/op
BenchmarkBigQueueWriting_64-32 139 8.60 ms/op 9787 B/op 36 allocs/op
BenchmarkPQueueWriting_256-32 64 17.79 ms/op 138068 B/op 10283 allocs/op
BenchmarkDQueueWriting_256-32 16 71.10 ms/op 17501000 B/op 180340 allocs/op
BenchmarkBigQueueWriting_256-32 128 9.35 ms/op 11365 B/op 36 allocs/op
BenchmarkPQueueWriting_2048-32 36 32.39 ms/op 152458 B/op 10285 allocs/op
BenchmarkDQueueWriting_2048-32 12 97.36 ms/op 56572773 B/op 180364 allocs/op
BenchmarkBigQueueWriting_2048-32 55 20.58 ms/op 25670 B/op 36 allocs/op
BenchmarkPQueueWriting_16K-32 8 126.74 ms/op 266866 B/op 10283 allocs/op
BenchmarkDQueueWriting_16K-32 4 261.04 ms/op 379253720 B/op 180406 allocs/op
BenchmarkBigQueueWriting_16K-32 9 119.59 ms/op 141291 B/op 48 allocs/op
BenchmarkPQueueRW_16-32 25 48.24 ms/op 385300 B/op 20379 allocs/op
BenchmarkDQueueRW_16-32 15 74.73 ms/op 10449884 B/op 161294 allocs/op
BenchmarkBigQueueRW_16-32 97 12.77 ms/op 170304 B/op 10046 allocs/op
BenchmarkPQueueRW_64-32 22 47.24 ms/op 386184 B/op 20379 allocs/op
BenchmarkDQueueRW_64-32 15 78.42 ms/op 13335399 B/op 181330 allocs/op
BenchmarkBigQueueRW_64-32 100 12.42 ms/op 650753 B/op 10047 allocs/op
BenchmarkPQueueRW_256-32 48 26.53 ms/op 199591 B/op 10220 allocs/op
BenchmarkDQueueRW_256-32 27 42.19 ms/op 8761458 B/op 90713 allocs/op
BenchmarkBigQueueRW_256-32 87 14.32 ms/op 2572194 B/op 10046 allocs/op
BenchmarkPQueueRW_2048-32 30 37.01 ms/op 228494 B/op 10222 allocs/op
BenchmarkDQueueRW_2048-32 20 57.18 ms/op 28304177 B/op 90820 allocs/op
BenchmarkBigQueueRW_2048-32 32 34.08 ms/op 20507037 B/op 10052 allocs/op
BenchmarkPQueueRW_16K-32 9 112.15 ms/op 457996 B/op 10224 allocs/op
BenchmarkDQueueRW_16K-32 8 140.73 ms/op 189708618 B/op 91247 allocs/op
BenchmarkBigQueueRW_16K-32 6 181.14 ms/op 163984589 B/op 10087 allocs/op
```

### SSD - Samsung SSD 850 Pro
Expand All @@ -186,34 +186,34 @@ cpu: AMD Ryzen 9 3950X 16-Core Processor
PASS
benchmark iter time/iter bytes alloc allocs
--------- ---- --------- ----------- ------
BenchmarkPQueueWriting_16-32 45 26.23 ms/op 137135 B/op 10293 allocs/op
BenchmarkDQueueWriting_16-32 14 81.40 ms/op 10452582 B/op 160336 allocs/op
BenchmarkBigQueueWriting_16-32 75 14.99 ms/op 9930 B/op 38 allocs/op
BenchmarkPQueueWriting_64-32 40 26.45 ms/op 137381 B/op 10293 allocs/op
BenchmarkDQueueWriting_64-32 13 87.37 ms/op 13335792 B/op 180338 allocs/op
BenchmarkBigQueueWriting_64-32 80 15.36 ms/op 9949 B/op 36 allocs/op
BenchmarkPQueueWriting_256-32 39 29.25 ms/op 138978 B/op 10293 allocs/op
BenchmarkDQueueWriting_256-32 12 92.45 ms/op 17503091 B/op 180343 allocs/op
BenchmarkBigQueueWriting_256-32 75 16.30 ms/op 11532 B/op 37 allocs/op
BenchmarkPQueueWriting_2048-32 22 49.88 ms/op 153137 B/op 10292 allocs/op
BenchmarkDQueueWriting_2048-32 8 128.21 ms/op 56574002 B/op 180355 allocs/op
BenchmarkBigQueueWriting_2048-32 34 35.54 ms/op 26063 B/op 39 allocs/op
BenchmarkPQueueWriting_16K-32 5 211.62 ms/op 272683 B/op 10336 allocs/op
BenchmarkDQueueWriting_16K-32 4 333.20 ms/op 379260210 B/op 180450 allocs/op
BenchmarkBigQueueWriting_16K-32 6 168.80 ms/op 141776 B/op 49 allocs/op
BenchmarkPQueueRW_16-32 15 69.91 ms/op 388373 B/op 20393 allocs/op
BenchmarkDQueueRW_16-32 10 104.36 ms/op 10455220 B/op 161594 allocs/op
BenchmarkBigQueueRW_16-32 63 19.45 ms/op 170485 B/op 10047 allocs/op
BenchmarkPQueueRW_64-32 14 73.33 ms/op 388629 B/op 20390 allocs/op
BenchmarkDQueueRW_64-32 10 109.68 ms/op 13337936 B/op 181560 allocs/op
BenchmarkBigQueueRW_64-32 58 19.34 ms/op 651280 B/op 10049 allocs/op
BenchmarkPQueueRW_256-32 28 37.34 ms/op 200582 B/op 10222 allocs/op
BenchmarkDQueueRW_256-32 20 58.73 ms/op 8763089 B/op 90820 allocs/op
BenchmarkBigQueueRW_256-32 57 21.63 ms/op 2572376 B/op 10047 allocs/op
BenchmarkPQueueRW_2048-32 21 53.02 ms/op 229377 B/op 10223 allocs/op
BenchmarkDQueueRW_2048-32 14 76.97 ms/op 28305274 B/op 90923 allocs/op
BenchmarkBigQueueRW_2048-32 22 49.54 ms/op 20507368 B/op 10055 allocs/op
BenchmarkPQueueRW_16K-32 8 144.38 ms/op 459836 B/op 10235 allocs/op
BenchmarkDQueueRW_16K-32 6 187.45 ms/op 189709072 B/op 91287 allocs/op
BenchmarkBigQueueRW_16K-32 5 238.08 ms/op 163983158 B/op 10070 allocs/op
BenchmarkPQueueWriting_16-32 44 25.98 ms/op 137340 B/op 10295 allocs/op
BenchmarkDQueueWriting_16-32 14 82.75 ms/op 10452419 B/op 160338 allocs/op
BenchmarkBigQueueWriting_16-32 79 14.54 ms/op 9912 B/op 38 allocs/op
BenchmarkPQueueWriting_64-32 43 26.91 ms/op 137324 B/op 10292 allocs/op
BenchmarkDQueueWriting_64-32 13 86.17 ms/op 13335732 B/op 180337 allocs/op
BenchmarkBigQueueWriting_64-32 76 14.86 ms/op 10135 B/op 37 allocs/op
BenchmarkPQueueWriting_256-32 40 29.86 ms/op 139016 B/op 10294 allocs/op
BenchmarkDQueueWriting_256-32 12 90.85 ms/op 17502446 B/op 180339 allocs/op
BenchmarkBigQueueWriting_256-32 72 16.69 ms/op 11568 B/op 36 allocs/op
BenchmarkPQueueWriting_2048-32 22 50.88 ms/op 153257 B/op 10293 allocs/op
BenchmarkDQueueWriting_2048-32 9 125.08 ms/op 56574005 B/op 180359 allocs/op
BenchmarkBigQueueWriting_2048-32 32 35.15 ms/op 25766 B/op 36 allocs/op
BenchmarkPQueueWriting_16K-32 5 218.77 ms/op 269710 B/op 10311 allocs/op
BenchmarkDQueueWriting_16K-32 3 337.09 ms/op 379261869 B/op 180470 allocs/op
BenchmarkBigQueueWriting_16K-32 6 170.94 ms/op 141072 B/op 47 allocs/op
BenchmarkPQueueRW_16-32 16 70.79 ms/op 388214 B/op 20390 allocs/op
BenchmarkDQueueRW_16-32 10 102.95 ms/op 10453479 B/op 161592 allocs/op
BenchmarkBigQueueRW_16-32 66 19.70 ms/op 170668 B/op 10048 allocs/op
BenchmarkPQueueRW_64-32 15 69.15 ms/op 388717 B/op 20391 allocs/op
BenchmarkDQueueRW_64-32 10 108.17 ms/op 13336699 B/op 181604 allocs/op
BenchmarkBigQueueRW_64-32 62 19.96 ms/op 651423 B/op 10050 allocs/op
BenchmarkPQueueRW_256-32 31 37.67 ms/op 201258 B/op 10226 allocs/op
BenchmarkDQueueRW_256-32 20 57.47 ms/op 8762196 B/op 90808 allocs/op
BenchmarkBigQueueRW_256-32 57 22.03 ms/op 2573003 B/op 10050 allocs/op
BenchmarkPQueueRW_2048-32 21 52.67 ms/op 229770 B/op 10225 allocs/op
BenchmarkDQueueRW_2048-32 14 76.60 ms/op 28305102 B/op 90897 allocs/op
BenchmarkBigQueueRW_2048-32 22 49.47 ms/op 20507070 B/op 10051 allocs/op
BenchmarkPQueueRW_16K-32 7 153.68 ms/op 460246 B/op 10239 allocs/op
BenchmarkDQueueRW_16K-32 6 191.16 ms/op 189710994 B/op 91224 allocs/op
BenchmarkBigQueueRW_16K-32 5 242.28 ms/op 163987387 B/op 10115 allocs/op
```
8 changes: 0 additions & 8 deletions utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,3 @@ func loadFileInfos(dir string, infoExtractor func(os.DirEntry) (os.FileInfo, err
func fileInfoExtractor(f os.DirEntry) (os.FileInfo, error) {
return f.Info()
}

func fileExists(filename string) bool {
i, err := os.Stat(filename)
if os.IsNotExist(err) {
return false
}
return !i.IsDir()
}
10 changes: 0 additions & 10 deletions utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package pqueue
import (
"fmt"
"os"
"path/filepath"
"testing"

"github.com/linxGnu/pqueue/common"
Expand Down Expand Up @@ -73,12 +72,3 @@ func TestLoading(t *testing.T) {
}
})
}

func TestFileExists(t *testing.T) {
require.False(t, fileExists(os.TempDir()))
require.False(t, fileExists(filepath.Join(os.TempDir(), "test_abc")))
f, err := os.CreateTemp(os.TempDir(), "test_")
require.NoError(t, err)
require.True(t, fileExists(f.Name()))
require.NoError(t, os.Remove(f.Name()))
}

0 comments on commit 906df8e

Please sign in to comment.