{"action":"created","issue":{"url":"https://api.github.com/repos/sabel83/metashell/issues/27","labels_url":"https://api.github.com/repos/sabel83/metashell/issues/27/labels{/name}","comments_url":"https://api.github.com/repos/sabel83/metashell/issues/27/comments","events_url":"https://api.github.com/repos/sabel83/metashell/issues/27/events","html_url":"https://github.com/sabel83/metashell/pull/27","id":102449655,"number":27,"title":"Pager support and experimental profiling in MDB","user":{"login":"r0mai","id":6103818,"avatar_url":"https://avatars.githubusercontent.com/u/6103818?v=3","gravatar_id":"","url":"https://api.github.com/users/r0mai","html_url":"https://github.com/r0mai","followers_url":"https://api.github.com/users/r0mai/followers","following_url":"https://api.github.com/users/r0mai/following{/other_user}","gists_url":"https://api.github.com/users/r0mai/gists{/gist_id}","starred_url":"https://api.github.com/users/r0mai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/r0mai/subscriptions","organizations_url":"https://api.github.com/users/r0mai/orgs","repos_url":"https://api.github.com/users/r0mai/repos","events_url":"https://api.github.com/users/r0mai/events{/privacy}","received_events_url":"https://api.github.com/users/r0mai/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-21T19:43:19Z","updated_at":"2015-08-23T18:49:23Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/sabel83/metashell/pulls/27","html_url":"https://github.com/sabel83/metashell/pull/27","diff_url":"https://github.com/sabel83/metashell/pull/27.diff","patch_url":"https://github.com/sabel83/metashell/pull/27.patch"},"body":"This should not be merged before the release.\r\n\r\n### Pager\r\n\r\nContains support for pager for MDB commands which tend to have long outputs (ft and bt). Possible output on a very short terminal:\r\n```cpp\r\n(mdb) ft\r\nint_<fib<40>::value>\r\n+ fib<40> (TemplateInstantiation from <stdin>:2:31)\r\n| + fib<39> (TemplateInstantiation from ./../fib.hpp:3:32)\r\n| | + fib<38> (TemplateInstantiation from ./../fib.hpp:3:32)\r\n| | | + fib<37> (TemplateInstantiation from ./../fib.hpp:3:32)\r\n| | | | + fib<36> (TemplateInstantiation from ./../fib.hpp:3:32)\r\nNext page (RETURN), Show all (a), Quit (q):\r\n```\r\n\r\n### Profiling\r\n\r\nExperimental profiling support in MDB:\r\n```cpp\r\n(mdb) eval -profile int_<fib<5>::value>\r\nMetaprogram started\r\n(mdb) ft\r\nint_<fib<5>::value>\r\n+ [0.46ms, 79.48%] fib<5> (TemplateInstantiation from <stdin>:2:31)\r\n| + [0.27ms, 45.86%] fib<4> (TemplateInstantiation from ./../fib.hpp:3:32)\r\n| | + [0.20ms, 35.18%] fib<3> (TemplateInstantiation from ./../fib.hpp:3:32)\r\n| | | + [0.12ms, 20.86%] fib<2> (TemplateInstantiation from ./../fib.hpp:3:32)\r\n| | | | + [0.01ms, 1.55%] fib<0> (Memoization from ./../fib.hpp:3:50)\r\n| | | | ` [0.01ms, 1.38%] fib<1> (Memoization from ./../fib.hpp:3:32)\r\n| | | ` [0.01ms, 1.21%] fib<1> (Memoization from ./../fib.hpp:3:50)\r\n| | ` [0.01ms, 0.86%] fib<2> (Memoization from ./../fib.hpp:3:50)\r\n| ` [0.01ms, 1.03%] fib<3> (Memoization from ./../fib.hpp:3:50)\r\n+ [0.05ms, 7.93%] int_<5> (TemplateInstantiation from <stdin>:2:48)\r\n` [0.01ms, 0.86%] fib<5> (Memoization from <stdin>:2:31)\r\n```\r\n\r\nNot visible on the sample output, but the sub-trees are traversed from most-time-taken to least-time-taken, as opposed to the normal instantiation order determined by the compiler.\r\n\r\nDocs and json support are coming in later PRs after the interface is finalized.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/sabel83/metashell/issues/comments/133897098","html_url":"https://github.com/sabel83/metashell/pull/27#issuecomment-133897098","issue_url":"https://api.github.com/repos/sabel83/metashell/issues/27","id":133897098,"user":{"login":"r0mai","id":6103818,"avatar_url":"https://avatars.githubusercontent.com/u/6103818?v=3","gravatar_id":"","url":"https://api.github.com/users/r0mai","html_url":"https://github.com/r0mai","followers_url":"https://api.github.com/users/r0mai/followers","following_url":"https://api.github.com/users/r0mai/following{/other_user}","gists_url":"https://api.github.com/users/r0mai/gists{/gist_id}","starred_url":"https://api.github.com/users/r0mai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/r0mai/subscriptions","organizations_url":"https://api.github.com/users/r0mai/orgs","repos_url":"https://api.github.com/users/r0mai/repos","events_url":"https://api.github.com/users/r0mai/events{/privacy}","received_events_url":"https://api.github.com/users/r0mai/received_events","type":"User","site_admin":false},"created_at":"2015-08-23T18:49:23Z","updated_at":"2015-08-23T18:49:23Z","body":"Few new things has been added to this PR:\r\n* Tests for profile mode\r\n* Added profile mode information to json output, and json docs\r\n* Added experimental support to evaluate the whole environment (mainly to aid the profiling of compile time bottlenecks):\r\n\r\n```cpp\r\n> #include \"fib.hpp\"\r\n> int_<fib<4>::value> x;\r\n> int_<fib<5>::value> y;\r\n> #msh mdb -\r\nFor help, type \"help\".\r\nMetaprogram started\r\n(mdb) ft\r\n<environment>\r\n+ fib<4> (TemplateInstantiation from /tmp/just-FTwiwY/metashell_environment.hpp:8:6)\r\n| + fib<2> (TemplateInstantiation from ../fib.hpp:3:32)\r\n| | + fib<0> (Memoization from ../fib.hpp:3:32)\r\n| | ` fib<1> (Memoization from ../fib.hpp:3:50)\r\n| ` fib<3> (TemplateInstantiation from ../fib.hpp:3:50)\r\n|   + fib<1> (Memoization from ../fib.hpp:3:32)\r\n|   ` fib<2> (Memoization from ../fib.hpp:3:50)\r\n+ fib<4> (Memoization from /tmp/just-FTwiwY/metashell_environment.hpp:8:6)\r\n+ int_<5> (TemplateInstantiation from /tmp/just-FTwiwY/metashell_environment.hpp:8:21)\r\n+ int_<5> (Memoization from /tmp/just-FTwiwY/metashell_environment.hpp:8:21)\r\n+ fib<5> (TemplateInstantiation from /tmp/just-FTwiwY/metashell_environment.hpp:9:6)\r\n| + fib<3> (Memoization from ../fib.hpp:3:32)\r\n| ` fib<4> (Memoization from ../fib.hpp:3:50)\r\n+ fib<5> (Memoization from /tmp/just-FTwiwY/metashell_environment.hpp:9:6)\r\n+ int_<8> (TemplateInstantiation from /tmp/just-FTwiwY/metashell_environment.hpp:9:21)\r\n` int_<8> (Memoization from /tmp/just-FTwiwY/metashell_environment.hpp:9:21)\r\n```"}}