René's URL Explorer Experiment


Title: fix: slow hnsw by caching num docs by jupyterjazz · Pull Request #1706 · docarray/docarray · GitHub

Open Graph Title: fix: slow hnsw by caching num docs by jupyterjazz · Pull Request #1706 · docarray/docarray

X Title: fix: slow hnsw by caching num docs by jupyterjazz · Pull Request #1706 · docarray/docarray

Description: As the user reported, num_docs() operation is expensive and slows down the search. This PR addresses the issue by storing/caching num_docs and updating it after index/del I tested on this simple co...

Open Graph Description: As the user reported, num_docs() operation is expensive and slows down the search. This PR addresses the issue by storing/caching num_docs and updating it after index/del I tested on this simple co...

X Description: As the user reported, num_docs() operation is expensive and slows down the search. This PR addresses the issue by storing/caching num_docs and updating it after index/del I tested on this simple co...

Opengraph URL: https://github.com/docarray/docarray/pull/1706

X: @github

direct link

Domain: github.com

route-pattern/_view_fragments/voltron/pull_requests/show/:user_id/:repository/:id/pull_request_layout(.:format)
route-controllervoltron_pull_requests_fragments
route-actionpull_request_layout
fetch-noncev2:35a5413b-8262-eaee-c774-10b548eeef4a
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idA35E:194F15:3A35A9B:506A67E:69650F9D
html-safe-nonceddba7382a2240556d080bc8e3203162a248c7dd31f4ac5809d862c438e0151d4
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMzVFOjE5NEYxNTozQTM1QTlCOjUwNkE2N0U6Njk2NTBGOUQiLCJ2aXNpdG9yX2lkIjoiMzc3MDQwMzQyNTU3NjM1Nzc4OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacbbf1ce53c79f50e1233a4511a230125fe1cdae6dadffbc5350e973f2493b27b5
hovercard-subject-tagpull_request:1438728935
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/pull_requests_fragments/pull_request_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/voltron/pull_requests/show/docarray/docarray/1706/pull_request_layout
twitter:imagehttps://opengraph.githubassets.com/2c49fdf35cc169dbe6d279836788bda006843349f7d7907cae4ac798a77de7b5/docarray/docarray/pull/1706
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/2c49fdf35cc169dbe6d279836788bda006843349f7d7907cae4ac798a77de7b5/docarray/docarray/pull/1706
og:image:altAs the user reported, num_docs() operation is expensive and slows down the search. This PR addresses the issue by storing/caching num_docs and updating it after index/del I tested on this simple co...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamejupyterjazz
hostnamegithub.com
expected-hostnamegithub.com
None361e28552f448e2f3c84aa6d1d70cc09abfcd936966fa76682f0659b4f5f51d0
turbo-cache-controlno-preview
go-importgithub.com/docarray/docarray git https://github.com/docarray/docarray.git
octolytics-dimension-user_id117445116
octolytics-dimension-user_logindocarray
octolytics-dimension-repository_id438303578
octolytics-dimension-repository_nwodocarray/docarray
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id438303578
octolytics-dimension-repository_network_root_nwodocarray/docarray
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
releasebb94fc71fe8da8a45636ada2c7618bc2b49b9cbe
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/docarray/docarray/pull/1706#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fdocarray%2Fdocarray%2Fpull%2F1706
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
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
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://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/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fdocarray%2Fdocarray%2Fpull%2F1706
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fpull_requests_fragments%2Fpull_request_layout&source=header-repo&source_repo=docarray%2Fdocarray
Reloadhttps://github.com/docarray/docarray/pull/1706
Reloadhttps://github.com/docarray/docarray/pull/1706
Reloadhttps://github.com/docarray/docarray/pull/1706
docarray https://github.com/docarray
docarrayhttps://github.com/docarray/docarray
Notifications https://github.com/login?return_to=%2Fdocarray%2Fdocarray
Fork 234 https://github.com/login?return_to=%2Fdocarray%2Fdocarray
Star 3.1k https://github.com/login?return_to=%2Fdocarray%2Fdocarray
Code https://github.com/docarray/docarray
Issues 68 https://github.com/docarray/docarray/issues
Pull requests 36 https://github.com/docarray/docarray/pulls
Discussions https://github.com/docarray/docarray/discussions
Actions https://github.com/docarray/docarray/actions
Security Uh oh! There was an error while loading. Please reload this page. https://github.com/docarray/docarray/security
Please reload this pagehttps://github.com/docarray/docarray/pull/1706
Insights https://github.com/docarray/docarray/pulse
Code https://github.com/docarray/docarray
Issues https://github.com/docarray/docarray/issues
Pull requests https://github.com/docarray/docarray/pulls
Discussions https://github.com/docarray/docarray/discussions
Actions https://github.com/docarray/docarray/actions
Security https://github.com/docarray/docarray/security
Insights https://github.com/docarray/docarray/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fdocarray%2Fdocarray%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fdocarray%2Fdocarray%2Fissues%2Fnew%2Fchoose
Jump to bottomhttps://github.com/docarray/docarray/pull/1706#issue-comment-box
jupyterjazzhttps://github.com/jupyterjazz
mainhttps://github.com/docarray/docarray/tree/main
fix-hnsw-performancehttps://github.com/docarray/docarray/tree/fix-hnsw-performance
fix: slow hnsw by caching num docs https://github.com/docarray/docarray/pull/1706#top
jupyterjazzhttps://github.com/jupyterjazz
mainhttps://github.com/docarray/docarray/tree/main
fix-hnsw-performancehttps://github.com/docarray/docarray/tree/fix-hnsw-performance
Conversation 7 https://github.com/docarray/docarray/pull/1706
Commits 5 https://github.com/docarray/docarray/pull/1706/commits
Checks 0 https://github.com/docarray/docarray/pull/1706/checks
Files changed https://github.com/docarray/docarray/pull/1706/files
Please reload this pagehttps://github.com/docarray/docarray/pull/1706
https://github.co/hiddenchars
https://github.com/docarray/docarray/pull/{{ revealButtonHref }}
https://github.com/jupyterjazz
jupyterjazzhttps://github.com/jupyterjazz
Jul 18, 2023https://github.com/docarray/docarray/pull/1706#issue-1809351626
Please reload this pagehttps://github.com/docarray/docarray/pull/1706
Please reload this pagehttps://github.com/docarray/docarray/pull/1706
jupyterjazzhttps://github.com/jupyterjazz
July 18, 2023 09:45https://github.com/docarray/docarray/pull/1706#commits-pushed-6d31526
https://github.com/jupyterjazz
fix: slow hnsw by caching num docshttps://github.com/docarray/docarray/pull/1706/commits/6d31526e3cc1e1c42329b9788a56d4e401bfe0c6
6d31526https://github.com/docarray/docarray/pull/1706/commits/6d31526e3cc1e1c42329b9788a56d4e401bfe0c6
https://github.com/jupyterjazz
chore: remove unused linehttps://github.com/docarray/docarray/pull/1706/commits/232f6be08c24218f3b893ee244546b2a05ad381f
232f6behttps://github.com/docarray/docarray/pull/1706/commits/232f6be08c24218f3b893ee244546b2a05ad381f
https://github.com/jupyterjazz
jupyterjazzhttps://github.com/jupyterjazz
Jul 18, 2023https://github.com/docarray/docarray/pull/1706#event-9846901378
HNSWlib wrapper, very slow due to a simple recomputation bug #1703 https://github.com/docarray/docarray/issues/1703
https://github.com/apps/github-actions
github-actionshttps://github.com/apps/github-actions
size/xs https://github.com/docarray/docarray/issues?q=state%3Aopen%20label%3Asize%2Fxs
area/core https://github.com/docarray/docarray/issues?q=state%3Aopen%20label%3Aarea%2Fcore
Jul 18, 2023https://github.com/docarray/docarray/pull/1706#event-9846903816
https://github.com/JoanFM
JoanFMhttps://github.com/JoanFM
Jul 18, 2023 https://github.com/docarray/docarray/pull/1706#pullrequestreview-1534419546
View reviewed changes https://github.com/docarray/docarray/pull/1706/files/232f6be08c24218f3b893ee244546b2a05ad381f
docarray/index/backends/hnswlib.pyhttps://github.com/docarray/docarray/pull/1706/files/232f6be08c24218f3b893ee244546b2a05ad381f#diff-54bd34b766921b9540005c25c29321d3ac61fec7d6e59452db81aa4050ef475e
JoanFMhttps://github.com/JoanFM
Jul 18, 2023https://github.com/docarray/docarray/pull/1706#discussion_r1266374532
Please reload this pagehttps://github.com/docarray/docarray/pull/1706
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/docarray/docarray/pull/1706
jupyterjazzhttps://github.com/jupyterjazz
Jul 18, 2023https://github.com/docarray/docarray/pull/1706#discussion_r1266379027
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/docarray/docarray/pull/1706
JoanFMhttps://github.com/JoanFM
Jul 18, 2023https://github.com/docarray/docarray/pull/1706#discussion_r1266384360
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/docarray/docarray/pull/1706
jupyterjazzhttps://github.com/jupyterjazz
Jul 18, 2023https://github.com/docarray/docarray/pull/1706#discussion_r1266387269
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/docarray/docarray/pull/1706
https://github.com/JoanFM
JoanFMhttps://github.com/JoanFM
Jul 18, 2023 https://github.com/docarray/docarray/pull/1706#pullrequestreview-1534420063
View reviewed changes https://github.com/docarray/docarray/pull/1706/files/232f6be08c24218f3b893ee244546b2a05ad381f
JoanFMhttps://github.com/JoanFM
https://github.com/docarray/docarray/pull/1706#pullrequestreview-1534420063
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/docarray/docarray/pull/1706
https://github.com/apps/codecov
codecovhttps://github.com/apps/codecov
Jul 18, 2023https://github.com/docarray/docarray/pull/1706#issuecomment-1639694238
Please reload this pagehttps://github.com/docarray/docarray/pull/1706
Codecovhttps://app.codecov.io/gh/docarray/docarray/pull/1706?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=docarray
(b306c80)https://app.codecov.io/gh/docarray/docarray/commit/b306c80b334a1d1b2bc865d53d7e9733f27445f5?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=docarray
(ace5e1a)https://app.codecov.io/gh/docarray/docarray/pull/1706?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=docarray
Click herehttps://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=docarray#carryforward-flags-in-the-pull-request-comment
Impacted Fileshttps://app.codecov.io/gh/docarray/docarray/pull/1706?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=docarray
docarray/index/backends/hnswlib.pyhttps://app.codecov.io/gh/docarray/docarray/pull/1706?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=docarray#diff-ZG9jYXJyYXkvaW5kZXgvYmFja2VuZHMvaG5zd2xpYi5weQ==
☔ View full report in Codecov by Sentryhttps://app.codecov.io/gh/docarray/docarray/pull/1706?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=docarray
Let us know in this issuehttps://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=docarray
Please reload this pagehttps://github.com/docarray/docarray/pull/1706
https://github.com/jupyterjazz
refactor: set num docs to 0https://github.com/docarray/docarray/pull/1706/commits/a411c5ec919846e6e87f310ad951a9bd10df4f31
a411c5ehttps://github.com/docarray/docarray/pull/1706/commits/a411c5ec919846e6e87f310ad951a9bd10df4f31
https://github.com/jupyterjazz
jupyterjazzhttps://github.com/jupyterjazz
JoanFMhttps://github.com/JoanFM
July 18, 2023 08:01https://github.com/docarray/docarray/pull/1706#event-9847065554
https://github.com/jupyterjazz
jupyterjazzhttps://github.com/jupyterjazz
July 18, 2023 08:02https://github.com/docarray/docarray/pull/1706#event-9847072737
jupyterjazzhttps://github.com/jupyterjazz
July 18, 2023 10:12https://github.com/docarray/docarray/pull/1706#commits-pushed-916ed27
https://github.com/jupyterjazz
refactor: go back to the initial solutionhttps://github.com/docarray/docarray/pull/1706/commits/916ed2749a96fbf4a8ad553e0709af9b027b747a
916ed27https://github.com/docarray/docarray/pull/1706/commits/916ed2749a96fbf4a8ad553e0709af9b027b747a
https://github.com/jupyterjazz
Merge branch 'main' into fix-hnsw-performancehttps://github.com/docarray/docarray/pull/1706/commits/ace5e1a45da38c3923d46ca7e2b9c2b86522ddcd
ace5e1ahttps://github.com/docarray/docarray/pull/1706/commits/ace5e1a45da38c3923d46ca7e2b9c2b86522ddcd
https://github.com/JoanFM
JoanFMhttps://github.com/JoanFM
Jul 18, 2023 https://github.com/docarray/docarray/pull/1706#pullrequestreview-1534465284
View reviewed changes https://github.com/docarray/docarray/pull/1706/files/ace5e1a45da38c3923d46ca7e2b9c2b86522ddcd
https://github.com/apps/github-actions
github-actionshttps://github.com/apps/github-actions
Jul 18, 2023https://github.com/docarray/docarray/pull/1706#issuecomment-1639739886
https://ft-fix-hnsw-performance--jina-docs.netlify.apphttps://ft-fix-hnsw-performance--jina-docs.netlify.app
Please reload this pagehttps://github.com/docarray/docarray/pull/1706
https://github.com/jupyterjazz
jupyterjazzhttps://github.com/jupyterjazz
c566401https://github.com/docarray/docarray/commit/c56640160d54ccfd2e699f7f65103672cf77f32b
Jul 18, 2023https://github.com/docarray/docarray/pull/1706#event-9847356842
https://github.com/jupyterjazz
jupyterjazzhttps://github.com/jupyterjazz
July 18, 2023 08:29https://github.com/docarray/docarray/pull/1706#event-9847357041
https://github.com/jupyterjazz
jupyterjazzhttps://github.com/jupyterjazz
Jul 18, 2023 https://github.com/docarray/docarray/pull/1706#ref-issue-1809463675
Release Notes v0.36.0 #1707 https://github.com/docarray/docarray/issues/1707
Sign up for freehttps://github.com/join?source=comment-repo
Sign in to commenthttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fdocarray%2Fdocarray%2Fpull%2F1706
https://github.com/JoanFM
JoanFM https://github.com/JoanFM
https://github.com/docarray/docarray/pull/1706/files/ace5e1a45da38c3923d46ca7e2b9c2b86522ddcd
area/core https://github.com/docarray/docarray/issues?q=state%3Aopen%20label%3Aarea%2Fcore
size/xs https://github.com/docarray/docarray/issues?q=state%3Aopen%20label%3Asize%2Fxs
HNSWlib wrapper, very slow due to a simple recomputation bug https://github.com/docarray/docarray/issues/1703
Please reload this pagehttps://github.com/docarray/docarray/pull/1706
https://github.com/jupyterjazz
https://github.com/JoanFM
https://github.com/apps/copilot-swe-agent
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.