Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(139)

Side by Side Diff: net/base/mime_sniffer_perftest.cc

Issue 1151353005: Use the exact-width integer types defined in <stdint.h> rather than (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/base/mime_sniffer.cc ('k') | net/base/mime_sniffer_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/base/mime_sniffer.h" 5 #include "net/base/mime_sniffer.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bits.h" 9 #include "base/bits.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 static_cast<size_t>( 92 static_cast<size_t>(
93 1u << base::bits::Log2Ceiling(kTargetSize / plaintext.size())); 93 1u << base::bits::Log2Ceiling(kTargetSize / plaintext.size()));
94 plaintext.reserve(expected_size); 94 plaintext.reserve(expected_size);
95 while (plaintext.size() < kTargetSize) 95 while (plaintext.size() < kTargetSize)
96 plaintext += plaintext; 96 plaintext += plaintext;
97 DCHECK_EQ(expected_size, plaintext.size()); 97 DCHECK_EQ(expected_size, plaintext.size());
98 RunLooksLikeBinary(plaintext, kWarmupIterations); 98 RunLooksLikeBinary(plaintext, kWarmupIterations);
99 base::ElapsedTimer elapsed_timer; 99 base::ElapsedTimer elapsed_timer;
100 RunLooksLikeBinary(plaintext, kMeasuredIterations); 100 RunLooksLikeBinary(plaintext, kMeasuredIterations);
101 LOG(INFO) << (elapsed_timer.Elapsed().InMicroseconds() * 1000 * 1024 / 101 LOG(INFO) << (elapsed_timer.Elapsed().InMicroseconds() * 1000 * 1024 /
102 (static_cast<int64>(plaintext.size()) * kMeasuredIterations)) 102 (static_cast<int64_t>(plaintext.size()) * kMeasuredIterations))
103 << "ns per KB"; 103 << "ns per KB";
104 } 104 }
105 105
106 } // namespace net 106 } // namespace net
107 } // namespace 107 } // namespace
OLDNEW
« no previous file with comments | « net/base/mime_sniffer.cc ('k') | net/base/mime_sniffer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698