-
Notifications
You must be signed in to change notification settings - Fork 108
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
Add obelisk profiling feature #654
Conversation
This makes it easier to add ‘Ob run’-like commands by factoring out important bits.
This adds profiled attr to set enableLibraryProfiling to true. If not set, it defaults to profiling arg.
This dumps some profiling information that can be viewed and used to debug Obelisk projects. ‘ob profile’ works like ob run, but instead of using ghci, it builds an executable that is built with profiling enabled.
This avoids polluting the root directory and gives some ability to reference multiple profiles.
This avoids a call every .1 seconds.
This module will always be there, and no need to add annotations. backend & frontend still get their annotations.
This is unnecessary as we import immediately in the expression.
This avoids an issue with precedence in case of obRunExpr using $.
This avoids having to mix up options for ob run and ob profile. Makes the way for adding a -o option to ob profile.
This avoids embedding this information into the binary.
This allow caching between ob profile runs.
Avoid showing it in the help documentation. Just do it when it is needed.
It seems safer to use an absolute path here. I originally assumed it would save it to the executable's directory, not the CWD. That's not the case, but the documentation leaves that behavior unspecified (https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/profiling.html#rts-flag--po%20%E2%9F%A8stem%E2%9F%A9), and I'd prefer to not have to debug it if it ever changes. |
This allows custom flags to be provided by the user. For instance, there are multiple types of heap profiles that can be used to get different information from ob profile. These can be added with the --rts-flags option.
This makes the default more obvious in the command line options.
- Use list of strings for rts args - Move time handling to the profile function, out of argument handling
dep/reflex-platform/github.json
Outdated
@@ -1,8 +1,8 @@ | |||
{ | |||
"owner": "reflex-frp", | |||
"repo": "reflex-platform", | |||
"branch": "master", | |||
"branch": "bump-reflex-0-6-4-1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once this is merged we should bump and then we can merge here.
adds: - profileRtsFlag - profileOutputFlag to avoid massively long lines.
This file is just a static nix script. We can avoid hereDoc and just hit the attr directly. In addition, add the skeleton’s profiledObRun to the release.nix.
pinBuildInputs tries to run binaries when they exist. We don’t want that, so we need to wrap it in a directory with $out/bin/ob-run containing the actual binary.
$out/bin/ob-run was a mistake
Adds obelisk profile command. This dumps some profiling information into the profile/ directory that can give you some idea of what your program is spending resources on. Currently outputs 3 profiles:
I have:
develop
branchhlint .
(lint found code you did not write can be left alone)$(nix-build -A selftest --no-out-link)
nix-build release.nix -A build.x86_64-linux --no-out-link
(orx86_64-darwin
on macOS)