{"action":"created","issue":{"url":"https://api.github.com/repos/NLog/NLog/issues/1092","labels_url":"https://api.github.com/repos/NLog/NLog/issues/1092/labels{/name}","comments_url":"https://api.github.com/repos/NLog/NLog/issues/1092/comments","events_url":"https://api.github.com/repos/NLog/NLog/issues/1092/events","html_url":"https://github.com/NLog/NLog/issues/1092","id":122393050,"number":1092,"title":"performance: Unused targets are still Initialized","user":{"login":"304NotModified","id":5808377,"avatar_url":"https://avatars.githubusercontent.com/u/5808377?v=3","gravatar_id":"","url":"https://api.github.com/users/304NotModified","html_url":"https://github.com/304NotModified","followers_url":"https://api.github.com/users/304NotModified/followers","following_url":"https://api.github.com/users/304NotModified/following{/other_user}","gists_url":"https://api.github.com/users/304NotModified/gists{/gist_id}","starred_url":"https://api.github.com/users/304NotModified/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/304NotModified/subscriptions","organizations_url":"https://api.github.com/users/304NotModified/orgs","repos_url":"https://api.github.com/users/304NotModified/repos","events_url":"https://api.github.com/users/304NotModified/events{/privacy}","received_events_url":"https://api.github.com/users/304NotModified/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/NLog/NLog/labels/nlog-configuration","name":"nlog-configuration","color":"ffffff"},{"url":"https://api.github.com/repos/NLog/NLog/labels/performance","name":"performance","color":"5319e7"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-12-15T23:33:01Z","updated_at":"2016-01-13T23:47:39Z","closed_at":null,"body":"Unused targets are still Initialized. This is waste of performance, especially the asyncwrapper (timer will be started).\r\n\r\nWith the following config, all 4 targets are initialized. (`InitializeTarget`)\r\n\r\n\r\n\r\nExample:\r\n```xml\r\n    <targets>\r\n           \r\n      <target name=\"asyncWrapper\" xsi:type=\"AsyncWrapper\" overflowAction=\"Block\" queueLimit=\"1000000\" batchSize=\"1000\" timeToSleepBetweenBatches=\"0\"   >\r\n        <target name =\"mipLoggertargetwrapped\" xsi:type=\"File\"\r\n            fileName=\"c:/temp/Log/test1.log\"\r\n            layout=\"${message}\" keepFileOpen=\"true\" AutoFlush=\"false\"\r\n            ConcurrentWrites=\"true\"\r\n            CleanupFileName=\"false\"/>\r\n      </target>\r\n      <target name=\"asyncWrapper2\" xsi:type=\"AsyncWrapper\" overflowAction=\"Block\" queueLimit=\"1000000\" batchSize=\"1000\" timeToSleepBetweenBatches=\"0\"   >\r\n        <target name =\"mipLoggertargetwrapped2\" xsi:type=\"File\"\r\n            fileName=\"c:/temp/Log/test1.log\"\r\n            layout=\"${message}\" keepFileOpen=\"true\" AutoFlush=\"false\"\r\n            ConcurrentWrites=\"false\"\r\n            CleanupFileName=\"false\"/>\r\n      </target>\r\n      <target name =\"mipLoggertarget\" xsi:type=\"File\"\r\n            fileName=\"c:/temp/Log/test1.log\"\r\n            layout=\"${message}\" keepFileOpen=\"true\" AutoFlush=\"false\"\r\n            ConcurrentWrites=\"true\"\r\n            CleanupFileName=\"false\"/>\r\n      <target name =\"mipLoggertarget2\" xsi:type=\"File\"\r\n              fileName=\"c:/temp/Log/test1.log\"\r\n              layout=\"${message}\" keepFileOpen=\"true\" AutoFlush=\"false\"\r\n              ConcurrentWrites=\"false\"\r\n              CleanupFileName=\"false\"/>\r\n\r\n    </targets>\r\n    <rules>\r\n      <logger name=\"mipLogger\" minlevel=\"Trace\" writeTo=\"mipLoggertarget2\"/>\r\n\r\n    </rules>\r\n``` \r\n\r\ncall stack of initialize asyncwrapper :\r\n\r\n![image](https://cloud.githubusercontent.com/assets/5808377/11827467/b3fead9c-a38c-11e5-9670-6450e8857a20.png)\r\n\r\n\r\n\r\n\r\nrelated: https://github.com/NLog/NLog/issues/1071"},"comment":{"url":"https://api.github.com/repos/NLog/NLog/issues/comments/171474167","html_url":"https://github.com/NLog/NLog/issues/1092#issuecomment-171474167","issue_url":"https://api.github.com/repos/NLog/NLog/issues/1092","id":171474167,"user":{"login":"304NotModified","id":5808377,"avatar_url":"https://avatars.githubusercontent.com/u/5808377?v=3","gravatar_id":"","url":"https://api.github.com/users/304NotModified","html_url":"https://github.com/304NotModified","followers_url":"https://api.github.com/users/304NotModified/followers","following_url":"https://api.github.com/users/304NotModified/following{/other_user}","gists_url":"https://api.github.com/users/304NotModified/gists{/gist_id}","starred_url":"https://api.github.com/users/304NotModified/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/304NotModified/subscriptions","organizations_url":"https://api.github.com/users/304NotModified/orgs","repos_url":"https://api.github.com/users/304NotModified/repos","events_url":"https://api.github.com/users/304NotModified/events{/privacy}","received_events_url":"https://api.github.com/users/304NotModified/received_events","type":"User","site_admin":false},"created_at":"2016-01-13T23:47:39Z","updated_at":"2016-01-13T23:47:39Z","body":"Well all of the are parsed. I was thinking to clean it up after the parse. "}}