File tree Expand file tree Collapse file tree 2 files changed +8
-30
lines changed
Expand file tree Collapse file tree 2 files changed +8
-30
lines changed Original file line number Diff line number Diff line change @@ -8,20 +8,12 @@ macro_rules! ok(($result:expr) => ($result.unwrap()));
88
99#[ bench]
1010fn compress ( bencher : & mut Bencher ) {
11- bencher. iter ( || {
12- ok ! ( woff:: version1:: convert(
13- "tests/fixtures/Roboto-Regular.ttf" ,
14- "tests/fixtures/Roboto-Regular.ttf.woff" ,
15- ) ) ;
16- } ) ;
11+ let data = ok ! ( std:: fs:: read( "tests/fixtures/Roboto-Regular.ttf" ) ) ;
12+ bencher. iter ( || ok ! ( woff:: version1:: compress( & data, 1 , 0 ) ) ) ;
1713}
1814
1915#[ bench]
2016fn decompress ( bencher : & mut Bencher ) {
21- bencher. iter ( || {
22- ok ! ( woff:: version1:: convert(
23- "tests/fixtures/Roboto-Regular.ttf.woff" ,
24- "tests/fixtures/Roboto-Regular.ttf" ,
25- ) ) ;
26- } ) ;
17+ let data = ok ! ( std:: fs:: read( "tests/fixtures/Roboto-Regular.ttf.woff" ) ) ;
18+ bencher. iter ( || ok ! ( woff:: version1:: decompress( & data) ) ) ;
2719}
Original file line number Diff line number Diff line change @@ -8,26 +8,12 @@ macro_rules! ok(($result:expr) => ($result.unwrap()));
88
99#[ bench]
1010fn compress ( bencher : & mut Bencher ) {
11- bencher. iter ( || {
12- ok ! ( woff:: version2:: convert(
13- "tests/fixtures/Roboto-Regular.ttf" ,
14- "tests/fixtures/Roboto-Regular.ttf.woff2" ,
15- None ,
16- None ,
17- None ,
18- ) ) ;
19- } ) ;
11+ let data = ok ! ( std:: fs:: read( "tests/fixtures/Roboto-Regular.ttf" ) ) ;
12+ bencher. iter ( || ok ! ( woff:: version2:: compress( & data, 8 , "" , true ) ) ) ;
2013}
2114
2215#[ bench]
2316fn decompress ( bencher : & mut Bencher ) {
24- bencher. iter ( || {
25- ok ! ( woff:: version2:: convert(
26- "tests/fixtures/Roboto-Regular.ttf.woff2" ,
27- "tests/fixtures/Roboto-Regular.ttf" ,
28- None ,
29- None ,
30- None ,
31- ) ) ;
32- } ) ;
17+ let data = ok ! ( std:: fs:: read( "tests/fixtures/Roboto-Regular.ttf.woff2" ) ) ;
18+ bencher. iter ( || ok ! ( woff:: version2:: decompress( & data) ) ) ;
3319}
You can’t perform that action at this time.
0 commit comments