i’m trying to profile a quicksort code. the code is as follows:
qsort [] = []
qsort (x:xs) = qsort (filter (< x) xs) ++ [x] ++ qsort (filter (>= x) xs)
please help me out!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Assuming you use GHC, you can enable profiling with the
-profflag (probably-auto-alland-caf-allfor more detail).Then you run your program with
./a.out +RTS -pto generate the profiling result ina.out.prof.The profile only include the total time and memory spent on each function. Which may not be suitable for you, since there’s only one function
qsort. Compile the program normally and run with./a.out +RTS -sstderrmay have enough information already.See