René's URL Explorer Experiment


Title: concurrency examples · Issue #43 · fluentpython/example-code-2e · GitHub

Open Graph Title: concurrency examples · Issue #43 · fluentpython/example-code-2e

X Title: concurrency examples · Issue #43 · fluentpython/example-code-2e

Description: hi. so i know that you probably know this but if there will be a 3rd edition, exapmles 19-13 and 19-12 (and other examples in chapter 19) need a rework. e.g the mentioned examples actually fail to prove the point of multiprocessing being...

Open Graph Description: hi. so i know that you probably know this but if there will be a 3rd edition, exapmles 19-13 and 19-12 (and other examples in chapter 19) need a rework. e.g the mentioned examples actually fail to ...

X Description: hi. so i know that you probably know this but if there will be a 3rd edition, exapmles 19-13 and 19-12 (and other examples in chapter 19) need a rework. e.g the mentioned examples actually fail to ...

Opengraph URL: https://github.com/fluentpython/example-code-2e/issues/43

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"concurrency examples","articleBody":"hi.\r\nso i know that you probably know this\r\nbut if there will be a 3rd edition, exapmles 19-13 and 19-12 (and other examples in chapter 19) need a rework.\r\ne.g the mentioned examples actually fail to prove the point of multiprocessing  being good for cpu bound work since the prime number example is done in less than a second\r\nthe perf_countr() actually shows `0.00`\r\nand 19-13 actually takes longer due to multiprocessing overhead\r\n\r\nbelow is the result of running them on python 3.12.2 on a not very new xeon cpu with `perf_counter()`\r\n```\r\npython sequential.py \r\n\r\nChecking 20 numbers sequentially:\r\n               2  P  0.000001s\r\n 142702110479723  P  0.000002s\r\n 299593572317531  P  0.000001s\r\n3333333333333301  P  0.000001s\r\n3333333333333333  P  0.000001s\r\n3333335652092209  P  0.000001s\r\n4444444444444423  P  0.000001s\r\n4444444444444444     0.000001s\r\n4444444488888889  P  0.000001s\r\n5555553133149889  P  0.000001s\r\n5555555555555503  P  0.000001s\r\n5555555555555555  P  0.000001s\r\n6666666666666666     0.000001s\r\n6666666666666719  P  0.000001s\r\n6666667141414921  P  0.000001s\r\n7777777536340681  P  0.000001s\r\n7777777777777753  P  0.000001s\r\n7777777777777777  P  0.000001s\r\n9999999999999917  P  0.000001s\r\n9999999999999999  P  0.000001s\r\nTotal time: 0.00s\r\n```\r\n```\r\npython procs.py \r\n\r\nCheking 20 numbers with 16 processes:\r\n               2  P  0.000035s\r\n 142702110479723  P  0.000003s\r\n 299593572317531  P  0.000002s\r\n3333333333333301  P  0.000001s\r\n3333333333333333  P  0.000001s\r\n3333335652092209  P  0.000001s\r\n4444444444444423  P  0.000001s\r\n4444444444444444     0.000001s\r\n4444444488888889  P  0.000001s\r\n5555555555555503  P  0.000001s\r\n5555555555555555  P  0.000001s\r\n6666666666666666     0.000001s\r\n6666666666666719  P  0.000001s\r\n6666667141414921  P  0.000001s\r\n7777777536340681  P  0.000001s\r\n7777777777777753  P  0.000001s\r\n7777777777777777  P  0.000001s\r\n9999999999999917  P  0.000001s\r\n9999999999999999  P  0.000001s\r\n5555553133149889  P  0.000033s\r\n20 checks in 0.02s\r\n```\r\n\r\nand this is the result using `perf_counter_ns()`\r\n\r\n```\r\npython sequential.py \r\n\r\nChecking 20 numbers sequentially:\r\n               2  P 487.000000ns\r\n 142702110479723  P 1047.000000ns\r\n 299593572317531  P 500.000000ns\r\n3333333333333301  P 320.000000ns\r\n3333333333333333  P 295.000000ns\r\n3333335652092209  P 279.000000ns\r\n4444444444444423  P 214.000000ns\r\n4444444444444444    296.000000ns\r\n4444444488888889  P 215.000000ns\r\n5555553133149889  P 200.000000ns\r\n5555555555555503  P 222.000000ns\r\n5555555555555555  P 247.000000ns\r\n6666666666666666    290.000000ns\r\n6666666666666719  P 196.000000ns\r\n6666667141414921  P 227.000000ns\r\n7777777536340681  P 202.000000ns\r\n7777777777777753  P 202.000000ns\r\n7777777777777777  P 202.000000ns\r\n9999999999999917  P 202.000000ns\r\n9999999999999999  P 202.000000ns\r\nTotal time: 118353.00ns\r\n```\r\n```\r\npython procs.py \r\n\r\nCheking 20 numbers with 16 processes:\r\n               2  P 13804.000000ns\r\n 142702110479723  P 2860.000000ns\r\n 299593572317531  P 1762.000000ns\r\n3333333333333301  P 1324.000000ns\r\n3333333333333333  P 1270.000000ns\r\n3333335652092209  P 1073.000000ns\r\n4444444444444423  P 794.000000ns\r\n4444444444444444    1200.000000ns\r\n4444444488888889  P 810.000000ns\r\n5555553133149889  P 890.000000ns\r\n5555555555555503  P 753.000000ns\r\n5555555555555555  P 995.000000ns\r\n6666666666666666    925.000000ns\r\n6666666666666719  P 813.000000ns\r\n6666667141414921  P 678.000000ns\r\n7777777536340681  P 763.000000ns\r\n7777777777777753  P 703.000000ns\r\n9999999999999917  P 941.000000ns\r\n9999999999999999  P 740.000000ns\r\n7777777777777777  P 26330.000000ns\r\n20 checks in 18213477.00ns\r\n```","author":{"url":"https://github.com/amirreza8002","@type":"Person","name":"amirreza8002"},"datePublished":"2024-04-10T22:48:36.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/43/example-code-2e/issues/43"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:e2ecbadd-128c-2eaa-e911-95b48965ce3d
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idE020:8F24B:10786E9:16E2728:6970C6D1
html-safe-noncea455e4731fb0bb5a70ef65909170eafb13bdc680abf36c46736b7fb30d6be172
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMDIwOjhGMjRCOjEwNzg2RTk6MTZFMjcyODo2OTcwQzZEMSIsInZpc2l0b3JfaWQiOiI0OTIwMDQxNTEzNTg1NTI2NDgxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmacb4ef90980cbe4339c82b57481d41a3504e80ca2208b9d5dd54ffa4f792ff4cfa
hovercard-subject-tagissue:2236552600
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/fluentpython/example-code-2e/43/issue_layout
twitter:imagehttps://opengraph.githubassets.com/23abc33981582a1e5f7bf25a9b36d841d7cd490554ae9df6fdbe0c24a707f680/fluentpython/example-code-2e/issues/43
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/23abc33981582a1e5f7bf25a9b36d841d7cd490554ae9df6fdbe0c24a707f680/fluentpython/example-code-2e/issues/43
og:image:althi. so i know that you probably know this but if there will be a 3rd edition, exapmles 19-13 and 19-12 (and other examples in chapter 19) need a rework. e.g the mentioned examples actually fail to ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameamirreza8002
hostnamegithub.com
expected-hostnamegithub.com
None721764876e433c894814212f8100f6610f1dde78a987acc2e385d8be8e170e9c
turbo-cache-controlno-preview
go-importgithub.com/fluentpython/example-code-2e git https://github.com/fluentpython/example-code-2e.git
octolytics-dimension-user_id9216311
octolytics-dimension-user_loginfluentpython
octolytics-dimension-repository_id176997413
octolytics-dimension-repository_nwofluentpython/example-code-2e
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id176997413
octolytics-dimension-repository_network_root_nwofluentpython/example-code-2e
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
release6ff3d08f4ee1c3f89ebedf4df8fc8fe851190294
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/fluentpython/example-code-2e/issues/43#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Ffluentpython%2Fexample-code-2e%2Fissues%2F43
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%2Ffluentpython%2Fexample-code-2e%2Fissues%2F43
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%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=fluentpython%2Fexample-code-2e
Reloadhttps://github.com/fluentpython/example-code-2e/issues/43
Reloadhttps://github.com/fluentpython/example-code-2e/issues/43
Reloadhttps://github.com/fluentpython/example-code-2e/issues/43
fluentpython https://github.com/fluentpython
example-code-2ehttps://github.com/fluentpython/example-code-2e
Notifications https://github.com/login?return_to=%2Ffluentpython%2Fexample-code-2e
Fork 1.1k https://github.com/login?return_to=%2Ffluentpython%2Fexample-code-2e
Star 3.9k https://github.com/login?return_to=%2Ffluentpython%2Fexample-code-2e
Code https://github.com/fluentpython/example-code-2e
Issues 13 https://github.com/fluentpython/example-code-2e/issues
Pull requests 9 https://github.com/fluentpython/example-code-2e/pulls
Actions https://github.com/fluentpython/example-code-2e/actions
Projects 0 https://github.com/fluentpython/example-code-2e/projects
Security Uh oh! There was an error while loading. Please reload this page. https://github.com/fluentpython/example-code-2e/security
Please reload this pagehttps://github.com/fluentpython/example-code-2e/issues/43
Insights https://github.com/fluentpython/example-code-2e/pulse
Code https://github.com/fluentpython/example-code-2e
Issues https://github.com/fluentpython/example-code-2e/issues
Pull requests https://github.com/fluentpython/example-code-2e/pulls
Actions https://github.com/fluentpython/example-code-2e/actions
Projects https://github.com/fluentpython/example-code-2e/projects
Security https://github.com/fluentpython/example-code-2e/security
Insights https://github.com/fluentpython/example-code-2e/pulse
New issuehttps://github.com/login?return_to=https://github.com/fluentpython/example-code-2e/issues/43
New issuehttps://github.com/login?return_to=https://github.com/fluentpython/example-code-2e/issues/43
concurrency exampleshttps://github.com/fluentpython/example-code-2e/issues/43#top
https://github.com/amirreza8002
https://github.com/amirreza8002
amirreza8002https://github.com/amirreza8002
on Apr 10, 2024https://github.com/fluentpython/example-code-2e/issues/43#issue-2236552600
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.