Coder Social home page Coder Social logo

Comments (2)

zelerin avatar zelerin commented on August 24, 2024

Starting work on this.

from mutgos_server.

zelerin avatar zelerin commented on August 24, 2024

Reversing the order of relatively expensive security checks on actions themselves (do them after seeing if the action matches) plus allowing an already normalized (lowercase) string to be taken in for searching (rather than converting it to lowercase per action check) yielded a tiny bit of improvement - it takes less microseconds on an already microsecond level operation. I'm going to stop here with this sort of optimization mostly because we need a much more comprehensive database to better understand the bottlenecks. Anything done now is just conjecture.

Looking at log timestamps, the whole operation of finding an action, verifying security, and calling the 'launch angelscript process' method is actually very quick (microseconds). The AngelScript execution is also very fast. The slowness appears to be coming from the comm subsystem.

My original design called for it to be single threaded for simplicity, but to allow multiple comm interfaces (websocket, socket, and anything else someone implements) to be active at once, which basically meant polling each one in turn. During polling, it handles new connections, incoming data, and outgoing data. I had it set to poll every 1/4 second. Changing it to what I think is 1/10 of a second yielded a much more responsive system without taking up any noticeable CPU time when idle.

I have a feeling the polling design will need to be revisited one day, replaced by one thread per comm interface with a synchronized common area to interact with the rest of the system; this will make it extremely responsive. In reality, it would not be a big deal to switch it over, but I consider it lower priority at this time and prefer to work on functionality people would notice.

I'm going to leave this open for a bit longer in case I come up with a better idea, and if not, will check in what I have and close the issue.

from mutgos_server.

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.