{"action":"opened","issue":{"url":"https://api.github.com/repos/pinterest/PINCache/issues/136","repository_url":"https://api.github.com/repos/pinterest/PINCache","labels_url":"https://api.github.com/repos/pinterest/PINCache/issues/136/labels{/name}","comments_url":"https://api.github.com/repos/pinterest/PINCache/issues/136/comments","events_url":"https://api.github.com/repos/pinterest/PINCache/issues/136/events","html_url":"https://github.com/pinterest/PINCache/issues/136","id":186035065,"number":136,"title":"+emptyTrash operation can be optimized by deleting directory as a whole (rather than enumerating files).","user":{"login":"appleguy","id":565251,"avatar_url":"https://avatars.githubusercontent.com/u/565251?v=3","gravatar_id":"","url":"https://api.github.com/users/appleguy","html_url":"https://github.com/appleguy","followers_url":"https://api.github.com/users/appleguy/followers","following_url":"https://api.github.com/users/appleguy/following{/other_user}","gists_url":"https://api.github.com/users/appleguy/gists{/gist_id}","starred_url":"https://api.github.com/users/appleguy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/appleguy/subscriptions","organizations_url":"https://api.github.com/users/appleguy/orgs","repos_url":"https://api.github.com/users/appleguy/repos","events_url":"https://api.github.com/users/appleguy/events{/privacy}","received_events_url":"https://api.github.com/users/appleguy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-10-28T22:21:47Z","updated_at":"2016-10-28T22:21:47Z","closed_at":null,"body":"I tried this locally and it's a great win - but a little bit of extra work is needed to make it safe.  We simply need to ensure another directory is created to replace it, before any other file is moved there.\r\n\r\nA great implementation would create the trash in a random place, and then when the trash is emptied, delete that place + have the sharedTrashURL's cached URL be cleared.  Then the next time sharedTrashURL is called, we would see there's no cached global URL, and create a new UUID-named trash folder.  This would eliminate any checks for whether the directory exists too.\r\n\r\nThis trace was taken on an iPod 5G, after suspending the app, measuring *only the app resume* operation - with no user interaction.\r\n\r\n<img width=\"847\" alt=\"screen shot 2016-10-28 at 3 21 06 pm\" src=\"https://cloud.githubusercontent.com/assets/565251/19824190/3c659242-9d22-11e6-9322-c7f46f9700c8.png\">\r\n"}}
{"actor":{"display_login":"appleguy"}}