Skip to content

Commit 5f20663

Browse files
committed
Add benchmarking info to README
Style fixes in README.
1 parent c8b0faf commit 5f20663

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

README.md

+17-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
slug
2-
====
1+
# slug
32

43
Package `slug` generate slug from unicode string, URL-friendly slugify with
54
multiple languages support.
@@ -31,7 +30,7 @@ func main() {
3130

3231
deText := slug.MakeLang("Diese & Dass", "de")
3332
fmt.Println(deText) // Will print: "diese-und-dass"
34-
33+
3534
slug.Lowercase = false // Keep uppercase characters
3635
deUppercaseText := slug.MakeLang("Diese & Dass", "de")
3736
fmt.Println(deUppercaseText) // Will print: "Diese-und-Dass"
@@ -42,17 +41,30 @@ func main() {
4241
textSub := slug.Make("water is hot")
4342
fmt.Println(textSub) // Will print: "sand-is-hot"
4443
}
45-
4644
```
4745

4846
### Requests or bugs?
47+
4948
<https://github.com/gosimple/slug/issues>
5049

5150
## Installation
52-
```sh
51+
52+
```shell
5353
go get -u github.com/gosimple/slug
5454
```
5555

56+
## Benchmarking
57+
58+
```shell
59+
go get -u golang.org/x/perf/cmd/benchstat
60+
61+
go test -run=NONE -bench=. ./... > old.txt
62+
# make changes
63+
go test -run=NONE -bench=. ./... > new.txt
64+
65+
benchstat old.txt new.txt
66+
```
67+
5668
## License
5769

5870
The source files are distributed under the

0 commit comments

Comments
 (0)