Git Product home page Git Product logo

tn2_core's Introduction

TouchNet 2.X - Core

Copyright (c) 2013 Daniel Bugl, TouchLay. All rights reserved.

TouchNet 2 is a networking framework written in C/C++ which implements modules coded in interpreted languages. The modules can be dynamically loaded and managed.

INFO: Use the 1.0 branch for now: https://github.com/TouchLay/tn2_core/tree/1.0 - threads in 1.1 are still a bit unstable.

This is the core for the TouchNet. An API can be added in src/api.cpp. The API handles the requests and gives the results.

The master branch contains the latest stable version of the TouchNet 2.X Core including the specific TN2 API.

The core branch is like the core of the core, also the latest stable version, and excludes the specific TN2 API.

This is the experimental branch for tn2_core. The threads branch has been deleted because I started working on threads instead of subprocesses again in testing.

This was an experiment to implement limits for fork()

Version 1.0 release of tn2_core.

1.1 uses threads instead of forks, which makes the core much lighter. fork() is very resource heavy and slower than threads. 1.1 is about twice as fast (on a local server, without latency) because it uses threads instead of forks. TN is also slower on 1.0, because 1.0 was designed for HTTP and later, TN was added. In 1.1, the RequestHandler and Socket classes were completely rewritten to have more performance for both protocols. The send speed is about the same on both versions, because the same benchmark was used. The receive speed includes the receiving on the server, the reading from the socket, the parsing of the json request, the handling of the request by the API and finally, the receiving time from the server to the client. For all that, it is a quite short time. On the remote server, the huge delay comes from the distance between me and the server, of course. Especially over distance, the TN protocol wins, because it uses far less data. The difference between 1.1 and 1.0 is not so big over large distances, but 1.0 also uses a lot more cpu power (since it uses forks instead of threads). Here are the results of the benchmarks:

ย  v1.0 (Local) v1.0 (Remote) v1.1 (Local) v1.1 (Remote)
HTTP (TX) 0.175ms 0.185ms 0.180ms 0.182ms
TN (TX) 0.069ms 0.065ms 0.052ms 0.062ms
HTTP (RX) 0.984ms 23.243ms 0.591ms 21.153ms
TN (RX) 0.949ms 14.579ms 0.302ms 13.390ms
Total 2.177ms 38.072ms 1.125ms 34.787ms

The tn2_core (TouchNet 2.X Core) source is licensed under BSD 4-clause license. For further information please consult the LICENSE file.

tn2_core's People

Contributors

omnidan avatar

Stargazers

 avatar

Watchers

 avatar Georg Schelkshorn avatar James Cloos avatar  avatar

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.