#include using namespace Upp; CONSOLE_APP_MAIN { Vector data; for(int i = 0; i < 1000; i++) data.Add(Random() & 1); int N = 100000; for(int k = 0; k < N; k++) { { RTIMING("Vector::At"); Vector h; for(int j = 0; j < data.GetCount(); j++) h.At(j, false) = data[j]; } { RTIMING("Vector::Add"); Vector h; for(int j = 0; j < data.GetCount(); j++) h.Add(data[j]); } { RTIMING("Vector::At / Reserve"); Vector h; h.Reserve(data.GetCount()); for(int j = 0; j < data.GetCount(); j++) h.At(j, false) = data[j]; } { RTIMING("Vector::Add / Reserve"); Vector h; h.Reserve(data.GetCount()); for(int j = 0; j < data.GetCount(); j++) h.Add(data[j]); } { RTIMING("Bits"); Bits h; for(int j = 0; j < data.GetCount(); j++) h.Set(j, data[j]); } { RTIMING("Bits / Reserve"); Bits h; h.Reserve(data.GetCount()); for(int j = 0; j < data.GetCount(); j++) h.Set(j, data[j]); } } }