Skip to content

Commit

Permalink
protocol: benchmarks for protocol parsing
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
changkun committed Feb 2, 2019
1 parent 34ee80e commit cda9902
Show file tree
Hide file tree
Showing 5 changed files with 185 additions and 73 deletions.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,15 @@ in a single middleware application. Any client that involves Guacamole protocol
uses WebSocket for authentication can directly switch to interact to Occamy
without any changes.

Read more details in [docs](./docs/README.md)
Read more details in [docs](./docs/README.md).

## Routers

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.

## Contributing

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.
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.

## Development

Expand Down
1 change: 0 additions & 1 deletion docker/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ services:
- "5636:5636"
depends_on:
- vnc
- rdp
command: /go/src/github.com/changkun/occamy/occamyd -conf=./conf.yaml
networks:
occamy_network:
Expand Down
32 changes: 18 additions & 14 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,33 +9,37 @@ Futhermore, `guacd` manages connection in different processes, which can limits
connection of Guacamole application.

```
|-- Browser --|----- Guacamole Server ------|--- Intranet ---|
|-- Browser --|-------- Guacamole Server -----------|--- Intranet ---|
UserA ---+ +---- RDP server
+------ Guacamole Servlet |
UserB ---+ | +---- VNC server
+------- guacd -------+
+---- Others
UserA --------+ +---- RDP server
+------ Guacamole Servlet |
UserB --------+ | +---- VNC server
+------- guacd -------+
+---- Others
```

_Figure 1: Guacamole Architecture_

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

```
|-- Browser --|-- Occamy Server --|--- Intranet ---|
|-- Browser --|---- Occamy Server -----|--- Intranet ---|
UserA ---+ +---- RDP server
+------ Occamy ----------+
UserB ---+ +---- VNC server
|
+---- Others
UserA --------+ +---- RDP server
+------ Occamy ----------+
UserB --------+ +---- VNC server
|
+---- Others
```

_Figure 2: Occamy Architecture_

## Protocol Instructions

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.


## License

Expand Down
Loading

0 comments on commit cda9902

Please sign in to comment.