{"action":"created","issue":{"url":"https://api.github.com/repos/jruby/jruby/issues/3637","repository_url":"https://api.github.com/repos/jruby/jruby","labels_url":"https://api.github.com/repos/jruby/jruby/issues/3637/labels{/name}","comments_url":"https://api.github.com/repos/jruby/jruby/issues/3637/comments","events_url":"https://api.github.com/repos/jruby/jruby/issues/3637/events","html_url":"https://github.com/jruby/jruby/pull/3637","id":130806644,"number":3637,"title":"Truffle omit backtraces","user":{"login":"chrisseaton","id":341094,"avatar_url":"https://avatars.githubusercontent.com/u/341094?v=3","gravatar_id":"","url":"https://api.github.com/users/chrisseaton","html_url":"https://github.com/chrisseaton","followers_url":"https://api.github.com/users/chrisseaton/followers","following_url":"https://api.github.com/users/chrisseaton/following{/other_user}","gists_url":"https://api.github.com/users/chrisseaton/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisseaton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisseaton/subscriptions","organizations_url":"https://api.github.com/users/chrisseaton/orgs","repos_url":"https://api.github.com/users/chrisseaton/repos","events_url":"https://api.github.com/users/chrisseaton/events{/privacy}","received_events_url":"https://api.github.com/users/chrisseaton/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/jruby/jruby/labels/truffle","name":"truffle","color":"fbca04"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/jruby/jruby/milestones/34","html_url":"https://github.com/jruby/jruby/milestones/truffle-dev","labels_url":"https://api.github.com/repos/jruby/jruby/milestones/34/labels","id":1009959,"number":34,"title":"truffle-dev","description":null,"creator":{"login":"chrisseaton","id":341094,"avatar_url":"https://avatars.githubusercontent.com/u/341094?v=3","gravatar_id":"","url":"https://api.github.com/users/chrisseaton","html_url":"https://github.com/chrisseaton","followers_url":"https://api.github.com/users/chrisseaton/followers","following_url":"https://api.github.com/users/chrisseaton/following{/other_user}","gists_url":"https://api.github.com/users/chrisseaton/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisseaton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisseaton/subscriptions","organizations_url":"https://api.github.com/users/chrisseaton/orgs","repos_url":"https://api.github.com/users/chrisseaton/repos","events_url":"https://api.github.com/users/chrisseaton/events{/privacy}","received_events_url":"https://api.github.com/users/chrisseaton/received_events","type":"User","site_admin":false},"open_issues":12,"closed_issues":242,"state":"open","created_at":"2015-03-06T21:20:23Z","updated_at":"2016-02-02T20:26:07Z","due_on":null,"closed_at":null},"comments":5,"created_at":"2016-02-02T20:25:58Z","updated_at":"2016-02-02T23:19:02Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/jruby/jruby/pulls/3637","html_url":"https://github.com/jruby/jruby/pull/3637","diff_url":"https://github.com/jruby/jruby/pull/3637.diff","patch_url":"https://github.com/jruby/jruby/pull/3637.patch"},"body":"Omit backtraces when we think they can't be used, as JRuby IR does. Obviously not going to work for someone looking for the exception by `ObjectSpace` but I think that's the only edge case and you really would have to try very hard to tigger it. Could also upset some debugger stuff? At worst, we can give a nice error message that they'll see and will tell them how to turn it off.\r\n\r\n```ruby\r\nloop do\r\n  start = Time.now\r\n  1_000.times do\r\n    raise rescue 14\r\n  end\r\n  puts Time.now - start\r\nend\r\n```\r\n\r\nNote the tiny number of iterations. On MRI runs in 0.00117 s, JRuby 0.001 s, JRuby+Truffle+Graal before the optimisation 0.469 s. With the optimisation 0.07 s.\r\n\r\nWe still have two bad problems: first, there is still some huge cost somewhere with exceptions we don't know about, which has nothing to do with `iterateFrames` as with the optimisation we don't call that. Secondly, when we actually create a backtrace it's crazy - we materialise all frames in order to get the method object for printing the backtrace.\r\n\r\n@nirvdrum @eregon @pitr-ch @headius @thedarkone"},"comment":{"url":"https://api.github.com/repos/jruby/jruby/issues/comments/178880523","html_url":"https://github.com/jruby/jruby/pull/3637#issuecomment-178880523","issue_url":"https://api.github.com/repos/jruby/jruby/issues/3637","id":178880523,"user":{"login":"thedarkone","id":15688,"avatar_url":"https://avatars.githubusercontent.com/u/15688?v=3","gravatar_id":"","url":"https://api.github.com/users/thedarkone","html_url":"https://github.com/thedarkone","followers_url":"https://api.github.com/users/thedarkone/followers","following_url":"https://api.github.com/users/thedarkone/following{/other_user}","gists_url":"https://api.github.com/users/thedarkone/gists{/gist_id}","starred_url":"https://api.github.com/users/thedarkone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thedarkone/subscriptions","organizations_url":"https://api.github.com/users/thedarkone/orgs","repos_url":"https://api.github.com/users/thedarkone/repos","events_url":"https://api.github.com/users/thedarkone/events{/privacy}","received_events_url":"https://api.github.com/users/thedarkone/received_events","type":"User","site_admin":false},"created_at":"2016-02-02T23:19:02Z","updated_at":"2016-02-02T23:19:02Z","body":"https://github.com/jruby/jruby/blob/522044e96677786d36a4e93d550c6e5abb4e9d1c/truffle/src/main/java/org/jruby/truffle/language/control/RaiseException.java#L23 :smiling_imp:."}}