{"action":"created","issue":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/8870","labels_url":"https://api.github.com/repos/JuliaLang/julia/issues/8870/labels{/name}","comments_url":"https://api.github.com/repos/JuliaLang/julia/issues/8870/comments","events_url":"https://api.github.com/repos/JuliaLang/julia/issues/8870/events","html_url":"https://github.com/JuliaLang/julia/issues/8870","id":47508983,"number":8870,"title":"globals – make their performance less awful","user":{"login":"StefanKarpinski","id":153596,"avatar_url":"https://avatars.githubusercontent.com/u/153596?v=3","gravatar_id":"","url":"https://api.github.com/users/StefanKarpinski","html_url":"https://github.com/StefanKarpinski","followers_url":"https://api.github.com/users/StefanKarpinski/followers","following_url":"https://api.github.com/users/StefanKarpinski/following{/other_user}","gists_url":"https://api.github.com/users/StefanKarpinski/gists{/gist_id}","starred_url":"https://api.github.com/users/StefanKarpinski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StefanKarpinski/subscriptions","organizations_url":"https://api.github.com/users/StefanKarpinski/orgs","repos_url":"https://api.github.com/users/StefanKarpinski/repos","events_url":"https://api.github.com/users/StefanKarpinski/events{/privacy}","received_events_url":"https://api.github.com/users/StefanKarpinski/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/JuliaLang/julia/labels/performance","name":"performance","color":"d7e102"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/JuliaLang/julia/milestones/4","html_url":"https://github.com/JuliaLang/julia/milestones/1.0","labels_url":"https://api.github.com/repos/JuliaLang/julia/milestones/4/labels","id":96266,"number":4,"title":"1.0","description":"","creator":{"login":"StefanKarpinski","id":153596,"avatar_url":"https://avatars.githubusercontent.com/u/153596?v=3","gravatar_id":"","url":"https://api.github.com/users/StefanKarpinski","html_url":"https://github.com/StefanKarpinski","followers_url":"https://api.github.com/users/StefanKarpinski/followers","following_url":"https://api.github.com/users/StefanKarpinski/following{/other_user}","gists_url":"https://api.github.com/users/StefanKarpinski/gists{/gist_id}","starred_url":"https://api.github.com/users/StefanKarpinski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StefanKarpinski/subscriptions","organizations_url":"https://api.github.com/users/StefanKarpinski/orgs","repos_url":"https://api.github.com/users/StefanKarpinski/repos","events_url":"https://api.github.com/users/StefanKarpinski/events{/privacy}","received_events_url":"https://api.github.com/users/StefanKarpinski/received_events","type":"User","site_admin":false},"open_issues":25,"closed_issues":68,"state":"open","created_at":"2012-03-15T04:57:43Z","updated_at":"2015-04-23T13:17:23Z","due_on":null,"closed_at":null},"comments":31,"created_at":"2014-11-01T15:51:50Z","updated_at":"2015-04-30T16:10:21Z","closed_at":null,"body":"This keeps coming up, and rather than direct people to the performance tips, I feel like we should really just try to fix the issue. One relatively non-disruptive approach might be to emit code that accesses globals with a fast path that assumes that they have the same type that they currently have and a slow path that handles arbitrary type. A harder fix would be the compile-time version of that: generate code that assumes that globals retain their current type and invalidate it if the type changes. One might want to let compilation happen a couple of times before giving up and generating pessimistic general code.\r\n\r\nRelated: #265, #524, #964"},"comment":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/comments/97859848","html_url":"https://github.com/JuliaLang/julia/issues/8870#issuecomment-97859848","issue_url":"https://api.github.com/repos/JuliaLang/julia/issues/8870","id":97859848,"user":{"login":"Sisyphuss","id":11466838,"avatar_url":"https://avatars.githubusercontent.com/u/11466838?v=3","gravatar_id":"","url":"https://api.github.com/users/Sisyphuss","html_url":"https://github.com/Sisyphuss","followers_url":"https://api.github.com/users/Sisyphuss/followers","following_url":"https://api.github.com/users/Sisyphuss/following{/other_user}","gists_url":"https://api.github.com/users/Sisyphuss/gists{/gist_id}","starred_url":"https://api.github.com/users/Sisyphuss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sisyphuss/subscriptions","organizations_url":"https://api.github.com/users/Sisyphuss/orgs","repos_url":"https://api.github.com/users/Sisyphuss/repos","events_url":"https://api.github.com/users/Sisyphuss/events{/privacy}","received_events_url":"https://api.github.com/users/Sisyphuss/received_events","type":"User","site_admin":false},"created_at":"2015-04-30T16:10:21Z","updated_at":"2015-04-30T16:10:21Z","body":"Thanks @simonster , your example is persuasive. It makes me have to change my remark to **avoiding loop involving unknown type (variables)** .\r\n\r\nAbout your second remark, em... writing Julia code has a risk!"}}