Title: Improve ReactPy Performance · Issue #557 · reactive-python/reactpy · GitHub
Open Graph Title: Improve ReactPy Performance · Issue #557 · reactive-python/reactpy
X Title: Improve ReactPy Performance · Issue #557 · reactive-python/reactpy
Description: Proposed Changes Find the hot spots in ReactPy's code-base in order to identify where attention should be focused. Once we know this, we will be able to focus our efforts on performance improvements. Implementation Details Analysis Use Y...
Open Graph Description: Proposed Changes Find the hot spots in ReactPy's code-base in order to identify where attention should be focused. Once we know this, we will be able to focus our efforts on performance improvement...
X Description: Proposed Changes Find the hot spots in ReactPy's code-base in order to identify where attention should be focused. Once we know this, we will be able to focus our efforts on performance improve...
Opengraph URL: https://github.com/reactive-python/reactpy/issues/557
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Improve ReactPy Performance","articleBody":"# Proposed Changes\r\n\r\nFind the hot spots in ReactPy's code-base in order to identify where attention should be focused. Once we know this, we will be able to focus our efforts on performance improvements.\r\n\r\n# Implementation Details\r\n\r\n### Analysis\r\nUse [Yappi](https://github.com/sumerc/yappi) to profile ReactPy dispatchers and determine what is taking the most significant amounts of time.\r\n\r\nWe will also need to figure out how to test websocket concurrency. It seems like there are very few tools for this, especially for our applications. We're probably going to have to create out own benchmarking tools. Here's some resources we might want to read through later.\r\n- https://healeycodes.com/websocket-benchmarker\r\n- https://kemalcr.com/blog/2016/11/13/benchmarking-and-scaling-websockets-handling-60000-concurrent-connections/\r\n- https://ma.ttias.be/benchmarking-websocket-server-performance-with-artillery/\r\n\r\n### Sync and Async\r\n\r\nCurrently, ReactPy relies on synchronous code to properly queue renders. Sync code is known to blocks the asyncio event loop, which causes concurrency issues.\r\n\r\nSee section \"Two Worlds of Python\" for why this is a problem:\r\nhttps://arunrocks.com/a-guide-to-asgi-in-django-30-and-its-performance/\r\n\r\nAll synchronous functions should be converted to async within ReactPy core. They could alternatively be threadpooled. See reactive-python/reactpy-django#31 for the original discussion on this.\r\n\r\n### Extreme Countermeasures\r\nIf optimizations can't be suitably performed within Python, consider writing C/C++ code exposed via Python APIs that performs the same functionality as the non-performant parts of IDOM.\r","author":{"url":"https://github.com/Archmonger","@type":"Person","name":"Archmonger"},"datePublished":"2021-12-26T09:12:17.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":6},"url":"https://github.com/557/reactpy/issues/557"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:0f89deec-7de3-1263-6c16-f8dba5792a8c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 80B0:1F2208:467E28F:60B5694:697803EF |
| html-safe-nonce | a573c1cdcaf4311193bae821f7059f816600dd3c18354b10a1c3b73174aa731a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MEIwOjFGMjIwODo0NjdFMjhGOjYwQjU2OTQ6Njk3ODAzRUYiLCJ2aXNpdG9yX2lkIjoiMzI4NTE2NTcwNDE3MjAxMjUyNyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 732a4f81f33644608f50ca9bd67a6e3dda5d38d5580aa45aef17f66854c01a21 |
| hovercard-subject-tag | issue:1088730399 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/reactive-python/reactpy/557/issue_layout |
| twitter:image | https://opengraph.githubassets.com/d706e7e6eaac5d4350cc23b82e23e35221e64233afb44f1d337fe7864b1bfc44/reactive-python/reactpy/issues/557 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/d706e7e6eaac5d4350cc23b82e23e35221e64233afb44f1d337fe7864b1bfc44/reactive-python/reactpy/issues/557 |
| og:image:alt | Proposed Changes Find the hot spots in ReactPy's code-base in order to identify where attention should be focused. Once we know this, we will be able to focus our efforts on performance improvement... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Archmonger |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9306bf4a8c8a88a5945f83e25033fc5e6fb7a05f40c5fca300ac67db7fee56ae |
| turbo-cache-control | no-preview |
| go-import | github.com/reactive-python/reactpy git https://github.com/reactive-python/reactpy.git |
| octolytics-dimension-user_id | 106191177 |
| octolytics-dimension-user_login | reactive-python |
| octolytics-dimension-repository_id | 171410703 |
| octolytics-dimension-repository_nwo | reactive-python/reactpy |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 171410703 |
| octolytics-dimension-repository_network_root_nwo | reactive-python/reactpy |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | ebcec36a0fcd90aa18ad42cdc7e8952475890ee5 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width