{"action":"created","issue":{"url":"https://api.github.com/repos/NodeOS/NodeOS/issues/170","labels_url":"https://api.github.com/repos/NodeOS/NodeOS/issues/170/labels{/name}","comments_url":"https://api.github.com/repos/NodeOS/NodeOS/issues/170/comments","events_url":"https://api.github.com/repos/NodeOS/NodeOS/issues/170/events","html_url":"https://github.com/NodeOS/NodeOS/issues/170","id":107073640,"number":170,"title":"forking v8 as an optimization","user":{"login":"heavyk","id":1226324,"avatar_url":"https://avatars.githubusercontent.com/u/1226324?v=3","gravatar_id":"","url":"https://api.github.com/users/heavyk","html_url":"https://github.com/heavyk","followers_url":"https://api.github.com/users/heavyk/followers","following_url":"https://api.github.com/users/heavyk/following{/other_user}","gists_url":"https://api.github.com/users/heavyk/gists{/gist_id}","starred_url":"https://api.github.com/users/heavyk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/heavyk/subscriptions","organizations_url":"https://api.github.com/users/heavyk/orgs","repos_url":"https://api.github.com/users/heavyk/repos","events_url":"https://api.github.com/users/heavyk/events{/privacy}","received_events_url":"https://api.github.com/users/heavyk/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":15,"created_at":"2015-09-17T21:02:12Z","updated_at":"2015-10-10T16:19:42Z","closed_at":null,"body":"continuing discussion started in https://github.com/nodejs/node/pull/2133#issuecomment-141215057\r\n\r\n---\r\n\r\nit looks like you can fork v8 even after the context has been created. however, if what you're wanting to accomplish is save memory, you will probably need to have that memory outside of v8's gc'd memory for the OS not to copy and reallocate that memory when garbage is collected in in the forked process.\r\n\r\nalso, a potential optimization for NodeOS (still haven't tried it yet so I don't really know) may be to prepare a template process with your desired base v8 context in it (because creating a context is expensive) and just fork that template process for each process spawn and then that base context, the first thing it would do, is ask the OS which script to run and where to find it.. (kinda like a process boot loader)\r\n\r\nI don't know enough about these subjects to say anything concrete, though, I do know that if NodeOS is working, some smart chap will figure out how to optimize it. NodeOS does look interesting...\r\n\r\ncheers"},"comment":{"url":"https://api.github.com/repos/NodeOS/NodeOS/issues/comments/147103574","html_url":"https://github.com/NodeOS/NodeOS/issues/170#issuecomment-147103574","issue_url":"https://api.github.com/repos/NodeOS/NodeOS/issues/170","id":147103574,"user":{"login":"piranna","id":532414,"avatar_url":"https://avatars.githubusercontent.com/u/532414?v=3","gravatar_id":"","url":"https://api.github.com/users/piranna","html_url":"https://github.com/piranna","followers_url":"https://api.github.com/users/piranna/followers","following_url":"https://api.github.com/users/piranna/following{/other_user}","gists_url":"https://api.github.com/users/piranna/gists{/gist_id}","starred_url":"https://api.github.com/users/piranna/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/piranna/subscriptions","organizations_url":"https://api.github.com/users/piranna/orgs","repos_url":"https://api.github.com/users/piranna/repos","events_url":"https://api.github.com/users/piranna/events{/privacy}","received_events_url":"https://api.github.com/users/piranna/received_events","type":"User","site_admin":false},"created_at":"2015-10-10T16:19:42Z","updated_at":"2015-10-10T16:19:42Z","body":"On Node.js they are thinking about [to include a list with the build-ins currently included in the binary(https://github.com/nodejs/node/issues/3307), and also there are modules that [show that list](https://github.com/sindresorhus/builtin-modules/blob/master/builtin-modules.json). I think this can be a good guide to start moving out all the build-in modules to an external `node_modules` folder :-)"}}