Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

What is the performance of the forward_list container in Clover 11?

Shulou Source: shulou.com Published: 2022-06-01 19:12:12 10月02日 Update

This article mainly explains the "how is the performance of the forward_list container in Craft 11". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "how is the performance of the forward_list container in Craft 11".

To understand the performance of the forward_list container, we write the following code to test the efficiency of the insert operation:

Struct Node {

Node (int v): value (v), next (nullptr) {}

Node* next

Int value

}

DWORD begin = GetTickCount ()

/ / std::forward_list list

/ *

Std::list list

For (int I = 0; I

< 10000000; ++i) list.push_front(i); */ Node* head = nullptr; for(int i = 0; i < 10000000; ++i){ Node* new_node = new Node(i); new_node->

Next = head;,

Head = new_node

}

DWORD end = GetTickCount ()

Std::cout

Tags: Containers performance efficiency results learning code content speed fastest accident memory again that is ideas situations articles more knowledge knowledge points articles Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Information Shulou Tech Info vpn Microsoft macOS