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:
parent
47140aa69d
commit
746dd10372
@ -16,8 +16,8 @@ limitations under the License.
|
|||||||
#define TENSORFLOW_LITE_SIMPLE_MEMORY_ARENA_H_
|
#define TENSORFLOW_LITE_SIMPLE_MEMORY_ARENA_H_
|
||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <list>
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
#include "tensorflow/lite/c/common.h"
|
#include "tensorflow/lite/c/common.h"
|
||||||
|
|
||||||
@ -112,7 +112,7 @@ class SimpleMemoryArena {
|
|||||||
std::unique_ptr<char[]> underlying_buffer_;
|
std::unique_ptr<char[]> underlying_buffer_;
|
||||||
size_t underlying_buffer_size_;
|
size_t underlying_buffer_size_;
|
||||||
char* underlying_buffer_aligned_ptr_;
|
char* underlying_buffer_aligned_ptr_;
|
||||||
std::list<ArenaAllocWithUsageInterval> ordered_allocs_;
|
std::vector<ArenaAllocWithUsageInterval> ordered_allocs_;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace tflite
|
} // namespace tflite
|
||||||
|
Loading…
Reference in New Issue
Block a user