Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/uggla/parse_quote
https://github.com/uggla/parse_quote
Last synced: 25 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/uggla/parse_quote
- Owner: uggla
- License: apache-2.0
- Created: 2024-09-13T19:53:08.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2024-09-19T09:09:59.000Z (3 months ago)
- Last Synced: 2024-10-14T09:11:04.870Z (2 months ago)
- Language: Rust
- Size: 891 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# parse_quote
This code is my response to the Tsurucapital exercise. There is relatively
little information about the performance levels to achieve. I focused more
on memory usage by employing streaming to limit consumption. As for the
runtime, the program runs in under 150ms, so I didn't aim to optimize or
use parallelism. I also tried to handle errors cleanly.Notes:
The use of 'nom' might be a bit excessive, but I find that it helps with
maintaining the parser, and I quite like this library.I added serde and bincode and conducted a test to ensure the data structure
could be serialized. The original idea was to use chunked files and an
external merge for handling very large files, especially if memory usage
became a concern. However, since memory consumption remained low and there
was no precise information about file sizes, I decided not to implement
this approach. Based on current performance, I believe it can handle quite
large files.I also admit I was a bit lazy, I did a bit of TDD, but I didn't write too
many unit tests. :)
But it deserved more unit tests with packets crafted with anomalies.https://www.tsurucapital.com/en/code-sample.html
## Rust version used to build the binary
```bash
rustc --version
rustc 1.81.0 (eeb90cda1 2024-09-04)
```## Usage
```bash
Usage: parse_quote [OPTIONS]Arguments:
File argument (required)Options:
-r Optional flag to enable reordering of the packets according to quote accept time
-d... Optional flag to enable debug. -ddd = trace, -dd = debug, -d = info, 0 = error
-h, --help Print help
-V, --version Print version
```## Performance
```bash
Command being timed: "./target/release/parse_quote pcap/mdf-kospi200.20110216-0.pcap"
User time (seconds): 0.04
System time (seconds): 0.03
Percent of CPU this job got: 53%
Elapsed (wall clock) time (h:mm:ss or m:ss): 0:00.15
Maximum resident set size (kbytes): 8248
``````bash
Command being timed: "./target/release/parse_quote -r pcap/mdf-kospi200.20110216-0.pcap"
User time (seconds): 0.01
System time (seconds): 0.00
Percent of CPU this job got: 95%
Elapsed (wall clock) time (h:mm:ss or m:ss): 0:00.02
Maximum resident set size (kbytes): 8120
```