diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000000000000000000000000000000000000..3e99ede35449c19657050b5668845a4690f035b3 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,7 @@ +{ + "python.testing.pytestArgs": [ + "." + ], + "python.testing.unittestEnabled": false, + "python.testing.pytestEnabled": true +} \ No newline at end of file diff --git a/__pycache__/test_chargement.cpython-310-pytest-8.3.5.pyc b/__pycache__/test_chargement.cpython-310-pytest-8.3.5.pyc new file mode 100644 index 0000000000000000000000000000000000000000..bed2af3036449cfaded3317402fe03f409368ef1 Binary files /dev/null and b/__pycache__/test_chargement.cpython-310-pytest-8.3.5.pyc differ diff --git a/__pycache__/test_chercherdossier.cpython-310-pytest-8.3.5.pyc b/__pycache__/test_chercherdossier.cpython-310-pytest-8.3.5.pyc new file mode 100644 index 0000000000000000000000000000000000000000..25417afddbde93e39f88d3e1f99cdcb58df095c4 Binary files /dev/null and b/__pycache__/test_chercherdossier.cpython-310-pytest-8.3.5.pyc differ diff --git a/__pycache__/test_multithrading_logo.cpython-310-pytest-8.3.5.pyc b/__pycache__/test_multithrading_logo.cpython-310-pytest-8.3.5.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5c0355b28dae0907d99d34d4ef2e093187125f88 Binary files /dev/null and b/__pycache__/test_multithrading_logo.cpython-310-pytest-8.3.5.pyc differ diff --git a/__pycache__/test_nouveautestthreding.cpython-310-pytest-8.3.5.pyc b/__pycache__/test_nouveautestthreding.cpython-310-pytest-8.3.5.pyc new file mode 100644 index 0000000000000000000000000000000000000000..574f08c449b1eaa692997d1b9f2c514422cc3c8e Binary files /dev/null and b/__pycache__/test_nouveautestthreding.cpython-310-pytest-8.3.5.pyc differ diff --git a/__pycache__/test_recup_info.cpython-310-pytest-8.3.5.pyc b/__pycache__/test_recup_info.cpython-310-pytest-8.3.5.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e33a043a73459068f6c2832c2b52352e981474d7 Binary files /dev/null and b/__pycache__/test_recup_info.cpython-310-pytest-8.3.5.pyc differ diff --git a/test_nouveautestthreding.py b/test_nouveautestthreding.py new file mode 100644 index 0000000000000000000000000000000000000000..31ab9c990d82748fe441173c443491a04eae997d --- /dev/null +++ b/test_nouveautestthreding.py @@ -0,0 +1,48 @@ +import threading +import time + +# Function to perform a computational task +def compute_task(start, end): + total = 0 + for i in range(start, end): + total += i ** 2 + return total + +# Wrapper function for threading +def thread_wrapper(start, end, results, index): + results[index] = compute_task(start, end) + +# Single-threaded execution +def single_threaded(): + start_time = time.time() + compute_task(0, 10_000_000) + end_time = time.time() + return end_time - start_time + +# Multi-threaded execution +def multi_threaded(): + start_time = time.time() + num_threads = 4 + step = 10_000_000 // num_threads + threads = [] + results = [0] * num_threads + + for i in range(num_threads): + t = threading.Thread(target=thread_wrapper, args=(i * step, (i + 1) * step, results, i)) + threads.append(t) + t.start() + + for t in threads: + t.join() + + end_time = time.time() + return end_time - start_time + +# Main function to compare performance +if __name__ == "__main__": + single_thread_time = single_threaded() + multi_thread_time = multi_threaded() + + print(f"Single-threaded execution time: {single_thread_time:.4f} seconds") + print(f"Multi-threaded execution time: {multi_thread_time:.4f} seconds") + print("Multi-threading is faster!" if multi_thread_time < single_thread_time else "Single-threading is faster!") \ No newline at end of file diff --git a/volley_mire_detection/scripts/__pycache__/test_model.cpython-310-pytest-8.3.5.pyc b/volley_mire_detection/scripts/__pycache__/test_model.cpython-310-pytest-8.3.5.pyc new file mode 100644 index 0000000000000000000000000000000000000000..cc5e0a6d21db85a3c4a6ef9154bc067e9bda0a95 Binary files /dev/null and b/volley_mire_detection/scripts/__pycache__/test_model.cpython-310-pytest-8.3.5.pyc differ