Giter VIP home page Giter VIP logo

Comments (2)

neocturne avatar neocturne commented on July 16, 2024

I think we should generally avoid using Lua in daemons, as a garbage-collected scripting language will always use more RAM than C.

Having a DSL in C might be a good idea though - and we could even try to avoid using json-c and thus keeping JSON objects in RAM at all and directly write JSON out as we generate it.

from packages.

lemoer avatar lemoer commented on July 16, 2024

I think we should generally avoid using Lua in daemons, as a garbage-collected scripting language will always use more RAM than C.

The main idea was to improve the flexibility of this daemon. Often it is very useful that one can modify (or add) a provider by simply modifying files on the router while is online. If you need C skills and a build ready LEDE/gluon development environment, you will often leave out monitoring because it's to complicated to write new modules. Decreasing the memory footprint is a minor aspect of this thread, but would be also nice.

I do not have a lot experience in garbage collection, but can't we reach a negligible difference if the lua functions are short and do not use external lua libs?

Having a DSL in C might be a good idea though

The concept to use lua was caused by the idea to add some easy to write postprocessing functionality for the different data sources. I think the postprocessing is useful because we want to do complex stuff like parsing output of ubus calls or batman neigh tables. How would you solve this postprocessing in the DSL? Or should we drop support for postprocessing of the data sources?

and we could even try to avoid using json-c and thus keeping JSON objects in RAM at all and directly write JSON out as we generate it.

I'm not sure whether I got it. Did I understand it correctly, that you want to generate the json on demand while serving the requests? I'm not really sure if we can decrease the memory footprint with this change, since caching would be still necessary. Saving the whole response body as a string would consume more memory than before.

from packages.

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.