{"action":"opened","issue":{"url":"https://api.github.com/repos/fgpv-vpgf/fgpv-vpgf/issues/498","repository_url":"https://api.github.com/repos/fgpv-vpgf/fgpv-vpgf","labels_url":"https://api.github.com/repos/fgpv-vpgf/fgpv-vpgf/issues/498/labels{/name}","comments_url":"https://api.github.com/repos/fgpv-vpgf/fgpv-vpgf/issues/498/comments","events_url":"https://api.github.com/repos/fgpv-vpgf/fgpv-vpgf/issues/498/events","html_url":"https://github.com/fgpv-vpgf/fgpv-vpgf/issues/498","id":148776817,"number":498,"title":"Efficiency of config load and language switch","user":{"login":"james-rae","id":7585245,"avatar_url":"https://avatars.githubusercontent.com/u/7585245?v=3","gravatar_id":"","url":"https://api.github.com/users/james-rae","html_url":"https://github.com/james-rae","followers_url":"https://api.github.com/users/james-rae/followers","following_url":"https://api.github.com/users/james-rae/following{/other_user}","gists_url":"https://api.github.com/users/james-rae/gists{/gist_id}","starred_url":"https://api.github.com/users/james-rae/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/james-rae/subscriptions","organizations_url":"https://api.github.com/users/james-rae/orgs","repos_url":"https://api.github.com/users/james-rae/repos","events_url":"https://api.github.com/users/james-rae/events{/privacy}","received_events_url":"https://api.github.com/users/james-rae/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/fgpv-vpgf/fgpv-vpgf/labels/feedback:%20discussion","name":"feedback: discussion","color":"d4c5f9"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-04-15T21:43:53Z","updated_at":"2016-04-15T21:43:53Z","closed_at":null,"body":"## Current Situation\r\n\r\nWhen the application loads, it generates a configuration file for each supported language. This includes pulling in RCS configuration snippets; RCS is called once per language.\r\n\r\nThe advantage is that having cached versions of configs allows for a quick and 'easy to code' language switch.\r\n\r\nThe disadvantage is it is a performance hit (magnitude has not been tested) at startup.\r\n\r\n## Proposal 1: RCS Returns All Languages\r\n\r\nHave RCS return all languages for keys in one bundle.  This removes the need for multiple calls, which is the heavy part of the transaction (the data itself is moderately sized json data).  \r\nRequires a change to RCS (guts and interface).  Also a change to the config loader in the app, but minimal.\r\n\r\nFuture enhancement: if large pieces of data start getting stored in the RCS (e.g. full blown legends), make that downloadable with a separate call and grab them as needed, not at startup.\r\n\r\n## Proposal 2: Only Load Config Information For Current Language\r\n\r\nNo longer load all language configs at startup.  Only the active language.  When a language switch occurs, download and process the new config info.\r\nFaster startup than Proposal 1, slower language switch.  \r\nRCS is not changed\r\nSignificant refactor to config load and language switch code in the viewer.\r\n\r\nFuture enhancement: cache configs after first load, optimizing the rare case where someone can't make up their mind about language and keeps switching it."}}