Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/imvexed/fasturl
A fast URL parser for Go
https://github.com/imvexed/fasturl
parsing performance ragel state-machine
Last synced: 3 months ago
JSON representation
A fast URL parser for Go
- Host: GitHub
- URL: https://github.com/imvexed/fasturl
- Owner: ImVexed
- License: mit
- Created: 2020-07-02T06:46:21.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-03-04T23:13:29.000Z (almost 2 years ago)
- Last Synced: 2024-08-01T13:25:40.881Z (6 months ago)
- Topics: parsing, performance, ragel, state-machine
- Language: Go
- Homepage:
- Size: 146 KB
- Stars: 36
- Watchers: 4
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
## Fast URL
FastURL is a Go URL parser using a [Ragel](http://www.colm.net/open-source/ragel/) state-machine instead of regex, or the built in standard library `url.Parse`.## Why?
*S P E E D*## Examples
See our [tests](https://github.com/ImVexed/fasturl/blob/master/parser_test.go#L45)
## Benchmarks
## ns/op
![](/_images/ns.svg)
## B/op
![](/_images/b.svg)## Raw:
```
goos: linux
goarch: amd64
pkg: github.com/ImVexed/fasturl
BenchmarkRegex-32 464509 2557 ns/op 530 B/op 3 allocs/op
BenchmarkRagel-32 5350304 225 ns/op 96 B/op 1 allocs/op
BenchmarkStd-32 2225313 537 ns/op 128 B/op 1 allocs/op
PASS
ok github.com/ImVexed/fasturl 4.405s
```## How does this work?
Lots of goto's and determinism, feel free to zoom
![](/_images/graph.svg)## Credits
[maximecaron](https://github.com/maximecaron) - Creating the initial ragael parser