zip_kit 6.3.0 → 6.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,109 +0,0 @@
1
- require "bundler"
2
- Bundler.setup
3
-
4
- require "benchmark"
5
- require "benchmark/ips"
6
- require_relative "../lib/zip_kit"
7
-
8
- n_bytes = 5 * 1024 * 1024
9
- r = Random.new
10
- bytes = (0...n_bytes).map { r.bytes(1) }
11
- buffer_sizes = [
12
- 1,
13
- 256,
14
- 512,
15
- 1024,
16
- 8 * 1024,
17
- 16 * 1024,
18
- 32 * 1024,
19
- 64 * 1024,
20
- 128 * 1024,
21
- 256 * 1024,
22
- 512 * 1024,
23
- 1024 * 1024,
24
- 2 * 1024 * 1024
25
- ]
26
-
27
- Benchmark.ips do |x|
28
- x.config(time: 5, warmup: 2)
29
- buffer_sizes.each do |buf_size|
30
- x.report "Single-byte <<-writes of #{n_bytes} using a #{buf_size} byte buffer" do
31
- crc = ZipKit::WriteBuffer.new(ZipKit::StreamCRC32.new, buf_size)
32
- bytes.each { |b| crc << b }
33
- crc.to_i
34
- end
35
- end
36
- x.compare!
37
- end
38
-
39
- __END__
40
-
41
- Warming up --------------------------------------
42
- Single-byte <<-writes of 5242880 using a 1 byte buffer
43
- 1.000 i/100ms
44
- Single-byte <<-writes of 5242880 using a 256 byte buffer
45
- 1.000 i/100ms
46
- Single-byte <<-writes of 5242880 using a 512 byte buffer
47
- 1.000 i/100ms
48
- Single-byte <<-writes of 5242880 using a 1024 byte buffer
49
- 1.000 i/100ms
50
- Single-byte <<-writes of 5242880 using a 8192 byte buffer
51
- 1.000 i/100ms
52
- Single-byte <<-writes of 5242880 using a 16384 byte buffer
53
- 1.000 i/100ms
54
- Single-byte <<-writes of 5242880 using a 32768 byte buffer
55
- 1.000 i/100ms
56
- Single-byte <<-writes of 5242880 using a 65536 byte buffer
57
- 1.000 i/100ms
58
- Single-byte <<-writes of 5242880 using a 131072 byte buffer
59
- 1.000 i/100ms
60
- Single-byte <<-writes of 5242880 using a 262144 byte buffer
61
- 1.000 i/100ms
62
- Single-byte <<-writes of 5242880 using a 524288 byte buffer
63
- 1.000 i/100ms
64
- Single-byte <<-writes of 5242880 using a 1048576 byte buffer
65
- 1.000 i/100ms
66
- Single-byte <<-writes of 5242880 using a 2097152 byte buffer
67
- 1.000 i/100ms
68
- Calculating -------------------------------------
69
- Single-byte <<-writes of 5242880 using a 1 byte buffer
70
- 0.054 (± 0.0%) i/s - 1.000 in 18.383019s
71
- Single-byte <<-writes of 5242880 using a 256 byte buffer
72
- 0.121 (± 0.0%) i/s - 1.000 in 8.286061s
73
- Single-byte <<-writes of 5242880 using a 512 byte buffer
74
- 0.124 (± 0.0%) i/s - 1.000 in 8.038112s
75
- Single-byte <<-writes of 5242880 using a 1024 byte buffer
76
- 0.128 (± 0.0%) i/s - 1.000 in 7.828562s
77
- Single-byte <<-writes of 5242880 using a 8192 byte buffer
78
- 0.123 (± 0.0%) i/s - 1.000 in 8.121586s
79
- Single-byte <<-writes of 5242880 using a 16384 byte buffer
80
- 0.127 (± 0.0%) i/s - 1.000 in 7.872240s
81
- Single-byte <<-writes of 5242880 using a 32768 byte buffer
82
- 0.126 (± 0.0%) i/s - 1.000 in 7.911816s
83
- Single-byte <<-writes of 5242880 using a 65536 byte buffer
84
- 0.126 (± 0.0%) i/s - 1.000 in 7.917318s
85
- Single-byte <<-writes of 5242880 using a 131072 byte buffer
86
- 0.127 (± 0.0%) i/s - 1.000 in 7.897223s
87
- Single-byte <<-writes of 5242880 using a 262144 byte buffer
88
- 0.130 (± 0.0%) i/s - 1.000 in 7.675608s
89
- Single-byte <<-writes of 5242880 using a 524288 byte buffer
90
- 0.130 (± 0.0%) i/s - 1.000 in 7.679886s
91
- Single-byte <<-writes of 5242880 using a 1048576 byte buffer
92
- 0.128 (± 0.0%) i/s - 1.000 in 7.788439s
93
- Single-byte <<-writes of 5242880 using a 2097152 byte buffer
94
- 0.128 (± 0.0%) i/s - 1.000 in 7.797839s
95
-
96
- Comparison:
97
- Single-byte <<-writes of 5242880 using a 262144 byte buffer: 0.1 i/s
98
- Single-byte <<-writes of 5242880 using a 524288 byte buffer: 0.1 i/s - 1.00x slower
99
- Single-byte <<-writes of 5242880 using a 1048576 byte buffer: 0.1 i/s - 1.01x slower
100
- Single-byte <<-writes of 5242880 using a 2097152 byte buffer: 0.1 i/s - 1.02x slower
101
- Single-byte <<-writes of 5242880 using a 1024 byte buffer: 0.1 i/s - 1.02x slower
102
- Single-byte <<-writes of 5242880 using a 16384 byte buffer: 0.1 i/s - 1.03x slower
103
- Single-byte <<-writes of 5242880 using a 131072 byte buffer: 0.1 i/s - 1.03x slower
104
- Single-byte <<-writes of 5242880 using a 32768 byte buffer: 0.1 i/s - 1.03x slower
105
- Single-byte <<-writes of 5242880 using a 65536 byte buffer: 0.1 i/s - 1.03x slower
106
- Single-byte <<-writes of 5242880 using a 512 byte buffer: 0.1 i/s - 1.05x slower
107
- Single-byte <<-writes of 5242880 using a 8192 byte buffer: 0.1 i/s - 1.06x slower
108
- Single-byte <<-writes of 5242880 using a 256 byte buffer: 0.1 i/s - 1.08x slower
109
- Single-byte <<-writes of 5242880 using a 1 byte buffer: 0.1 i/s - 2.39x slower