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

Side by Side Diff: media/base/vector_math_perftest.cc

Issue 70833002: Fix demuxer_perftest file paths and adjust various perftests' iterations/units. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 1 month 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 | « media/base/sinc_resampler_perftest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "base/cpu.h" 5 #include "base/cpu.h"
6 #include "base/memory/aligned_memory.h" 6 #include "base/memory/aligned_memory.h"
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/time/time.h" 8 #include "base/time/time.h"
9 #include "media/base/vector_math.h" 9 #include "media/base/vector_math.h"
10 #include "media/base/vector_math_testing.h" 10 #include "media/base/vector_math_testing.h"
(...skipping 25 matching lines...) Expand all
36 bool aligned, 36 bool aligned,
37 const std::string& test_name, 37 const std::string& test_name,
38 const std::string& trace_name) { 38 const std::string& trace_name) {
39 TimeTicks start = TimeTicks::HighResNow(); 39 TimeTicks start = TimeTicks::HighResNow();
40 for (int i = 0; i < kBenchmarkIterations; ++i) { 40 for (int i = 0; i < kBenchmarkIterations; ++i) {
41 fn(input_vector_.get(), 41 fn(input_vector_.get(),
42 kScale, 42 kScale,
43 kVectorSize - (aligned ? 0 : 1), 43 kVectorSize - (aligned ? 0 : 1),
44 output_vector_.get()); 44 output_vector_.get());
45 } 45 }
46 double total_time_seconds = (TimeTicks::HighResNow() - start).InSecondsF(); 46 double total_time_milliseconds =
47 (TimeTicks::HighResNow() - start).InMillisecondsF();
47 perf_test::PrintResult(test_name, 48 perf_test::PrintResult(test_name,
48 "", 49 "",
49 trace_name, 50 trace_name,
50 kBenchmarkIterations / total_time_seconds, 51 kBenchmarkIterations / total_time_milliseconds,
51 "runs/s", 52 "runs/ms",
52 true); 53 true);
53 } 54 }
54 55
55 protected: 56 protected:
56 scoped_ptr_malloc<float, base::ScopedPtrAlignedFree> input_vector_; 57 scoped_ptr_malloc<float, base::ScopedPtrAlignedFree> input_vector_;
57 scoped_ptr_malloc<float, base::ScopedPtrAlignedFree> output_vector_; 58 scoped_ptr_malloc<float, base::ScopedPtrAlignedFree> output_vector_;
58 59
59 DISALLOW_COPY_AND_ASSIGN(VectorMathPerfTest); 60 DISALLOW_COPY_AND_ASSIGN(VectorMathPerfTest);
60 }; 61 };
61 62
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 ASSERT_EQ(kVectorSize % (vector_math::kRequiredAlignment / sizeof(float)), 116 ASSERT_EQ(kVectorSize % (vector_math::kRequiredAlignment / sizeof(float)),
116 0U); 117 0U);
117 RunBenchmark( 118 RunBenchmark(
118 vector_math::FMUL_FUNC, true, "vector_math_fmac", "optimized_aligned"); 119 vector_math::FMUL_FUNC, true, "vector_math_fmac", "optimized_aligned");
119 #endif 120 #endif
120 } 121 }
121 122
122 #undef FMUL_FUNC 123 #undef FMUL_FUNC
123 124
124 } // namespace media 125 } // namespace media
OLDNEW
« no previous file with comments | « media/base/sinc_resampler_perftest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698