{"action":"opened","issue":{"url":"https://api.github.com/repos/less/less.js/issues/2640","labels_url":"https://api.github.com/repos/less/less.js/issues/2640/labels{/name}","comments_url":"https://api.github.com/repos/less/less.js/issues/2640/comments","events_url":"https://api.github.com/repos/less/less.js/issues/2640/events","html_url":"https://github.com/less/less.js/issues/2640","id":95650976,"number":2640,"title":"cache the parsing of an import if it was already seem before ","user":{"login":"royriojas","id":131290,"avatar_url":"https://avatars.githubusercontent.com/u/131290?v=3","gravatar_id":"","url":"https://api.github.com/users/royriojas","html_url":"https://github.com/royriojas","followers_url":"https://api.github.com/users/royriojas/followers","following_url":"https://api.github.com/users/royriojas/following{/other_user}","gists_url":"https://api.github.com/users/royriojas/gists{/gist_id}","starred_url":"https://api.github.com/users/royriojas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/royriojas/subscriptions","organizations_url":"https://api.github.com/users/royriojas/orgs","repos_url":"https://api.github.com/users/royriojas/repos","events_url":"https://api.github.com/users/royriojas/events{/privacy}","received_events_url":"https://api.github.com/users/royriojas/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-07-17T12:52:45Z","updated_at":"2015-07-17T12:52:45Z","closed_at":null,"body":"Hi guys, \r\n\r\nI just notice the build for a somehow complex less file was taking **about 4s**. I did some debug and found that the imports are parsed several times. Even when it was already previously parsed.\r\n\r\nI have made a simple change to the import-manager as a proof of concept\r\n\r\nhttps://github.com/royriojas/less.js/commit/b84e7c6a51f3f6221eb31ac3e1639caaa7c1c57f\r\n\r\nwith that small change the build time was reduced to **1.5s**, I guess because in my use case some files: (constants, mixins and others) were included several times from different files\r\n\r\nThe change I did is very naive, and we can make sure we create a cache for each instance of the less object created. \r\n\r\nAlso, if we keep a file cache of files that were already parsed, this will a build be reduced to just milliseconds. Are there any plans of enabling something like that. Would be really nice to have.\r\n"}}