这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@satya-nutella
Copy link
Contributor

@satya-nutella satya-nutella commented May 2, 2025

  • Introduced caching for client rects using a WeakMap to optimize performance.
  • Enhanced highlightElement function to use a document fragment for batch DOM updates.
  • Added cleanup function to manage event listeners and overlay elements efficiently.
  • Implemented throttling for position updates during scroll and resize events.
  • Updated getXPathTree to cache results for improved efficiency.

Summary by mrge

Added caching for client rects and XPath lookups to speed up DOM operations, and improved highlight cleanup to manage overlays and event listeners more efficiently.

  • Refactors
    • Used WeakMap to cache client rects and XPath results.
    • Batched DOM updates with document fragments in highlightElement.
    • Added cleanup function to remove overlays and event listeners.
    • Throttled position updates on scroll and resize for better performance.

- Introduced caching for client rects using a WeakMap to optimize performance.
- Enhanced highlightElement function to use a document fragment for batch DOM updates.
- Added cleanup function to manage event listeners and overlay elements efficiently.
- Implemented throttling for position updates during scroll and resize events.
- Updated getXPathTree to cache results for improved efficiency.
@CLAassistant
Copy link

CLAassistant commented May 2, 2025

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mrge reviewed 1 file and found no issues. Review this PR in mrge.io.

@pirate pirate merged commit d810064 into browser-use:main May 3, 2025
35 of 36 checks passed
dharam1291 pushed a commit to dharam1291/browser-use that referenced this pull request May 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants