Skip to content

Commit 800c679

Browse files
author
Mad Sheogorath
committed
Merge remote-tracking branch 'origin/main'
2 parents 3e56ce2 + b3ab996 commit 800c679

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

README.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,28 @@
11
## What is PackMe
2-
PackMe is a lightweight library for packing your data into binary buffer (presumably in order to be sent over tcp connection) and unpacking it back to class objects described in a simple way via JSON manifest file.
2+
PackMe is a lightweight library for packing your data into binary buffer (presumably in order to be sent over tcp connection) and unpacking it back to class objects described in a simple way via JSON manifest files.
3+
4+
## It is Fast
5+
Spoiler alert! ~500k pack/unpack cycles per second for data of average size and complexity. Of course it depends on system configuration :)
36

4-
## It is Fast
57
Since PackMe generates .dart classes, there is no need for any resource demanding serialization/deserialization process. No intermediate steps involved, every class has it's own efficient methods to quickly put all data to Uint8List buffer and extract it. Comparing to popular solutions it's performance is similar to FlatBuffers and greatly outperforms Proto Buffers.
68

79
## It is Simple
8-
You do not need to learn any additional data format or special manifest syntax (like in case of using FlatBuffers or Proto Buffers), just use JSON! Everyone knows JSON, right? Objects, types and messages declarations are very simple and intuitive.
10+
No special file formats (like for FlatBuffers or Proto Buffers manifest files), just use JSON. Objects, types and messages declarations are very simple and intuitive.
911

1012
## Usage
11-
The best way of using it for client-server applications is by using ConnectMe package which provides all necessary stuff like adding listeners, calling asynchronous queries etc. But you can use it separately as well.
13+
The best way of using it for client-server applications is by using ConnectMe package which provides all necessary stuff like adding message listeners, calling asynchronous queries etc. But you can use it separately as well.
1214

1315
Here's a simple manifest.json file (located in packme directory) for some hypothetical client-server application:
1416
```json
1517
{
1618
"get_user": [
1719
{
18-
"id": "string",
20+
"id": "string"
1921
},
2022
{
2123
"first_name": "string",
2224
"last_name": "string",
23-
"age": "uint16"
25+
"age": "uint8"
2426
}
2527
]
2628
}
@@ -45,7 +47,7 @@ socket.send(packMe.pack(request)); // Some socket implementation
4547
socket.listen((Uint8List data) {
4648
final PackMeMessage? message = packMe.unpack(data);
4749
if (message is GetUserResponse) {
48-
print('He is awesome: ${message.firstName} ${message.firstName}, ${message.age} y.o.');
50+
print('He is awesome: ${message.firstName} ${message.lastName}, ${message.age} y.o.');
4951
}
5052
});
5153
```

0 commit comments

Comments
 (0)