Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
730f51ab
Commit
730f51ab
authored
Feb 09, 2014
by
Brad Fitzpatrick
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
archive/zip: add flate writing benchmark
LGTM=adg R=adg CC=golang-codereviews
https://golang.org/cl/60530049
parent
6ebf59b9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
0 deletions
+18
-0
writer_test.go
src/pkg/archive/zip/writer_test.go
+18
-0
No files found.
src/pkg/archive/zip/writer_test.go
View file @
730f51ab
...
...
@@ -125,3 +125,21 @@ func testReadFile(t *testing.T, f *File, wt *WriteTest) {
t
.
Errorf
(
"File contents %q, want %q"
,
b
,
wt
.
Data
)
}
}
func
BenchmarkCompressedZipGarbage
(
b
*
testing
.
B
)
{
b
.
ReportAllocs
()
var
buf
bytes
.
Buffer
bigBuf
:=
bytes
.
Repeat
([]
byte
(
"a"
),
1
<<
20
)
for
i
:=
0
;
i
<
b
.
N
;
i
++
{
buf
.
Reset
()
zw
:=
NewWriter
(
&
buf
)
for
j
:=
0
;
j
<
3
;
j
++
{
w
,
_
:=
zw
.
CreateHeader
(
&
FileHeader
{
Name
:
"foo"
,
Method
:
Deflate
,
})
w
.
Write
(
bigBuf
)
}
zw
.
Close
()
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment