964 karma · joined May 28, 2021
Same query - what romanian football player won the premier league
update. Even instant returns correct result without problems
I remember only a single breakage of previously compiling code with the time crate because of a change in type inference, but even there the compiler told me to update the lib. And that’s in 6 years of using Rust.
Damn this is a lot of self correcting
Traveling into kernel flushes branch predictor caches, tlb. So it's not free at all.
int main() {
std::vector<int> vec = {1, 2, 3};
vec.reserve(3);
std::cout << "Initial capacity: " << vec.capacity() << std::endl;
std::cout << "Initial data address: " << (void*)vec.data() << std::endl;
int* ptr = vec.data();
std::cout << "Pointer before push_back: " << (void*)ptr << std::endl;
std::cout << "Value via pointer before push_back: " << *ptr << std::endl;
std::cout << "\nPushing back 4...\n" << std::endl;
vec.push_back(4);
std::cout << "New capacity: " << vec.capacity() << std::endl;
std::cout << "New data address: " << (void*)vec.data() << std::endl;
std::cout << "\nAttempting to access data via the old pointer..." << std::endl;
std::cout << "Old pointer value: " << (void*)ptr << std::endl;
int value = *ptr;
std::cout << "Read from dangling pointer (UB): " << value << std::endl;
return 0;
}
./a.out
Initial capacity: 3
Initial data address: 0x517d2b0
Pointer before push_back: 0x517d2b0
Value via pointer before push_back: 1Pushing back 4...
New capacity: 6 New data address: 0x517d6e0
Attempting to access data via the old pointer... Old pointer value: 0x517d2b0 Read from dangling pointer (UB): 20861
iced-cpuid $(which b3sum) AVX AVX2 AVX512F AVX512VL BMI1 CET_IBT CMOV SSE SSE2 SSE4_1 SSSE3 SYSCALL XSAVE
iced-cpuid $(which openssl ) CET_IBT CMOV SSE SSE2
iced-cpuid $(which sha256sum) CET_IBT CMOV SSE SSE2
Also, sha256sum in my case is a bit faster
Benchmark 1: openssl sha256 /tmp/rand_1G Time (mean ± σ): 540.0 ms ± 1.1 ms [User: 406.2 ms, System: 132.0 ms] Range (min … max): 538.5 ms … 542.3 ms 10 runs
Benchmark 2: b3sum --num-threads 1 /tmp/rand_1G Time (mean ± σ): 279.6 ms ± 0.8 ms [User: 213.9 ms, System: 64.4 ms] Range (min … max): 278.6 ms … 281.1 ms 10 runs
Benchmark 3: sha256sum /tmp/rand_1G Time (mean ± σ): 509.0 ms ± 6.3 ms [User: 386.4 ms, System: 120.5 ms] Range (min … max): 504.6 ms … 524.2 ms 10 runs
It's currently operating at 5 Gbps, but it is expected to scale significantly based on traffic trends. It appears to be more cost-effective to rent multiple 5 Gbps boxes rather than a single 20 Gbps box. The protocol used is protobuf over HTTPS (not gRPC) without channels, and it is stateless. The application proxies requests to underlying services, and is capable of handling 10 Gbps of requests on 8 cores. While the likelihood of a DDoS attack seems low, it is not entirely immune. Though there is no strict SLA, the service aims for availability 99.5% of the time