ab85d4d678
- Refactorise the tests and add some - Use 250 signs instead of the whole text - Only check for Korean, Chinese and Japanese script - Add a benchmark - Use a more idiomatic control flow ```console $ # main branch $ go test -bench=. goos: linux goarch: amd64 pkg: miniflux.app/v2/internal/reader/readingtime BenchmarkEstimateReadingTime-12 267 4821268 ns/op PASS ok miniflux.app/v2/internal/reader/readingtime 1.754s $ # speed_up_reading_time branch $ go test -bench=. goos: linux goarch: amd64 pkg: miniflux.app/v2/internal/reader/readingtime cpu: 12th Gen Intel(R) Core(TM) i7-1265U BenchmarkEstimateReadingTime-12 1941 653312 ns/op PASS ok miniflux.app/v2/internal/reader/readingtime 1.342s $ ``` |
||
---|---|---|
.. | ||
readingtime.go | ||
readingtime_test.go |