loop A supercharged std::vector implementation (minus Allocator)

License: CC-BY-4.0

Language: C++

Keywords: c-plus-plus, c-plus-plus-17, clang, data-structures, dynamic-table, gcc, memory-reallocations, vector, visual-studio


A proof-of-concept/partial implementation to demonstrate how fast std::vector could have been.

It's just a proof-of-concept (for now at least),
which means it's NOT standard-compliant and lacks many, many implementation details.


#include "vector.h"

int main() {
    int i;
    lni::vector<int> v1;
    for (i = 0; i < 10000000; ++i)
    for (auto &n: v1)
        printf("%d ", n);

    return 0;

Test Results

Homebrew-gcc 6.1.0
g++ tester.cpp && ./a.out

lni::vector 0.105s
std::vector 0.242s


Creative Commons Attribution 4.0 International

lni::vector by Jasmine "lnishan" Chen is licensed under a Creative Commons Attribution 4.0 International License.

Project Statistics

Sourcerank 5
Repository Size 1.03 MB
Stars 66
Forks 20
Watchers 4
Open issues 7
Dependencies 0
Contributors 1
Tags 1
Last updated
Last pushed

Top Contributors See all

Jasmine Chen

Recent Tags See all

v1.0 June 18, 2016

Something wrong with this page? Make a suggestion

Last synced: 2016-06-08 22:00:42 UTC

Login to resync this repository