GithubHelp home page GithubHelp logo

Comments (9)

mhorowitz avatar mhorowitz commented on April 24, 2024 6

Hi, thanks for asking! tl;dr is no. Let me elaborate.

Hermes optimizes for its primary metrics of startup time, size, and memory utilization. These aren't specific to React Native, but they were informed by it. In a long-running server environment, key metrics are different. Startup time an app size are only of minor importance. Servers are not nearly as memory constrained as mobile phones.

Hermes makes different trade-offs than other VMs in order to optimize for its core metrics. In particular, Hermes has no JIT (just in timer compiler), because JITs are mainly useful for improving the performance of longer running, CPU intensive programs. A JIT also consumes more memory than an interpreter. In a server environment, where you're trying to optimize for CPU and QPS over a longer time period, a JIT is likely to help improve your metrics.

Given all this, we don't believe Hermes is likely to be competitive as an engine for node, and so we don't have any plans to propose anything like this.

from hermes.

AMorgaut avatar AMorgaut commented on April 24, 2024 6

Hermes optimizes for its primary metrics of startup time, size, and memory utilization. These aren't specific to React Native, but they were informed by it. In a long-running server environment, key metrics are different. Startup time an app size are only of minor importance. Servers are not nearly as memory constrained as mobile phones.

Thanks, this helps to clarify the main target metrics of Hermes.

Just take into account that Node.js is not server-specific

It is even I guess more widely and heavily used for tools like ESLint, Babel, Webpack, Packer, and so much more, than for server-side application (for which competition with PHP, Java, .NET, python, ruby, ... makes it still a little player)

(mainly CLI but not only)

I'm not sure how much time has the JIT to optimize the code during such quick and intensive JS executions. We are not in a context where the engine has a lot of free time between user interactions.

It is also used to build:

  • standalone / client apps, like with NW.js or Electron.
  • embedded apps, in other devices than mobiles, like with Espruino or low.js

from hermes.

tmikov avatar tmikov commented on April 24, 2024 4

It would be a pretty cool project for the community to implement. A similar approach to node-chakracore would probably work well. We (the Hermes team) would be happy to answer questions, review PRs, etc, but as @mhorowitz said, there are no plans to take it on as a project ourselves.

from hermes.

jamonholmgren avatar jamonholmgren commented on April 24, 2024 3

It's SO TEMPTING to tackle this.

from hermes.

jamonholmgren avatar jamonholmgren commented on April 24, 2024 2

Would be interesting for running CLIs, since they have the same startup speed requirements as React Native.

Especially if we could distribute a binary with Static Hermes.

from hermes.

tmikov avatar tmikov commented on April 24, 2024 2

Yes, it would be a lot of fun. But someone needs to implement it. It is a significant chunk of work that doesn't require much knowledge of Hermes internals, but requires a lot of expertise in Node APIs, filesystem APIs, module resolution, etc.

I should note that Static Hermes would make writing something like this significantly easier, because almost all of it would be in JS.

from hermes.

mhorowitz avatar mhorowitz commented on April 24, 2024 1

Running React Native code requires the native RN infrastructure, and I'm not aware of anybody having made this work in a Node environment. That is already a barrier to running CI for React Native code in node, so I think nobody is doing it today.

If someone in the community has a need for this, there's no reason they shouldn't be able to build it. I don't think it should require changes to Hermes, but we would consider PRs to Hermes if it was useful. It's just not something we plan to do.

from hermes.

urbien avatar urbien commented on April 24, 2024 1

Hermes optimizes for its primary metrics of startup time, size, and memory utilization. These aren't specific to React Native, but they were informed by it. In a long-running server environment, key metrics are different. Startup time an app size are only of minor importance. Servers are not nearly as memory constrained as mobile phones.

@mhorowitz AWS Lambda (serverless), and similar on Azure and Google Cloud has the same optimization needs as React Native. It is a short lived process that needs very low memory footprint. Amazon even created a special VM manager, FireCracker, to quickly create a destroy the whole environment, optimized for lowest possible CPU and memory usage, as every extra megabyte used, and extra 100ms is the money lost in capacity utilization of such cloud applications.

from hermes.

ljharb avatar ljharb commented on April 24, 2024

However, it would still be useful for people who want to run CI in node using hermes without needing an android simulator or device.

from hermes.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.