{"action":"created","issue":{"url":"https://api.github.com/repos/yegor256/takes/issues/597","repository_url":"https://api.github.com/repos/yegor256/takes","labels_url":"https://api.github.com/repos/yegor256/takes/issues/597/labels{/name}","comments_url":"https://api.github.com/repos/yegor256/takes/issues/597/comments","events_url":"https://api.github.com/repos/yegor256/takes/issues/597/events","html_url":"https://github.com/yegor256/takes/issues/597","id":133009204,"number":597,"title":"Use String.split if the separator is only one character long","user":{"login":"essobedo","id":1618116,"avatar_url":"https://avatars.githubusercontent.com/u/1618116?v=3","gravatar_id":"","url":"https://api.github.com/users/essobedo","html_url":"https://github.com/essobedo","followers_url":"https://api.github.com/users/essobedo/followers","following_url":"https://api.github.com/users/essobedo/following{/other_user}","gists_url":"https://api.github.com/users/essobedo/gists{/gist_id}","starred_url":"https://api.github.com/users/essobedo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/essobedo/subscriptions","organizations_url":"https://api.github.com/users/essobedo/orgs","repos_url":"https://api.github.com/users/essobedo/repos","events_url":"https://api.github.com/users/essobedo/events{/privacy}","received_events_url":"https://api.github.com/users/essobedo/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/yegor256/takes/labels/30%20mins","name":"30 mins","color":"eb6421"},{"url":"https://api.github.com/repos/yegor256/takes/labels/@dalifreire","name":"@dalifreire","color":"009801"},{"url":"https://api.github.com/repos/yegor256/takes/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/yegor256/takes/labels/DEV","name":"DEV","color":"bfd4f3"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/yegor256/takes/milestones/1","html_url":"https://github.com/yegor256/takes/milestones/1.0","labels_url":"https://api.github.com/repos/yegor256/takes/milestones/1/labels","id":1069705,"number":1,"title":"1.0","description":"first fully working version","creator":{"login":"yegor256","id":526301,"avatar_url":"https://avatars.githubusercontent.com/u/526301?v=3","gravatar_id":"","url":"https://api.github.com/users/yegor256","html_url":"https://github.com/yegor256","followers_url":"https://api.github.com/users/yegor256/followers","following_url":"https://api.github.com/users/yegor256/following{/other_user}","gists_url":"https://api.github.com/users/yegor256/gists{/gist_id}","starred_url":"https://api.github.com/users/yegor256/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yegor256/subscriptions","organizations_url":"https://api.github.com/users/yegor256/orgs","repos_url":"https://api.github.com/users/yegor256/repos","events_url":"https://api.github.com/users/yegor256/events{/privacy}","received_events_url":"https://api.github.com/users/yegor256/received_events","type":"User","site_admin":false},"open_issues":38,"closed_issues":153,"state":"open","created_at":"2015-04-16T00:55:10Z","updated_at":"2016-02-17T15:03:08Z","due_on":"2015-05-14T07:00:00Z","closed_at":null},"comments":10,"created_at":"2016-02-11T15:47:50Z","updated_at":"2016-02-19T18:33:21Z","closed_at":null,"body":"Using _String.split_ if the separator is only one character long (normal character or a backslash followed by a special character) is very fast as it is not treated internally as a regular expression but if the separator is a real regular expression it will internally compile the regular expression at each call which has a significant cost in term of performances.  In that case we are supposed to use a field _private static final_ of type Pattern which is possible because a Pattern is Immutable/thread safe and use this field to call _split(input)_ instead of doing _input.split(regexp)_.\r\n\r\nSo for example in my laptop calling 1 M times _split(\"\\\\s\")_ takes **more than 20 seconds** and doing the same thing with a pre-created Pattern object takes **9.4 seconds** which represents a performance **improvement of more than 50 %**. "},"comment":{"url":"https://api.github.com/repos/yegor256/takes/issues/comments/186353447","html_url":"https://github.com/yegor256/takes/issues/597#issuecomment-186353447","issue_url":"https://api.github.com/repos/yegor256/takes/issues/597","id":186353447,"user":{"login":"dalifreire","id":10319140,"avatar_url":"https://avatars.githubusercontent.com/u/10319140?v=3","gravatar_id":"","url":"https://api.github.com/users/dalifreire","html_url":"https://github.com/dalifreire","followers_url":"https://api.github.com/users/dalifreire/followers","following_url":"https://api.github.com/users/dalifreire/following{/other_user}","gists_url":"https://api.github.com/users/dalifreire/gists{/gist_id}","starred_url":"https://api.github.com/users/dalifreire/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dalifreire/subscriptions","organizations_url":"https://api.github.com/users/dalifreire/orgs","repos_url":"https://api.github.com/users/dalifreire/repos","events_url":"https://api.github.com/users/dalifreire/events{/privacy}","received_events_url":"https://api.github.com/users/dalifreire/received_events","type":"User","site_admin":false},"created_at":"2016-02-19T18:33:21Z","updated_at":"2016-02-19T18:33:21Z","body":"@essobedo Thanks! I'll verify the checkstyle rules."}}