René's URL Explorer Experiment


Title: Potential performance improvements? · Issue #1842 · plotly/plotly.py · GitHub

Open Graph Title: Potential performance improvements? · Issue #1842 · plotly/plotly.py

X Title: Potential performance improvements? · Issue #1842 · plotly/plotly.py

Description: I have profiled a simple heatmap here: profile_code.py from werkzeug.contrib.profiler import ProfilerMiddleware from app import server server.config['PROFILE'] = True server.wsgi_app = ProfilerMiddleware(server.wsgi_app, restrictions=[30...

Open Graph Description: I have profiled a simple heatmap here: profile_code.py from werkzeug.contrib.profiler import ProfilerMiddleware from app import server server.config['PROFILE'] = True server.wsgi_app = ProfilerMidd...

X Description: I have profiled a simple heatmap here: profile_code.py from werkzeug.contrib.profiler import ProfilerMiddleware from app import server server.config['PROFILE'] = True server.wsgi_app = Prof...

Opengraph URL: https://github.com/plotly/plotly.py/issues/1842

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Potential performance improvements?","articleBody":"I have profiled a simple heatmap here:\r\n\r\n**profile_code.py**\r\n```python\r\nfrom werkzeug.contrib.profiler import ProfilerMiddleware\r\nfrom app import server\r\n\r\nserver.config['PROFILE'] = True\r\nserver.wsgi_app = ProfilerMiddleware(server.wsgi_app, restrictions=[30])\r\nserver.run(debug = True)\r\n```\r\n\r\n**app.py**\r\n```python\r\nimport numpy as np\r\n\r\nimport dash\r\nimport dash_core_components as dcc\r\nimport dash_html_components as html\r\nimport plotly.graph_objects as go\r\n\r\nimport flask\r\n\r\n# Heatmap\r\nZ = np.random.rand(1000,1000)\r\n\r\nserver = flask.Flask(__name__)\r\napp = dash.Dash(__name__, server=server)\r\n\r\napp.layout = html.Div(children=[\r\n    dcc.Graph(\r\n        id='example-graph',\r\n        figure=dict(\r\n\t\t\tdata=[go.Heatmap(\r\n\t\t\t\tz=Z\r\n\t\t\t)],\r\n\t\t\tlayout=dict()\r\n\t\t)\r\n    )\r\n])\r\n```\r\n\r\nResult (Python 3.7 Windows):\r\n```\r\n         1068 function calls (1060 primitive calls) in 4.032 seconds\r\n\r\n   Ordered by: cumulative time\r\n   List reduced from 243 to 30 due to restriction \u003c30>\r\n\r\n   ncalls  tottime  percall  cumtime  percall filename:lineno(function)\r\n        1    0.000    0.000    4.032    4.032 C:\\Python37-32\\lib\\site-packages\\werkzeug\\contrib\\profiler.py:95(runapp)\r\n        1    0.000    0.000    4.032    4.032 C:\\Python37-32\\lib\\site-packages\\flask\\app.py:2262(wsgi_app)\r\n        1    0.000    0.000    4.032    4.032 C:\\Python37-32\\lib\\site-packages\\flask\\app.py:1801(full_dispatch_request)\r\n        1    0.000    0.000    2.473    2.473 C:\\Python37-32\\lib\\site-packages\\flask\\app.py:1779(dispatch_request)\r\n        1    0.002    0.002    2.472    2.472 C:\\Python37-32\\lib\\site-packages\\dash\\dash.py:467(serve_layout)\r\n      2/1    0.013    0.006    2.462    2.462 C:\\Python37-32\\lib\\json\\__init__.py:183(dumps)\r\n        1    0.002    0.002    2.451    2.451 C:\\Python37-32\\lib\\site-packages\\_plotly_utils\\utils.py:35(encode)\r\n        2    0.000    0.000    1.995    0.998 C:\\Python37-32\\lib\\json\\encoder.py:182(encode)\r\n        2    1.856    0.928    1.980    0.990 C:\\Python37-32\\lib\\json\\encoder.py:204(iterencode)\r\n        1    0.000    0.000    1.559    1.559 C:\\Python37-32\\lib\\site-packages\\flask\\app.py:1818(finalize_request)\r\n        1    0.000    0.000    1.559    1.559 C:\\Python37-32\\lib\\site-packages\\flask\\app.py:2091(process_response)\r\n        1    0.000    0.000    1.559    1.559 C:\\Python37-32\\lib\\site-packages\\flask_compress.py:78(after_request)\r\n        1    0.000    0.000    1.557    1.557 C:\\Python37-32\\lib\\site-packages\\flask_compress.py:113(compress)\r\n        1    0.001    0.001    1.553    1.553 C:\\Python37-32\\lib\\gzip.py:247(write)\r\n        1    1.535    1.535    1.535    1.535 {method 'compress' of 'zlib.Compress' objects}\r\n        1    0.000    0.000    0.452    0.452 C:\\Python37-32\\lib\\json\\__init__.py:299(loads)\r\n        1    0.000    0.000    0.452    0.452 C:\\Python37-32\\lib\\json\\decoder.py:332(decode)\r\n        1    0.452    0.452    0.452    0.452 C:\\Python37-32\\lib\\json\\decoder.py:343(raw_decode)\r\n        4    0.000    0.000    0.124    0.031 C:\\Python37-32\\lib\\site-packages\\_plotly_utils\\utils.py:66(default)\r\n        1    0.000    0.000    0.093    0.093 C:\\Python37-32\\lib\\site-packages\\_plotly_utils\\utils.py:123(encode_as_list)\r\n        1    0.093    0.093    0.093    0.093 {method 'tolist' of 'numpy.ndarray' objects}\r\n        1    0.000    0.000    0.017    0.017 C:\\Python37-32\\lib\\site-packages\\_plotly_utils\\utils.py:131(encode_as_sage)\r\n        3    0.000    0.000    0.017    0.006 C:\\Python37-32\\lib\\site-packages\\_plotly_utils\\optional_imports.py:15(get_module)\r\n        1    0.000    0.000    0.016    0.016 C:\\Python37-32\\lib\\importlib\\__init__.py:109(import_module)\r\n      2/1    0.000    0.000    0.016    0.016 \u003cfrozen importlib._bootstrap>:994(_gcd_import)\r\n      2/1    0.000    0.000    0.016    0.016 \u003cfrozen importlib._bootstrap>:978(_find_and_load)\r\n      2/1    0.000    0.000    0.016    0.016 \u003cfrozen importlib._bootstrap>:948(_find_and_load_unlocked)\r\n        1    0.000    0.000    0.016    0.016 \u003cfrozen importlib._bootstrap>:211(_call_with_frames_removed)\r\n        1    0.000    0.000    0.016    0.016 \u003cfrozen importlib._bootstrap>:882(_find_spec)\r\n        1    0.000    0.000    0.016    0.016 \u003cfrozen importlib._bootstrap_external>:1272(find_spec)\r\n```\r\n\r\nResult with Phython 2.7 linux are almost identical\r\n\r\nLooking through the profiling it looks like the main causes is creating the JSON, with\r\n`C:\\Python37-32\\lib\\site-packages\\_plotly_utils\\utils.py` taking 2.45s out of a total of 4s.\r\nI know that orjson (only Python 3) can be faster than Python's default JSON. Would you expect that changing to orjson would improve performance / be possible to implement?\r\n\r\nThanks for any insight.","author":{"url":"https://github.com/pfbuxton","@type":"Person","name":"pfbuxton"},"datePublished":"2019-10-22T14:43:58Z","url":"https://github.com/plotly/plotly.py/issues/1842"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:08f6e083-1bed-61f6-e818-35ae37a4ac87
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idCF68:280A2E:4F0D9B:678756:6B017769
html-safe-nonce03aad11af7def99771669af351b3bf24313e1fb1b63d327e81de22cc36f812d1
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRjY4OjI4MEEyRTo0RjBEOUI6Njc4NzU2OjZCMDE3NzY5IiwidmlzaXRvcl9pZCI6IjgzMTA3MjcwMjQ4MDk0NDExMjkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac2c5b4cf43d5af90190d8012ad85c36e733897146b9d155f8df0bf2452e2444f9
hovercard-subject-tagissue:510706165
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/plotly/plotly.py/1842/issue_layout
twitter:imagehttps://opengraph.githubassets.com/01b9d8dce746d24ceb9e08153c4cefe3d0f7dc668a3cce66fe892674f60672a9/plotly/plotly.py/issues/1842
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/01b9d8dce746d24ceb9e08153c4cefe3d0f7dc668a3cce66fe892674f60672a9/plotly/plotly.py/issues/1842
og:image:altI have profiled a simple heatmap here: profile_code.py from werkzeug.contrib.profiler import ProfilerMiddleware from app import server server.config['PROFILE'] = True server.wsgi_app = ProfilerMidd...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamepfbuxton
hostnamegithub.com
expected-hostnamegithub.com
Nonecc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c
turbo-cache-controlno-preview
go-importgithub.com/plotly/plotly.py git https://github.com/plotly/plotly.py.git
octolytics-dimension-user_id5997976
octolytics-dimension-user_loginplotly
octolytics-dimension-repository_id14579099
octolytics-dimension-repository_nwoplotly/plotly.py
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id14579099
octolytics-dimension-repository_network_root_nwoplotly/plotly.py
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
release8c77c9e8439031ad54c75a250694842892f693e1
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/plotly/plotly.py/issues/1842#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fplotly%2Fplotly.py%2Fissues%2F1842
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%2Fplotly%2Fplotly.py%2Fissues%2F1842
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=plotly%2Fplotly.py
Reloadhttps://github.com/plotly/plotly.py/issues/1842
Reloadhttps://github.com/plotly/plotly.py/issues/1842
Reloadhttps://github.com/plotly/plotly.py/issues/1842
plotlyhttps://github.com/plotly
plotly.pyhttps://github.com/plotly/plotly.py
Codehttps://github.com/plotly/plotly.py
Issues650 (650)https://github.com/plotly/plotly.py/issues
Pull requests83 (83)https://github.com/plotly/plotly.py/pulls
Actionshttps://github.com/plotly/plotly.py/actions
Security and qualityhttps://github.com/plotly/plotly.py/security
Insightshttps://github.com/plotly/plotly.py/insights
https://github.com/plotly/plotly.py
New issuehttps://github.com/login?return_to=https://github.com/plotly/plotly.py/issues/1842
New issuehttps://github.com/login?return_to=https://github.com/plotly/plotly.py/issues/1842
Potential performance improvements?https://github.com/plotly/plotly.py/issues/1842#top
upcominghttps://github.com/plotly/plotly.py/milestone/30
https://github.com/pfbuxton
pfbuxtonhttps://github.com/pfbuxton
on Oct 22, 2019https://github.com/plotly/plotly.py/issues/1842#issue-510706165
https://github.com/pfbuxton
pfbuxtonhttps://github.com/pfbuxton
on Oct 22, 2019https://github.com/plotly/plotly.py/issues/1842#issuecomment-545045398
plotly.py/packages/python/plotly/_plotly_utils/utils.pyhttps://github.com/plotly/plotly.py/blob/4a63c3a6a7de9b56336c2b27b9d121fc27b1d4bb/packages/python/plotly/_plotly_utils/utils.py#L35-L64
4a63c3ahttps://github.com/plotly/plotly.py/commit/4a63c3a6a7de9b56336c2b27b9d121fc27b1d4bb
https://github.com/pfbuxton
pfbuxtonhttps://github.com/pfbuxton
on Nov 4, 2019https://github.com/plotly/plotly.py/issues/1842#issuecomment-549401190
nicolaskruchtenhttps://github.com/nicolaskruchten
v4.xhttps://github.com/plotly/plotly.py/milestone/30
on Nov 17, 2020https://github.com/plotly/plotly.py/issues/1842#event-4005374451
https://github.com/gvwilson
gvwilsonhttps://github.com/gvwilson
on Jun 18, 2024https://github.com/plotly/plotly.py/issues/1842#issuecomment-2176482715
@gvwilsonhttps://github.com/gvwilson
gvwilsonhttps://github.com/gvwilson
completedhttps://github.com/plotly/plotly.py/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Jun 18, 2024https://github.com/plotly/plotly.py/issues/1842#event-13203588994
Sign up for freehttps://github.com/signup?return_to=https://github.com/plotly/plotly.py/issues/1842
Sign in to commenthttps://github.com/login?return_to=https://github.com/plotly/plotly.py/issues/1842
upcomingNo due datehttps://github.com/plotly/plotly.py/milestone/30
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.