Skip to content

Commit 4582de1

Browse files
authored
protocol: benchmarks for protocol parsing (#4)
This intend to give a benchmark comparison between Guacamole protocol and Occamy protocol design. name old time/op new time/op delta InstructionParser/occamy-0-6 325ns ± 2% 126ns ± 3% -61.16% (p=0.000 n=10+9) InstructionParser/occamy-1-6 54.3µs ± 1% 1.2µs ± 9% -97.73% (p=0.000 n=9+10) name old alloc/op new alloc/op delta InstructionParser/occamy-0-6 120B ± 0% 96B ± 0% -20.00% (p=0.000 n=10+10) InstructionParser/occamy-1-6 36.4kB ± 0% 8.3kB ± 0% -77.26% (p=0.000 n=10+10) name old allocs/op new allocs/op delta InstructionParser/occamy-0-6 7.00 ± 0% 3.00 ± 0% -57.14% (p=0.000 n=10+10) InstructionParser/occamy-1-6 23.0 ± 0% 3.0 ± 0% -86.96% (p=0.000 n=10+10) As we can see, eliminate the numbers of instruction length reduces the parsing cost significantly. See #3.
1 parent 34ee80e commit 4582de1

File tree

5 files changed

+185
-73
lines changed

5 files changed

+185
-73
lines changed

Diff for: README.md

+6-4
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,15 @@ in a single middleware application. Any client that involves Guacamole protocol
1919
uses WebSocket for authentication can directly switch to interact to Occamy
2020
without any changes.
2121

22-
Read more details in [docs](./docs/README.md)
22+
Read more details in [docs](./docs/README.md).
23+
24+
## Routers
25+
26+
Occamy offers two APIs `/api/v1/login`, which distribute JWT tokens for authentication and `/api/v1/connect` for WebSocket based Guacamole connection. These two APIs are simple enough to serve all users.
2327

2428
## Contributing
2529

26-
Easiest way to contribute is to provide feedback!
27-
We would love to hear what you like and what you think is missing.
28-
PRs are welcome. Please follow the given PR template before you send your pull request.
30+
Easiest way to contribute is to provide feedback! We would love to hear what you like and what you think is missing. PRs are welcome. Please follow the given PR template before you send your pull request.
2931

3032
## Development
3133

Diff for: docker/docker-compose.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ services:
2626
- "5636:5636"
2727
depends_on:
2828
- vnc
29-
- rdp
3029
command: /go/src/github.com/changkun/occamy/occamyd -conf=./conf.yaml
3130
networks:
3231
occamy_network:

Diff for: docs/README.md

+18-14
Original file line numberDiff line numberDiff line change
@@ -9,33 +9,37 @@ Futhermore, `guacd` manages connection in different processes, which can limits
99
connection of Guacamole application.
1010

1111
```
12-
|-- Browser --|----- Guacamole Server ------|--- Intranet ---|
12+
|-- Browser --|-------- Guacamole Server -----------|--- Intranet ---|
1313
14-
UserA ---+ +---- RDP server
15-
+------ Guacamole Servlet |
16-
UserB ---+ | +---- VNC server
17-
+------- guacd -------+
18-
+---- Others
14+
UserA --------+ +---- RDP server
15+
+------ Guacamole Servlet |
16+
UserB --------+ | +---- VNC server
17+
+------- guacd -------+
18+
+---- Others
1919
```
2020

2121
_Figure 1: Guacamole Architecture_
2222

23-
Occamy solves these issue, and it uses JWT for authentication as default option, manages
24-
all connection in mutiple thread rather than multiple processes.
23+
Occamy solves these issues, and it uses JWT for authentication as default option, manages
24+
all connection in mutiple thread rather than multiple processes, as shown in Figure 2.
2525

2626
```
27-
|-- Browser --|-- Occamy Server --|--- Intranet ---|
27+
|-- Browser --|---- Occamy Server -----|--- Intranet ---|
2828
2929
30-
UserA ---+ +---- RDP server
31-
+------ Occamy ----------+
32-
UserB ---+ +---- VNC server
33-
|
34-
+---- Others
30+
UserA --------+ +---- RDP server
31+
+------ Occamy ----------+
32+
UserB --------+ +---- VNC server
33+
|
34+
+---- Others
3535
```
3636

3737
_Figure 2: Occamy Architecture_
3838

39+
## Protocol Instructions
40+
41+
Refer to [Guacamole protocol reference](https://guacamole.apache.org/doc/gug/protocol-reference.html). Note that Occamy has no handshake process between client and Occamy, one can simply POST the connection information to Occamy for getting authentication tokens.
42+
3943

4044
## License
4145

0 commit comments

Comments
 (0)