PLEASE NOTE: the upgrades to this server,, have not yet been completed.
Hopefully the changes will be completed on THURSDAY 8th December.
Web-based programs, such as csmarks, cssubmit, and the help fora, will be unavailable at some time on Thursday 8th.
  It's UWAweek 49


This forum is provided to promote discussion amongst students enrolled in Open Source Tools and Scripting.

Please consider offering answers and suggestions to help other students! And if you fix a problem by following a suggestion here, it would be great if other interested students could see a short "Great, fixed it!"  followup message.

How do I ask a good question?
Displaying selected article
Showing 1 of 564 articles.
Currently 3 other people reading this forum.

 UWA week 17 (1st semester, week 8) ↓
SVG not supported

Login to reply

8:20pm Tue 26th Apr, Marc E.

Hi! I have read the past thread regarding the program speed, so far my Part1 is doing good (not the 0.2 second that Michael has but my time is still ok). However, I am having problems with Part 2 in terms of speed. I have tried everything to reduce the runtime. I am using a for loop to extract the top common word in each file (all 10 of them) and that's took me 22 seconds. Using awk, I managed to get it down to 15 seconds but that is still while using a for loop. I am not sure what else to do to get this down. I made sure that I am not using sub-shells as well to be more efficient. Combining awk and sed is slower than awk and tr for me, so I am not sure what else to do. I even tried using perl (but I suppose that it is beyond the scope of this unit). On another note, why is running loops so inefficient in bash? Running exactly the same logic in R or python for the same task is giving me about 0.12 seconds, against 15seconds in bash.

The University of Western Australia

Computer Science and Software Engineering

CRICOS Code: 00126G
Written by [email protected]
Powered by history
Feedback always welcome - it makes our software better!
Last modified  1:17AM Sep 14 2022
Privacy policy