Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
P
poppler
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 612
    • Issues 612
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 39
    • Merge Requests 39
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • poppler
  • poppler
  • Issues
  • #223

Closed
Open
Opened Oct 29, 2006 by Bugzilla Migration User@bugzilla-migration

Performance Improvement for TextPage:findText()

Submitted by David Benjamin

Assigned to poppler-bugs

Link to original bug (#8821)

Description

(Sorry if I did the patch file wrong or anything like that... this is my first (and hopefully not the last :-D) contribution to a FOSS project other than a typo correction, so... yeah. :-) )

Anyways, so I made some minor improvements to TextPage:findText in poppler/TextOutputDev.cc.

Hopefully I didn't make any mis-optimizations out of misunderstanding bits of the codebase. :-)

Changes:

  • If a block is past what we've already found, then break.
  • If a line is past the end of the searching position, break if searching forwards
  • If a line is past what we've already found, break if searching forwards, otherwise just continue
  • When searching within a line, instead of searching according to backward, search via searchBackwards which takes line rotation into account, thus allowing us to break once the first match in a line is found.

I've also got an implementation of KMP ( http://en.wikipedia.org/wiki/Knuth%E2%80%93Morris%E2%80%93Pratt_algorithm ) with caching of failure functions since most programs do find-as-you-type, but I need to make sure the (minor) extra complexity incurred doesn't outweigh the O() improvement. Probably will attach that in a couple days.

I hope it's of some use. (Changes made against the 0.5.4 release.)

Hmm... I take it the attach file thing is after commiting the report? (I'm not that familiar with Bugzilla yet.)

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: poppler/poppler#223