Nytro Posted August 31, 2014 Report Share Posted August 31, 2014 [h=2]folly/FBvector.h[/h] Simply replacing std::vector with folly::fbvector (after having included the folly/FBVector.h header file) will improve the performance of your C++ code using vectors with common coding patterns. The improvements are always non-negative, almost always measurable, frequently significant, sometimes dramatic, and occasionally spectacular. [h=3]Sample[/h] folly::fbvector<int> numbers({0, 1, 2, 3});numbers.reserve(10);for (int i = 4; i < 10; i++) { numbers.push_back(i * 2);}assert(numbers[6] == 12); [h=3]Motivation[/h] std::vector is the stalwart abstraction many use for dynamically-allocated arrays in C++. It is also the best known and most used of all containers. It may therefore seem a surprise that std::vector leaves important - and sometimes vital - efficiency opportunities on the table. This document explains how our own drop-in abstraction fbvector improves key performance aspects of std::vector. Refer to folly/test/FBVectorTest.cpp for a few benchmarks.Sursa: https://github.com/facebook/folly/blob/master/folly/docs/FBVector.md Quote Link to comment Share on other sites More sharing options...
CosminAlexandru41 Posted September 14, 2014 Report Share Posted September 14, 2014 Da sunt ok ... mici defecte dar este ok. multam nytro Quote Link to comment Share on other sites More sharing options...