Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Userspace time measurement #4

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

0xd34df00d
Copy link

I'm only replicating the behavior of timeItT. Replicating other functions seems unreasonable (looks like it's not a particularly widely needed feature, so I'm not sure cluttering the API is worth it), and changing the API to unify total CPU time vs userspace time (and maybe vs kernel time) is probably not worthy for the same reasons (compatibility seems to be more important than this feature).

System/GetRUsage.hsc Outdated Show resolved Hide resolved
@merijn
Copy link
Owner

merijn commented Mar 17, 2020

Sorry it took so long to take a look at this, but things have been a bit hectic. Mostly looks fine, I'll probably first bump the current Travis tests to the latest GHC, then merge this later today/tomorrow.

@merijn merijn force-pushed the usertime branch 2 times, most recently from dd2316a to f7df88b Compare March 23, 2020 13:30
@merijn
Copy link
Owner

merijn commented Mar 23, 2020

Sorry, for the slowness, but I've been distracted by the corona lockdown. I just rebased the PR onto updated Travis tests and updated the System.GetRUsage module to be cleaner and compile without errors on older GHCs.

Initially I was going to merge this as-is, but in the interest of avoiding future breaking refactorings I think I'd like to be a bit more systematic. Having thought about it a bit I don't really like having timeItTWith, timeItT, and timeItUserSpaceT separately.

The idea behind timeItT was to have it be the "primitive" version on which everything was based, and having two separate ones is rather ugly. I'd prefer having a single timeItT that computes both userspace CPU time, kernel CPU time (and possibly wallclock) and then project specialised version from there.

But then using getCPUTime as fallback won't work, and simply assuming getrusage exists wouldn't work on Windows unless I find out how to compute the same thing there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants