The introduction

The differences between T-IO and Netty, this is a question that gets asked a lot, and here, as the author of T-IO, are some of the differences

T-io’s biggest advantage

The API design is easy to understand and minimizes the cost of learning by avoiding introducing your own concepts

Taking over the binding and automatic unbinding of a large number of business resources, developers just need to mindlessly call the API to complete the binding and unbinding function, which is extremely complex and error-prone if left to business developers:

  • The collection management in multithreaded environment should be synchronized safe, and the synchronized design should be both safe and efficient

  • It is easy to forget to release resources and cause OOM, and it is easy to forget to lock or add deadlock and cause system to fake death

  • Why do other frameworks avoid implementing these features for various reasons?

    • Business hooks are hard to abstract
    • It will consume frame performance
    • Complex error-prone

With rich, easy-to-use apis built in, developers can do a lot of business in one way

Provides a production level showcase demonstration project

  • Experienced developers can use it in a production environment with minor modifications

  • Inexperienced developers can serve as demonstration code for getting started

Documentation is centralized on the official website, so users don’t have to go around learning useless and incorrect documents – further reducing learning costs and trial and error costs netty’s biggest advantage

Implementation of a large number of public protocols

A number of netty based high-level frameworks

Compared to other

Netty has a large number of public protocol implementation, T-IO official currently provide only HTTP and Websocket

Netty used zero copy, which t-IO abandoned after repeated balancing for the following reasons: Zero-copy is just a means (or algorithm) to improve performance. What matters to users is not the algorithm used by the framework, but whether the end result is achieved. Netty uses zero-copy to improve performance, and T-IO creates its own synchronous safe thread pool to improve performance. * * * *

  • Zero copy reduces the copying process and consumes other computer resources
  • The management of off-heap resources inevitably increases the complexity of T-IO code, making it difficult for T-IO users to navigate T-IO at the source level
  • The introduction of out-of-heap resource management in some of the same frameworks did improve performance in some scenarios, but the process also added serious bugs
  • T-io’s performance is good enough to put the effort into the service business, not the performance PK arena

T-io created its own synchronized thread pool, which makes it easy to schedule threads internally. Like Netty’s zero-copy, this is a means to improve performance and simplify programming, not an end in itself.

T-io has built-in business data management capability, which is a very important capability. Network programming data binding and release is a very testing feature for developers, even experienced developers are very prone to deadlocks and OOM, and can even cause the entire project to fail.

  • Example 1: If you do IM, do you want to do group and member mapping? In T-IO, you only need tio.bindGroup () to bind the TCP connection to the group
  • Example 2: Point-to-point messaging, do you want to send messages to user ids? In T-IO, you only need tio.binduser () to bind a TCP connection to a user
  • There is no need to worry about releasing the service resources bound by tio.bindxxx () after TCP connection disconnection. T-io has a strict algorithm to ensure that these resources can be released quickly and orderly (have to be warned: releasing resources involves multi-thread operation, easy to error)!

Netty has a large library of books to consult; T-io provides a just-in-time Showcase project (paying document users can download the latest version), and users do not need much time to complete the network programming scaffolding that can be used for production projects

The programming models and apis of T-IO and Netty differ greatly

  • The API design of T-IO is more for engineers to use comfortably, so we specially added a tio. Java to place commonly used apis, so that users can easily find them without searching for method calls
  • Part of netty’s API is to expose design patterns so that the layman can see what design patterns are made of

Differences in performance testing

  • On the TFB platform, netty’s performance is far better than t-IO’s. Of course, T-IO’s performance ranking is still very high, and there are a lot of people behind T-IO. (T-IO’s performance is much worse than that of T-IO when it first came out. Is a performance comparison), please refer to: TFB performance PK platform

  • The performance of T-IO is often better than that of NetTY when PK services are carried on. The reasons are as follows: To use NetTY, you need to write your own code to manage service data and monitor traffic, which is a drag on naked Netty. These tasks are built into T-IO, so the performance loss of T-IO is limited. Please refer to the comparison test results of Netty and T-IO

T-io provides extremely convenient blocking and synchronous sending, which are seemingly not available in Netty and require users to write more code to achieve

  • Block send: Execute code down after the message has been sent to the other party

  • Synchronous send: The other party receives the message and replies with the same synSeq message before executing the code

Degree of easy learning: From the market feedback, the concept of T-IO design seems to be easier for engineers to understand and accept. In 2014, my boss wanted me to use NetTY, so I simply read the Authoritative Guide of NetTY. This book was the last straw for me to give up NetTY, and I really couldn’t understand it. The examples provided are hard for me to use in a production project (true feelings, of course, may be my own, another very good and young colleague of mine also read the book, also unclear)

Many users in the choice, feel t-IO documents no netty, turned to netty, in fact, a good framework, does not need too many documents, T-IO in the first out, only a few showcase engineering, the first batch of T-IO users with these showcase to complete their own projects, and reputation spread quickly. Now T-IO official has provided relatively complete documentation, coupled with a full showcase project, it is very easy to use T-IO

If you’ve used Netty or MINA before, try t-IO again.

Specific please refer to www.tiocloud.com/doc/tio/156