{"action":"created","issue":{"url":"https://api.github.com/repos/totocaster/metalsmith-tags/issues/17","labels_url":"https://api.github.com/repos/totocaster/metalsmith-tags/issues/17/labels{/name}","comments_url":"https://api.github.com/repos/totocaster/metalsmith-tags/issues/17/comments","events_url":"https://api.github.com/repos/totocaster/metalsmith-tags/issues/17/events","html_url":"https://github.com/totocaster/metalsmith-tags/issues/17","id":90264940,"number":17,"title":"metalsmith-tags is very slow when using metalsmith-watch","user":{"login":"deltamualpha","id":2105458,"avatar_url":"https://avatars.githubusercontent.com/u/2105458?v=3","gravatar_id":"","url":"https://api.github.com/users/deltamualpha","html_url":"https://github.com/deltamualpha","followers_url":"https://api.github.com/users/deltamualpha/followers","following_url":"https://api.github.com/users/deltamualpha/following{/other_user}","gists_url":"https://api.github.com/users/deltamualpha/gists{/gist_id}","starred_url":"https://api.github.com/users/deltamualpha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deltamualpha/subscriptions","organizations_url":"https://api.github.com/users/deltamualpha/orgs","repos_url":"https://api.github.com/users/deltamualpha/repos","events_url":"https://api.github.com/users/deltamualpha/events{/privacy}","received_events_url":"https://api.github.com/users/deltamualpha/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-06-23T02:04:48Z","updated_at":"2015-06-27T01:09:22Z","closed_at":null,"body":"I ran into major performance problems with metalsmith while using it for live development, and so I started using a little home-cooked timer to see which plugin was making a change to a single file take almost a minute and a half to rebuild. Lo and behold:\r\n\r\n```\r\n$ DEBUG=metalsmith-debug node watch\r\n[metalsmith-watch] ✓ Live reload server started on port: 35729\r\n  metalsmith-debug start timing +0ms\r\n  metalsmith-debug post-metadata +1ms\r\n  metalsmith-debug post-fileMetadata +3ms\r\n  metalsmith-debug post-copy +16ms\r\n  metalsmith-debug post-tags +10ms\r\n  metalsmith-debug post-collections +23ms\r\n  metalsmith-debug post-paginate +8s\r\n  metalsmith-debug post-lunr +1s\r\n  metalsmith-debug post-markdown +81ms\r\n  metalsmith-debug post-excerpts +129ms\r\n  metalsmith-debug post-permalinks +155ms\r\n  metalsmith-debug post-templates +428ms\r\n  metalsmith-debug post-assets +2ms\r\n  metalsmith-debug post-sass +595ms\r\n  metalsmith-debug post-prefixer +59ms\r\n[metalsmith-serve] serving build at http://localhost:8080\r\n[metalsmith-watch] ✔︎ Watching src/**/*\r\n[metalsmith-watch] ✔︎ Watching assets/styles/*\r\n[metalsmith-watch] ✔︎ Watching templates/**/*\r\n[metalsmith-watch] ✔︎ src/blog/posts/this-is-a-post.md changed\r\n[metalsmith-watch] - Updating 1 file...\r\n  metalsmith-debug start timing +26s\r\n  metalsmith-debug post-metadata +0ms\r\n  metalsmith-debug post-fileMetadata +0ms\r\n  metalsmith-debug post-copy +1ms\r\n  metalsmith-debug post-tags +59s\r\n  metalsmith-debug post-collections +0ms\r\n  metalsmith-debug post-paginate +0ms\r\n  metalsmith-debug post-lunr +3ms\r\n  metalsmith-debug post-markdown +36ms\r\n  metalsmith-debug post-excerpts +2ms\r\n  metalsmith-debug post-permalinks +1ms\r\n  metalsmith-debug post-templates +186ms\r\n  metalsmith-debug post-assets +1ms\r\n  metalsmith-debug post-sass +1ms\r\n  metalsmith-debug post-prefixer +1ms\r\n[metalsmith-watch] ✔︎ 12 files reloaded\r\n[metalsmith-watch] ✔︎ src/blog/posts/this-is-a-post.md changed\r\n[metalsmith-watch] - Updating 1 file...\r\n  metalsmith-debug start timing +6m\r\n  metalsmith-debug post-metadata +0ms\r\n  metalsmith-debug post-fileMetadata +0ms\r\n  metalsmith-debug post-copy +0ms\r\n  metalsmith-debug post-tags +14s\r\n  metalsmith-debug post-collections +1ms\r\n  metalsmith-debug post-paginate +0ms\r\n  metalsmith-debug post-lunr +2ms\r\n  metalsmith-debug post-markdown +11ms\r\n  metalsmith-debug post-excerpts +33ms\r\n  metalsmith-debug post-permalinks +1ms\r\n  metalsmith-debug post-templates +109ms\r\n  metalsmith-debug post-assets +1ms\r\n  metalsmith-debug post-sass +1ms\r\n  metalsmith-debug post-prefixer +0ms\r\n[metalsmith-watch] ✔︎ 12 files reloaded\r\n```\r\n\r\nmetalsmith-tags is nice and fast on first run, and then falls off a cliff on subsequent rebuilds using [metalsmith-watch](https://github.com/FWeinb/metalsmith-watch). (Subsequent runs leveled off at 14s, but that's still orders of magnitude slower than any other plugin in the list.) Any guesses what's going on here?"},"comment":{"url":"https://api.github.com/repos/totocaster/metalsmith-tags/issues/comments/115930748","html_url":"https://github.com/totocaster/metalsmith-tags/issues/17#issuecomment-115930748","issue_url":"https://api.github.com/repos/totocaster/metalsmith-tags/issues/17","id":115930748,"user":{"login":"hswolff","id":322576,"avatar_url":"https://avatars.githubusercontent.com/u/322576?v=3","gravatar_id":"","url":"https://api.github.com/users/hswolff","html_url":"https://github.com/hswolff","followers_url":"https://api.github.com/users/hswolff/followers","following_url":"https://api.github.com/users/hswolff/following{/other_user}","gists_url":"https://api.github.com/users/hswolff/gists{/gist_id}","starred_url":"https://api.github.com/users/hswolff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hswolff/subscriptions","organizations_url":"https://api.github.com/users/hswolff/orgs","repos_url":"https://api.github.com/users/hswolff/repos","events_url":"https://api.github.com/users/hswolff/events{/privacy}","received_events_url":"https://api.github.com/users/hswolff/received_events","type":"User","site_admin":false},"created_at":"2015-06-27T01:09:22Z","updated_at":"2015-06-27T01:09:22Z","body":"Haven't used `metalsmith-watch` so sadly can't help much there.\r\n\r\nIf you can narrow down exactly what function(s?) seem to take the bulk of the time we can work on optimizing, but at this macro view it's a little hard to know where to start.\r\n\r\nLet me know what investigations you uncover though, happy to help."}}