Skip to content
Snippets Groups Projects
  1. Mar 08, 2024
  2. Mar 07, 2024
    • jvoisin's avatar
      Use an io.ReadSeeker instead of an io.Reader to parse feeds · a074773e
      jvoisin authored
      This will allow to make use of func (*Reader) Seek, instead of re-recreating a
      new reader. It's a large commit for a small change, but anything to simply the
      reader/buffer/ReadAll/… mess is a step in the right direction I think, and it
      should enable more follow-up simplifications.
      a074773e
  3. Mar 06, 2024
    • jvoisin's avatar
      Speed the sanitizer up a bit, again · 3d0126be
      jvoisin authored
      - allow youtube urls to start with `www`
      - use `strings.Builder` instead of a `bytes.Buffer`
      - use a `strings.NewReader` instead of a `bytes.NewBufferString`
      - sprinkles a couple of `continue` to make the code-flow more obvious
      - inline calls to `inList`, and put their parameters in the right order
      - simplify isPixelTracker
      - simplify `isValidIframeSource`, by extracting the hostname and comparing it
        directly, instead of using the full url and checking if it starts with
        multiple variations of the same one (`//`, `http:`, `https://` multiplied by
        ``/`www.`)
      - add a benchmark
      3d0126be
  4. Mar 05, 2024
  5. Mar 04, 2024
  6. Mar 02, 2024
  7. Mar 01, 2024
    • Frédéric Guillot's avatar
    • jvoisin's avatar
      Speed up removeUnlikelyCandidates · 347740dc
      jvoisin authored
      `.Not` returns a brand new Selection, copied element by element.
      347740dc
    • jvoisin's avatar
      Improve EstimateReadingTime's speed by a factor 7 · ab85d4d6
      jvoisin authored
      - 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
      $
      ```
      ab85d4d6
    • jvoisin's avatar
      Don't compute reading-time when unused · 31ac62f4
      jvoisin authored
      If the user doesn't display reading times, there is no need to compute them.
      This should speed things up a bit, since `whatlanggo.Detect` is abysmally slow.
      31ac62f4
    • Frédéric Guillot's avatar
      Revert "Minor internal/reader/readability/readability.go speedup" · 97765b93
      Frédéric Guillot authored
      This reverts commit 4db138d4.
      
      ```
      panic: runtime error: index out of range [-1]
      
      goroutine 49 [running]:
      miniflux.app/v2/internal/reader/readability.getArticle.func1(0x8?, 0xc000b56570)
              /home/fred/repos/miniflux/v2/internal/reader/readability/readability.go:120 +0x2ac
      github.com/PuerkitoBio/goquery.(*Selection).Each(0xc000b56510, 0xc000892fa8)
              /home/fred/go/pkg/mod/github.com/!puerkito!bio/goquery@v1.9.0/iteration.go:10 +0x62
      miniflux.app/v2/internal/reader/readability.getArticle(0xc00044f1f0, 0xc000a04a50)
              /home/fred/repos/miniflux/v2/internal/reader/readability/readability.go:101 +0x15d
      miniflux.app/v2/internal/reader/readability.ExtractContent({0x1005d00?, 0xc0001522d0?})
              /home/fred/repos/miniflux/v2/internal/reader/readability/readability.go:91 +0x211
      miniflux.app/v2/internal/reader/scraper.ScrapeWebsite(0xc000893688?, {0xc0007ce720, 0x54}, {0x0, 0x0})
              /home/fred/repos/miniflux/v2/internal/reader/scraper/scraper.go:63 +0x859
      miniflux.app/v2/internal/reader/processor.ProcessFeedEntries(0xc000133188, 0xc000502c40, 0xc0003e6360, 0x0)
              /home/fred/repos/miniflux/v2/internal/reader/processor/processor.go:77 +0x8ea
      miniflux.app/v2/internal/reader/handler.RefreshFeed(0xc000133188, 0x10cf, 0x52d5c, 0x0)
              /home/fred/repos/miniflux/v2/internal/reader/handler/handler.go:301 +0x1485
      miniflux.app/v2/internal/cli.refreshFeeds.func1(0x0)
              /home/fred/repos/miniflux/v2/internal/cli/refresh_feeds.go:59 +0x2d7
      created by miniflux.app/v2/internal/cli.refreshFeeds in goroutine 1
              /home/fred/repos/miniflux/v2/internal/cli/refresh_feeds.go:50 +0x5d5
      ```
      97765b93
    • dependabot[bot]'s avatar
      Bump github.com/PuerkitoBio/goquery from 1.9.0 to 1.9.1 · f858ad5f
      dependabot[bot] authored
      Bumps [github.com/PuerkitoBio/goquery](https://github.com/PuerkitoBio/goquery) from 1.9.0 to 1.9.1.
      - [Release notes](https://github.com/PuerkitoBio/goquery/releases)
      - [Commits](https://github.com/PuerkitoBio/goquery/compare/v1.9.0...v1.9.1
      
      )
      
      ---
      updated-dependencies:
      - dependency-name: github.com/PuerkitoBio/goquery
        dependency-type: direct:production
        update-type: version-update:semver-patch
      ...
      
      Signed-off-by: default avatardependabot[bot] <support@github.com>
      f858ad5f
    • jvoisin's avatar
      Simplify username generation for the tests · e6524f92
      jvoisin authored
      No need to generate random numbers 10 times, generate a single big-enough one.
      A single int64 should be more than enough
      e6524f92
  8. Feb 29, 2024
  9. Feb 28, 2024
Loading