{"action":"created","issue":{"url":"https://api.github.com/repos/RFO-BASIC/Basic/issues/198","labels_url":"https://api.github.com/repos/RFO-BASIC/Basic/issues/198/labels{/name}","comments_url":"https://api.github.com/repos/RFO-BASIC/Basic/issues/198/comments","events_url":"https://api.github.com/repos/RFO-BASIC/Basic/issues/198/events","html_url":"https://github.com/RFO-BASIC/Basic/issues/198","id":115248161,"number":198,"title":"Accelerate variables lookup","user":{"login":"mougino","id":2697547,"avatar_url":"https://avatars.githubusercontent.com/u/2697547?v=3","gravatar_id":"","url":"https://api.github.com/users/mougino","html_url":"https://github.com/mougino","followers_url":"https://api.github.com/users/mougino/followers","following_url":"https://api.github.com/users/mougino/following{/other_user}","gists_url":"https://api.github.com/users/mougino/gists{/gist_id}","starred_url":"https://api.github.com/users/mougino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mougino/subscriptions","organizations_url":"https://api.github.com/users/mougino/orgs","repos_url":"https://api.github.com/users/mougino/repos","events_url":"https://api.github.com/users/mougino/events{/privacy}","received_events_url":"https://api.github.com/users/mougino/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/RFO-BASIC/Basic/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":50,"created_at":"2015-11-05T09:57:42Z","updated_at":"2015-11-29T16:16:26Z","closed_at":null,"body":"While discussing globals [on the forum] (http://rfobasic.freeforums.org/global-variables-was-multiple-values-for-bundle-get-t3760.html) user Gikam asked for [binary search on variables] (http://rfobasic.freeforums.org/post24358.html#p24358) instead of current linear search.\r\n\r\nMarc, you already investigated keywords lookup, but not variable lookups, and according to you back in 2012, variable lookup is the 1st most consuming task of the parser.\r\n\r\nI investigated [here] (http://rfobasic.freeforums.org/post24370.html#p24370) and just built a BASIC! test version perfecting this trail. I wrote a benchmark reading randomly 500 out of 702 different variables: with BASIC! v01.88 it takes an average of 250ms. On my modified BASIC! (based on V01.88) it takes an average of 52ms (gain of 80%).\r\n\r\nChanges only take place in 2 functions: `Run.searchVar(String)` and `Run.createNewVar(String, int)` as indicated [here] (http://rfobasic.freeforums.org/post24370.html#p24370)"},"comment":{"url":"https://api.github.com/repos/RFO-BASIC/Basic/issues/comments/160428892","html_url":"https://github.com/RFO-BASIC/Basic/issues/198#issuecomment-160428892","issue_url":"https://api.github.com/repos/RFO-BASIC/Basic/issues/198","id":160428892,"user":{"login":"jMarcS","id":2694082,"avatar_url":"https://avatars.githubusercontent.com/u/2694082?v=3","gravatar_id":"","url":"https://api.github.com/users/jMarcS","html_url":"https://github.com/jMarcS","followers_url":"https://api.github.com/users/jMarcS/followers","following_url":"https://api.github.com/users/jMarcS/following{/other_user}","gists_url":"https://api.github.com/users/jMarcS/gists{/gist_id}","starred_url":"https://api.github.com/users/jMarcS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jMarcS/subscriptions","organizations_url":"https://api.github.com/users/jMarcS/orgs","repos_url":"https://api.github.com/users/jMarcS/repos","events_url":"https://api.github.com/users/jMarcS/events{/privacy}","received_events_url":"https://api.github.com/users/jMarcS/received_events","type":"User","site_admin":false},"created_at":"2015-11-29T16:16:26Z","updated_at":"2015-11-29T16:16:26Z","body":"Thanks for posting your test results. (And for telling me how to do tables!) The results look pretty consistent.\r\n\r\nThere must be some misinformation floating around out there. I went to the authoritative source, `developer.android.com/reference`, and it looks like we're okay. This is a Good Thing; I didn't test on a Froyo emulator before committing.\r\n\r\nThere are nine flavors of `BinarySearch` in the `Arrays` class. Each of those has two variants. The full-list variants have been around since API 1. The sublist variants showed up in API 9. From the [Arrays page](http://developer.android.com/reference/java/util/Arrays.html):\r\n\r\n    public static int binarySearch (double[] array, double value)                                      Added in API level 1\r\n    public static int binarySearch (double[] array, int startIndex, int endIndex, double value)        Added in API level 9\r\n\r\nIn the `Collections` class, there are only two signatures, and they've both been there since the beginning. From the [Collections page](http://developer.android.com/reference/java/util/Collections.html):\r\n\r\n    public static int binarySearch (List<? extends Comparable<? super T>> list, T object)                   Added in API level 1\r\n    public static int binarySearch (List<? extends T> list, T object, Comparator<? super T> comparator)     Added in API level 1\r\n"}}