{"action":"created","issue":{"url":"https://api.github.com/repos/mafagafogigante/dungeon/issues/176","labels_url":"https://api.github.com/repos/mafagafogigante/dungeon/issues/176/labels{/name}","comments_url":"https://api.github.com/repos/mafagafogigante/dungeon/issues/176/comments","events_url":"https://api.github.com/repos/mafagafogigante/dungeon/issues/176/events","html_url":"https://github.com/mafagafogigante/dungeon/issues/176","id":116444132,"number":176,"title":"World map writing performance.","user":{"login":"mafagafogigante","id":8271090,"avatar_url":"https://avatars.githubusercontent.com/u/8271090?v=3","gravatar_id":"","url":"https://api.github.com/users/mafagafogigante","html_url":"https://github.com/mafagafogigante","followers_url":"https://api.github.com/users/mafagafogigante/followers","following_url":"https://api.github.com/users/mafagafogigante/following{/other_user}","gists_url":"https://api.github.com/users/mafagafogigante/gists{/gist_id}","starred_url":"https://api.github.com/users/mafagafogigante/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mafagafogigante/subscriptions","organizations_url":"https://api.github.com/users/mafagafogigante/orgs","repos_url":"https://api.github.com/users/mafagafogigante/repos","events_url":"https://api.github.com/users/mafagafogigante/events{/privacy}","received_events_url":"https://api.github.com/users/mafagafogigante/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/mafagafogigante/dungeon/labels/enhancement","name":"enhancement","color":"c7def8"},{"url":"https://api.github.com/repos/mafagafogigante/dungeon/labels/UX","name":"UX","color":"bfdadc"}],"state":"open","locked":false,"assignee":{"login":"mafagafogigante","id":8271090,"avatar_url":"https://avatars.githubusercontent.com/u/8271090?v=3","gravatar_id":"","url":"https://api.github.com/users/mafagafogigante","html_url":"https://github.com/mafagafogigante","followers_url":"https://api.github.com/users/mafagafogigante/followers","following_url":"https://api.github.com/users/mafagafogigante/following{/other_user}","gists_url":"https://api.github.com/users/mafagafogigante/gists{/gist_id}","starred_url":"https://api.github.com/users/mafagafogigante/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mafagafogigante/subscriptions","organizations_url":"https://api.github.com/users/mafagafogigante/orgs","repos_url":"https://api.github.com/users/mafagafogigante/repos","events_url":"https://api.github.com/users/mafagafogigante/events{/privacy}","received_events_url":"https://api.github.com/users/mafagafogigante/received_events","type":"User","site_admin":false},"milestone":null,"comments":1,"created_at":"2015-11-11T23:28:15Z","updated_at":"2015-11-11T23:44:52Z","closed_at":null,"body":"I've had some really poor performance with some dense maps being written."},"comment":{"url":"https://api.github.com/repos/mafagafogigante/dungeon/issues/comments/155946228","html_url":"https://github.com/mafagafogigante/dungeon/issues/176#issuecomment-155946228","issue_url":"https://api.github.com/repos/mafagafogigante/dungeon/issues/176","id":155946228,"user":{"login":"mafagafogigante","id":8271090,"avatar_url":"https://avatars.githubusercontent.com/u/8271090?v=3","gravatar_id":"","url":"https://api.github.com/users/mafagafogigante","html_url":"https://github.com/mafagafogigante","followers_url":"https://api.github.com/users/mafagafogigante/followers","following_url":"https://api.github.com/users/mafagafogigante/following{/other_user}","gists_url":"https://api.github.com/users/mafagafogigante/gists{/gist_id}","starred_url":"https://api.github.com/users/mafagafogigante/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mafagafogigante/subscriptions","organizations_url":"https://api.github.com/users/mafagafogigante/orgs","repos_url":"https://api.github.com/users/mafagafogigante/repos","events_url":"https://api.github.com/users/mafagafogigante/events{/privacy}","received_events_url":"https://api.github.com/users/mafagafogigante/received_events","type":"User","site_admin":false},"created_at":"2015-11-11T23:44:52Z","updated_at":"2015-11-11T23:44:52Z","body":"http://javatechniques.com/blog/faster-jtextpane-text-insertion-part-i/ has some fantastic insights into this issue.\r\n\r\nBasically, there are two causes for slow JTextPane updates: each insertion triggers a re-rendering of the display and some methods in the DefaultDocumentStyle class are synchronized, so there is the overhead of acquiring locks.\r\n\r\nI will work around the first issue and see if it is enough, it should be.\r\n\r\nThe current idea is to keep two identical StyledDocuments. One is set to the text pane while the other awaits for an update. When we need to write something new, we first update the one that is resting. Then set it to the pane, then update the other one.\r\n\r\nNote to self: remember to check that clearTextPane() clears both documents. Also check that everything that currently changes these documents will work with the new structure.\r\n\r\nMaybe even write a class that handles these update mechanism for the window. The GameWindow class already does too much. That class would encapsulate implementation details and provide a write method. It would then perform the write-swap-write idea behind the scenes."}}