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

Profiling info for the network evaluator similar to the profiling info for processors #854

Open
r-englund opened this issue Feb 3, 2020 · 15 comments

Comments

@r-englund
Copy link
Member

r-englund commented Feb 3, 2020

I have wanted to have a nice way in Inviwo to see how long the network takes to evaluate, similar to what we have for each processor:
image

I have quickly (and ugly, codewise) hacked a prototype, which can be seen below. It is a widget added to NetworkView, uses the ProcessorNetworkEvaluationObserver to detected when evaluations start and stop.

image

Before putting in more work into it I want some feedback from you.
Right now it uses the StopWatch icon (same as the tool button to reset the processor profiling). ATM it is way too small and has a very bad contrast towards the background. Things that can be done here are, for example: Make it bigger and change color for more contrast; Use text with the current number of evaluations (like the count we have on the processor graphics items); Both text and icon, maybe bigger size.

@r-englund
Copy link
Member Author

Zoom in on current icon without any modifications and no tool tip
image

@r-englund
Copy link
Member Author

@ResearchDaniel
Copy link
Contributor

I guess this is too much work but how about a tree-view with all the profiling measurements? Would be reached through the menu instead...

@r-englund
Copy link
Member Author

I guess this is too much work but how about a tree-view with all the profiling measurements? Would be reached through the menu instead...

I have also thought about that, to have a sortable table view of the profiling measurements for each processor, also including (optional) gpu times. But that requires way more work and solves a different issue

@ResearchDaniel
Copy link
Contributor

Ok, then a "drop-down" instead of pop-up would make sense:
https://material-ui.com/components/expansion-panels/

I would place it below the search bar in the top right and make the background the same as our properties.

@petersteneteg
Copy link
Member

I have a wip branch that does much better profiling then what we get from the cpu callbacks... it also plots stats over time

@r-englund
Copy link
Member Author

Those features you guys suggest are good, but I do not think it makes this feature obsolete.

Me and @martinfalk talked about it and the idea is to move the "icon" down to the status bar and show the tooltip on hover. Something like this (with proper font, not my sloppy handwriting)
bild

@r-englund
Copy link
Member Author

So the question is, are there any interest in my crating a PR for this? Or should I keep it in my own module?

@martinfalk
Copy link
Contributor

I am pretty much in favor of the status bar solutions for some quick feedback. Detailed profiling by @petersteneteg would complement this and is welcome as well :-)

@r-englund
Copy link
Member Author

I am pretty much in favor of the status bar solutions for some quick feedback. Detailed profiling by @petersteneteg would complement this and is welcome as well :-)

The only odd thing with the status bar solution is that the status bar is part of the console widget and not the main window.

@petersteneteg
Copy link
Member

@r-englund I noticed that when I added the treadpool info thing. Should probably be moved into it's own thing some how

@tirpidz
Copy link
Contributor

tirpidz commented Mar 13, 2020

It would be great to have a visual feedback in the graph itself: processor widgets changing colour when they take more time than usual or when the take a big chunk of the whole network evaluation time.

@tirpidz
Copy link
Contributor

tirpidz commented Mar 13, 2020

An other way, would be to use the chromium devtools: https://developers.google.com/web/updates/2016/12/devtools-javascript-cpu-profile-migration From the look of it, there is already a lot of tooling to profile & you can record/load a profile with a .json format.

[{"args":{"name":"CrBrowserMain"},"cat":"__metadata","name":"thread_name","ph":"M","pid":23703,"tid":23703,"ts":0},
{"args":{"name":"CrRendererMain"},"cat":"__metadata","name":"thread_name","ph":"M","pid":28787,"tid":1,"ts":0},
{"args":{"name":"Chrome_IOThread"},"cat":"__metadata","name":"thread_name","ph":"M","pid":23703,"tid":23722,"ts":0},
{"args":{"name":"VizCompositorThread"},"cat":"__metadata","name":"thread_name","ph":"M","pid":23738,"tid":23940,"ts":0},
{"args":{"name":"CrGpuMain"},"cat":"__metadata","name":"thread_name","ph":"M","pid":23738,"tid":23738,"ts":0},
{"args":{"name":"SGI_video_sync"},"cat":"__metadata","name":"thread_name","ph":"M","pid":23738,"tid":23942,"ts":0},
{"args":{"name":"Chrome_ChildIOThread"},"cat":"__metadata","name":"thread_name","ph":"M","pid":28787,"tid":4,"ts":0},
{"args":{"name":"Compositor"},"cat":"__metadata","name":"thread_name","ph":"M","pid":28787,"tid":7,"ts":0},
{"args":{"name":"ThreadPoolServiceThread"},"cat":"__metadata","name":"thread_name","ph":"M","pid":23703,"tid":23720,"ts":0},
{"args":{"name":"Chrome_DevToolsADBThread"},"cat":"__metadata","name":"thread_name","ph":"M","pid":23703,"tid":25997,"ts":0},

A quick way to leverage this tool would be to have each processor the events you want to profile & dump it into a json file with the proper format & use the devtools in chrome. My guess is there is way more options/granularity already available waiting to be used :-)
toto

@ResearchDaniel
Copy link
Contributor

@tirpidz is the profiler based on a web component? In that case it would even be possible to feed the info through a data frame directly into a webpage using the web browser. Not as integrated but another option perhaps

@tirpidz
Copy link
Contributor

tirpidz commented Mar 13, 2020

not 100% sure on how it works in chrome, I just hit: ctrl+shift+i inside chrome to bring it on. My guess would be it is web based & open source ;-) A front-end guy would have a much better knowledge of it.

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

No branches or pull requests

5 participants