We calculate the execution time taken by Python to find the word counts of a small file (45.6 KB) and an extremely big file (6.5 MB) and compare our findings. To do this, we first read the respective files, calculate word counts and then write the results to the file. The execution time is calculated from the reading the file to when the results have been written.
- Python
- windows
- apache-hadoop-wiki.txt: 46.5 KB
- big.txt: 6.5 MB
- Import this project.
- Navigate to the path with the python code.
- Execute the program in cmd using:
python.exe smallWordCount.py
python.exe bigWordCount.py
The average execution times in Python were found to be:
- apache-hadoop-wiki.txt: 0.006 seconds (rounded off)
- big.txt: 1.154 seconds (rounded off)
To view the word count programs for
To view the results of the word counts