• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //
2 // Copyright 2015 The ANGLE Project Authors. All rights reserved.
3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file.
5 //
6 // IndexDataManagerPerfTest:
7 //   Performance test for index buffer management.
8 //
9 
10 #include "ANGLEPerfTest.h"
11 
12 #include <gmock/gmock.h>
13 
14 #include "common/bitset_utils.h"
15 
16 using namespace testing;
17 
18 namespace
19 {
20 
21 template <typename T>
22 class BitSetIteratorPerfTest : public ANGLEPerfTest
23 {
24   public:
25     BitSetIteratorPerfTest();
26 
27     void step() override;
28 
29     T mBits;
30 };
31 
32 template <typename T>
BitSetIteratorPerfTest()33 BitSetIteratorPerfTest<T>::BitSetIteratorPerfTest()
34     : ANGLEPerfTest("BitSetIteratorPerf", "", "_run", 1)
35 {}
36 
37 template <typename T>
step()38 void BitSetIteratorPerfTest<T>::step()
39 {
40     mBits.flip();
41 
42     for (size_t bit : mBits)
43     {
44         ANGLE_UNUSED_VARIABLE(bit);
45     }
46 
47     mBits.reset();
48 }
49 
50 // These type names unfortunately don't get printed correctly in Gtest.
51 using TestTypes = Types<angle::BitSet32<32>,
52                         angle::BitSet64<32>,
53                         angle::BitSet64<64>,
54                         angle::BitSet<96>,
55                         angle::BitSetArray<96>>;
56 TYPED_TEST_SUITE(BitSetIteratorPerfTest, TestTypes);
57 
TYPED_TEST(BitSetIteratorPerfTest,Run)58 TYPED_TEST(BitSetIteratorPerfTest, Run)
59 {
60     this->run();
61 }
62 
63 }  // anonymous namespace
64