Use std::vector instead of std:list for ArenaAllocWithUsageInterval container

When the number of tensors are is 1000, it affects about 80ms.

PiperOrigin-RevId: 303060329
Change-Id: Ibd70d04f6a216f3b2e87c0ea3143b6e148d8049c
This commit is contained in:
Terry Heo 2020-03-26 01:03:44 -07:00 committed by TensorFlower Gardener
parent 47140aa69d
commit 746dd10372

View File

@ -16,8 +16,8 @@ limitations under the License.
#define TENSORFLOW_LITE_SIMPLE_MEMORY_ARENA_H_
#include <cstdint>
#include <list>
#include <memory>
#include <vector>
#include "tensorflow/lite/c/common.h"
@ -112,7 +112,7 @@ class SimpleMemoryArena {
std::unique_ptr<char[]> underlying_buffer_;
size_t underlying_buffer_size_;
char* underlying_buffer_aligned_ptr_;
std::list<ArenaAllocWithUsageInterval> ordered_allocs_;
std::vector<ArenaAllocWithUsageInterval> ordered_allocs_;
};
} // namespace tflite