Avatar ·

मेरा C++ कोड array size 8192 होने पर बहुत धीमा क्यों हो जाता है?

सभी को नमस्ते। मैं C++ में image processing का program लिख रहा हूँ। मुझे एक अजीब problem मिली: जब मेरे array का size (या loop का step) ठीक 8192 elements होता है, तो program 10 गुना धीमा चलने लगता है। 8191 या 8193 size पर सब कुछ तेज़ चलता है। यहाँ simplified code है जो problem को reproduce करता है: ```cpp #include #include #include int main() { const int SIZE = 8192; // अगर 8191 या 8193 से replace करें तो speed normal है std::vector> matrix(SIZE, std::vector(SIZE, 1)); auto start = std::chrono::high_resolution_clock::now(); long long sum = 0; for (int i = 0; i < SIZE; ++i) { for (int j = 0; j < SIZE; ++j) { sum += matrix[i][j]; } } auto end = std::c