{"action":"created","issue":{"url":"https://api.github.com/repos/chinghanho/tourist/issues/2","repository_url":"https://api.github.com/repos/chinghanho/tourist","labels_url":"https://api.github.com/repos/chinghanho/tourist/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/chinghanho/tourist/issues/2/comments","events_url":"https://api.github.com/repos/chinghanho/tourist/issues/2/events","html_url":"https://github.com/chinghanho/tourist/issues/2","id":200556512,"number":2,"title":"上傳處理縮圖到顯示縮圖的效能","user":{"login":"chinghanho","id":1897143,"avatar_url":"https://avatars.githubusercontent.com/u/1897143?v=3","gravatar_id":"","url":"https://api.github.com/users/chinghanho","html_url":"https://github.com/chinghanho","followers_url":"https://api.github.com/users/chinghanho/followers","following_url":"https://api.github.com/users/chinghanho/following{/other_user}","gists_url":"https://api.github.com/users/chinghanho/gists{/gist_id}","starred_url":"https://api.github.com/users/chinghanho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chinghanho/subscriptions","organizations_url":"https://api.github.com/users/chinghanho/orgs","repos_url":"https://api.github.com/users/chinghanho/repos","events_url":"https://api.github.com/users/chinghanho/events{/privacy}","received_events_url":"https://api.github.com/users/chinghanho/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-01-13T06:23:02Z","updated_at":"2017-01-17T10:59:27Z","closed_at":null,"body":"**製造縮圖到顯示需要多消耗 50% 時間。**\r\n\r\n測試情境：\r\n\r\n製造縮圖：上傳 15 張 1,500 百像素的照片，從開始進行 add 跑迴圈開始，到完成 async control flow 需要費時 9 秒。\r\n不需要製造縮圖：只需要 4.5 秒。\r\n\r\n參考案例 Dropzone.js：\r\n\r\nhttp://www.dropzonejs.com/\r\n\r\n他的 demo 拖照片進去系統 CPU 使用量不高，縮圖產生時間也比較短。"},"comment":{"url":"https://api.github.com/repos/chinghanho/tourist/issues/comments/273107958","html_url":"https://github.com/chinghanho/tourist/issues/2#issuecomment-273107958","issue_url":"https://api.github.com/repos/chinghanho/tourist/issues/2","id":273107958,"user":{"login":"chinghanho","id":1897143,"avatar_url":"https://avatars.githubusercontent.com/u/1897143?v=3","gravatar_id":"","url":"https://api.github.com/users/chinghanho","html_url":"https://github.com/chinghanho","followers_url":"https://api.github.com/users/chinghanho/followers","following_url":"https://api.github.com/users/chinghanho/following{/other_user}","gists_url":"https://api.github.com/users/chinghanho/gists{/gist_id}","starred_url":"https://api.github.com/users/chinghanho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chinghanho/subscriptions","organizations_url":"https://api.github.com/users/chinghanho/orgs","repos_url":"https://api.github.com/users/chinghanho/repos","events_url":"https://api.github.com/users/chinghanho/events{/privacy}","received_events_url":"https://api.github.com/users/chinghanho/received_events","type":"User","site_admin":false},"created_at":"2017-01-17T10:59:27Z","updated_at":"2017-01-17T10:59:27Z","body":"在 91b86640c87e5bc590a791ec5409fcc90b431821 把 FileReader 改成用 Blob 的方式顯示，顯示的速度提高 33%，一樣的樣本資料，費時 3.1 秒。\r\n\r\n不過這樣的後遺症是：\r\n\r\n* 製造縮圖的時間反而增加到 6.6 秒（？）\r\n* 如果拖進來的東西是目錄會掛（是說原本用 FileReader 時也還沒加上目錄的處理就是……）\r\n\r\n====\r\n\r\n附上 Blob 物件跟 FileReader 物件的說明：\r\n\r\n> A Blob object represents a file-like object of immutable, raw data. Blobs represent data that isn't necessarily in a JavaScript-native format. The File interface is based on Blob, inheriting blob functionality and expanding it to support files on the user's system.\r\n>\r\n> The FileReader object lets web applications asynchronously read the contents of files (or raw data buffers) stored on the user's computer, using File or Blob objects to specify the file or data to read.\r\n\r\n====\r\n\r\n可以研究一下 [Web Workers](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Using_web_workers) 的用法。"}}
{"actor":{"display_login":"chinghanho"}}