René's URL Explorer Experiment


Title: Performance bottleneck in `prune_unwanted_nodes` causing 200ms per call · Issue #750 · adbar/trafilatura · GitHub

Open Graph Title: Performance bottleneck in `prune_unwanted_nodes` causing 200ms per call · Issue #750 · adbar/trafilatura

X Title: Performance bottleneck in `prune_unwanted_nodes` causing 200ms per call · Issue #750 · adbar/trafilatura

Description: When profiling trafilatura.bare_extraction method for some pages that took us a while to parse, I found that significant performance issues in extract_content method. Root cause: Too many calls to prune_unwanted_node with each call takin...

Open Graph Description: When profiling trafilatura.bare_extraction method for some pages that took us a while to parse, I found that significant performance issues in extract_content method. Root cause: Too many calls to ...

X Description: When profiling trafilatura.bare_extraction method for some pages that took us a while to parse, I found that significant performance issues in extract_content method. Root cause: Too many calls to ...

Opengraph URL: https://github.com/adbar/trafilatura/issues/750

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Performance bottleneck in `prune_unwanted_nodes` causing 200ms per call","articleBody":"When profiling `trafilatura.bare_extraction` method for some pages that took us a while to parse, I found that significant performance issues in `extract_content`  method. \r\n\r\n**Root cause**: Too many calls to `prune_unwanted_node` with each call taking upto ~200ms.\r\n\r\n**Steps to reproduce**:\r\n1. Run python with cProfile profiler on `bare_extraction`\r\n2. Try to scrape and parse this page https://nlewo.github.io/nixos-manual-sphinx/generated/options-db.xml.html\r\n3. Observe `prune_unwanted_node` timing\r\n\r\n**Questions**\r\n1. Are there existing configuration options or alternative methods in trafilatura to bypass/optimize this operation?\r\n2. Could we leverage Rust/C++ based HTML parsing libraries (like lxml-rs or html5ever) to accelerate node pruning?\r\n3. Could we leverage caching to reduce latency?\r\n","author":{"url":"https://github.com/thsunkid","@type":"Person","name":"thsunkid"},"datePublished":"2024-11-23T20:48:47Z","url":"https://github.com/adbar/trafilatura/issues/750"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:203456b0-baf9-21a0-52ff-1e7a3b513505
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idE77C:14D062:3CB22F:53D263:6AEDB46B
html-safe-nonce7396e76d718b04c9a02b4bc1c7da60cfb31a94c2777fe23a5ae8f2db3faccc89
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNzdDOjE0RDA2MjozQ0IyMkY6NTNEMjYzOjZBRURCNDZCIiwidmlzaXRvcl9pZCI6IjExOTc3NzQyMjc4MzAwNjAxMzkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac21e4c24f045c7af53ee9d15dd7a01a37d4021078809385f2f0455099c6408695
hovercard-subject-tagissue:2686593053
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/adbar/trafilatura/750/issue_layout
twitter:imagehttps://opengraph.githubassets.com/ea00f42f649922284528179093195a900c12a0b0774ef92d0f76ce4f29b43cbb/adbar/trafilatura/issues/750
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/ea00f42f649922284528179093195a900c12a0b0774ef92d0f76ce4f29b43cbb/adbar/trafilatura/issues/750
og:image:altWhen profiling trafilatura.bare_extraction method for some pages that took us a while to parse, I found that significant performance issues in extract_content method. Root cause: Too many calls to ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamethsunkid
hostnamegithub.com
expected-hostnamegithub.com
Nonee40242599af5e7da0f281843dec7492c322688d4a48caeea85f9fb8e41c8ea53
turbo-cache-controlno-preview
go-importgithub.com/adbar/trafilatura git https://github.com/adbar/trafilatura.git
octolytics-dimension-user_id2125866
octolytics-dimension-user_loginadbar
octolytics-dimension-repository_id180136168
octolytics-dimension-repository_nwoadbar/trafilatura
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id180136168
octolytics-dimension-repository_network_root_nwoadbar/trafilatura
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release89cbf2bb52a24fc179bf5925abba0ba574b262ce
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/adbar/trafilatura/issues/750#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fadbar%2Ftrafilatura%2Fissues%2F750
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fadbar%2Ftrafilatura%2Fissues%2F750
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=adbar%2Ftrafilatura
Reloadhttps://github.com/adbar/trafilatura/issues/750
Reloadhttps://github.com/adbar/trafilatura/issues/750
Reloadhttps://github.com/adbar/trafilatura/issues/750
adbarhttps://github.com/adbar
trafilaturahttps://github.com/adbar/trafilatura
Codehttps://github.com/adbar/trafilatura
Issues49 (49)https://github.com/adbar/trafilatura/issues
Pull requests21 (21)https://github.com/adbar/trafilatura/pulls
Discussionshttps://github.com/adbar/trafilatura/discussions
Actionshttps://github.com/adbar/trafilatura/actions
Security and qualityhttps://github.com/adbar/trafilatura/security
Insightshttps://github.com/adbar/trafilatura/pulse
https://github.com/adbar/trafilatura
New issuehttps://github.com/login?return_to=https://github.com/adbar/trafilatura/issues/750
New issuehttps://github.com/login?return_to=https://github.com/adbar/trafilatura/issues/750
#1093https://github.com/adbar/trafilatura/pull/1093
Performance bottleneck in prune_unwanted_nodes causing 200ms per callhttps://github.com/adbar/trafilatura/issues/750#top
#1093https://github.com/adbar/trafilatura/pull/1093
bugSomething isn't workinghttps://github.com/adbar/trafilatura/issues?q=state%3Aopen%20label%3A%22bug%22
https://github.com/thsunkid
thsunkidhttps://github.com/thsunkid
on Nov 23, 2024https://github.com/adbar/trafilatura/issues/750#issue-2686593053
https://nlewo.github.io/nixos-manual-sphinx/generated/options-db.xml.htmlhttps://nlewo.github.io/nixos-manual-sphinx/generated/options-db.xml.html
adbarhttps://github.com/adbar
questionFurther information is requestedhttps://github.com/adbar/trafilatura/issues?q=state%3Aopen%20label%3A%22question%22
on Nov 25, 2024https://github.com/adbar/trafilatura/issues/750#event-15419855880
https://github.com/adbar
adbarhttps://github.com/adbar
on Nov 25, 2024https://github.com/adbar/trafilatura/issues/750#issuecomment-2497868014
@thsunkidhttps://github.com/thsunkid
optimizing for speedhttps://trafilatura.readthedocs.io/en/latest/usage-python.html#optimizing-for-speed
adbarhttps://github.com/adbar
bugSomething isn't workinghttps://github.com/adbar/trafilatura/issues?q=state%3Aopen%20label%3A%22bug%22
questionFurther information is requestedhttps://github.com/adbar/trafilatura/issues?q=state%3Aopen%20label%3A%22question%22
on Nov 5, 2026https://github.com/adbar/trafilatura/issues/750#event-35282225539
https://github.com/adbar
adbarhttps://github.com/adbar
on Nov 5, 2026https://github.com/adbar/trafilatura/issues/750#issuecomment-6668149177
Sign up for freehttps://github.com/signup?return_to=https://github.com/adbar/trafilatura/issues/750
Sign in to commenthttps://github.com/login?return_to=https://github.com/adbar/trafilatura/issues/750
bugSomething isn't workinghttps://github.com/adbar/trafilatura/issues?q=state%3Aopen%20label%3A%22bug%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.