elnardu / react-use-c

Use C in your React!
547 stars 16 forks source link

Consider caching binaries #3

Open memegento-dev opened 10 months ago

memegento-dev commented 10 months ago

Currently the binary is compiled for each request that is not efficient way to use compiled language as C. To bring true performance of C into React component the binaries can be compiled only once and the used directly. This will reduce the overhead of compilation time and filesystem usage.

Inspired by your project we used similar approach for PHP: https://github.com/memegento/react-use-php

As PHP is interpreted language, we pass the source code directly to interpreter.

sanskaromar commented 10 months ago

That is a great idea. I can work on this.

For starters, should we go with a simple LRU cache library to cache code and outputs, and When the cache size exceeds the maximum, remove the least recently used item. We can also set ttl with cache I think. Or are we looking for more persistent storage kind of things like redis etc😮?

elnardu commented 10 months ago

just use sccache or something