JulesKouatchou / basic_language_comparison

Other
85 stars 21 forks source link

Avoid intermediate printing in benchmarks #11

Open DNF2 opened 3 years ago

DNF2 commented 3 years ago

Some benchmarks use quite a bit of printing to stdout during the benchmarks. This is not a good idea, and will in some cases dominate runtime.

In particular, the test_count_unique_words.jl prints each line before counting the words. Now, the current implementation of word count is very inefficient, but still, the printing of each line takes 10-100x as long as the word count itself. File reading will also dominate.

If the purpose of the benchmark is to measure the performance of string manipulation, then reading from file and printing to stdout will make the benchmark meaningless, as it almost only measures the latter two.

JulesKouatchou commented 1 year ago

Sorry for the late response. I will address the issue in the next set of runs.