Title: Common subexpression elimination · Issue #687 · purescript/purescript · GitHub
Open Graph Title: Common subexpression elimination · Issue #687 · purescript/purescript
X Title: Common subexpression elimination · Issue #687 · purescript/purescript
Description: This would need some thinking about, but it'd be really nice if we could improve the likes of this: var ap = function (__dict_Monad_14) { return function (f) { return function (a) { return $greater$greater$eq(__dict_Monad_14["__superclas...
Open Graph Description: This would need some thinking about, but it'd be really nice if we could improve the likes of this: var ap = function (__dict_Monad_14) { return function (f) { return function (a) { return $greater...
X Description: This would need some thinking about, but it'd be really nice if we could improve the likes of this: var ap = function (__dict_Monad_14) { return function (f) { return function (a) { return $gre...
Opengraph URL: https://github.com/purescript/purescript/issues/687
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Common subexpression elimination","articleBody":"This would need some thinking about, but it'd be really nice if we could improve the likes of this:\n\n``` js\nvar ap = function (__dict_Monad_14) {\n return function (f) {\n return function (a) {\n return $greater$greater$eq(__dict_Monad_14[\"__superclass_Prelude.Bind_1\"]())(f)(function (_2) {\n return $greater$greater$eq(__dict_Monad_14[\"__superclass_Prelude.Bind_1\"]())(a)(function (_1) {\n return $$return(__dict_Monad_14)(_2(_1));\n });\n });\n };\n };\n};\n```\n\ninto something like this:\n\n``` js\nvar ap = function (__dict_Monad_14) {\n var __dict_Monad_14_Bind = __dict_Monad_14[\"__superclass_Prelude.Bind_1\"]()\n var $greater$greater$eq_1 = $greater$greater$eq(__dict_Monad_14_Bind);\n var $$return_1 = $$return(__dict_Monad_14);\n return function (f) {\n return function (a) {\n return $greater$greater$eq_1(f)(function (_2) {\n return $greater$greater$eq_1(a)(function (_1) {\n return $$return_1(_2(_1));\n });\n });\n };\n };\n};\n```\n\n(Essentially declaring all instance related members and superclass instances as local variables as soon as is possible.)\n\nApart from improving readability somewhat, using the local `$greater$greater$eq_1` over `$greater$greater$eq(__dict_Monad_14[\"__superclass_Prelude.Bind_1\"]())` everywhere should add up to a nice performance boost too. Most of optimisations I worked on for instances were to make constructing instances cheaper as they were the largest overhead, if we can reduce the number of constructions that's even better!\n","author":{"url":"https://github.com/garyb","@type":"Person","name":"garyb"},"datePublished":"2014-11-07T12:17:04Z","url":"https://github.com/purescript/purescript/issues/687"}
| react-profiling | 0 |
| react-import-map | react,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-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:d36a62b4-423e-857b-239f-e579219d7e74 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 99FC:29FFA9:3A73EF:4B67CE:6B00D2CC |
| html-safe-nonce | 1b62c51f7f96b4391cfbcad9507897942cae5285586a46f1e5084c6c91ef7761 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5OUZDOjI5RkZBOTozQTczRUY6NEI2N0NFOjZCMDBEMkNDIiwidmlzaXRvcl9pZCI6IjM4MjcwNDQ2NTk3MzQwNDEyOTIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | ead2bf7a721d51592ea961984015a4f2d2872723e5fd16f2a80690acc1cd9e93 |
| hovercard-subject-tag | issue:48075980 |
| 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/purescript/purescript/687/issue_layout |
| twitter:image | https://opengraph.githubassets.com/dc87902afc60e90929e416ff28313110d9c8b934278cb93b4f1cd8225da1ccbc/purescript/purescript/issues/687 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/dc87902afc60e90929e416ff28313110d9c8b934278cb93b4f1cd8225da1ccbc/purescript/purescript/issues/687 |
| og:image:alt | This would need some thinking about, but it'd be really nice if we could improve the likes of this: var ap = function (__dict_Monad_14) { return function (f) { return function (a) { return $greater... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | garyb |
| hostname | github.com |
| expected-hostname | github.com |
| None | 85bbdfe2b6ba16e234513bc6ceff5d848ef8449820c900692a2b4e67061931e5 |
| turbo-cache-control | no-preview |
| go-import | github.com/purescript/purescript git https://github.com/purescript/purescript.git |
| octolytics-dimension-user_id | 6556677 |
| octolytics-dimension-user_login | purescript |
| octolytics-dimension-repository_id | 13206906 |
| octolytics-dimension-repository_nwo | purescript/purescript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 13206906 |
| octolytics-dimension-repository_network_root_nwo | purescript/purescript |
| 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 | 4943239a6d2c591325dad6e5c313e1cafda877f6 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width