Comments (2)
Starting work on this.
from mutgos_server.
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)
- dump file format should support importing Documents as separate files, to separate out scripts
- Need a database 'fsck' type support (or preventing corruption in the first place)
- Improve build process to use relative paths and have an install
- DESIGN: AngelScript API to support a basic chatroom with rooms and basic descriptions HOT 6
- Figure out how ActionEntity linking permissions work HOT 1
- AngelScript Scripts needed to support a basic chatroom with rooms and basic descriptions
- AngelScript interface: Improve error output when compiling (show line that has error) HOT 1
- AngelScript interface: Improve error output when 'crash' (show line that crashed). HOT 1
- AngelScript interface: Upgrade to latest version to correct potential bad crashes HOT 1
- Report AngelScript bugs (and praise) to developer HOT 5
- Determine if any static error detection tools should be used (linters, etc) during build HOT 1
- How to store external software dependencies? HOT 2
- Documentation for creating `server.pem` HOT 9
- Handle bad `server.pem` failure cleanly
- ssl support in dockerfile HOT 3
- Design Installation Logic HOT 3
- mutgos.conf should have comments sshd config style HOT 2
- Bad SSL handshake should close client connection HOT 1
- Convert .txt docs to .md HOT 1
- Plain (or SSL) Socket connections should allow full UTF8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mutgos_server.