C++ modules with nodejs in heroku

Some time ago I learned to handle the V8 and compile small modules through node-gyp. Going up files with heroku I see each time that node is compiled with his dependences. I wonder if there is any way to compile c++ to nodejs on heroku. Some mechanism, some command?

It would be interesting for increase performance, especially for functions that handle "native" types instead of V8 objects (as simple strings or numbers, before finally converting to V8::Number and V8::String), which is architecturally complex and reduce yield.

Thanks.

Ok, the mechanism was evident

  1. Create in root directory a binding.gyp with data of the build.

  2. Place C++ scripts in root directory.

  3. Modify actual package.json and add in structure two commands to execute during install period (on each push):

    "scripts": { "install": "node-gyp configure; node-gyp build " }

  4. git add file1.cpp, file2.cpp, binding.gyp, etc. Commit and push.

  5. [Optional] Add flags to binding.gyp to silence warnings.

  6. C++ module should start to compile with additional packages.