Title: Idea for x5 optimization for functions that return classes, objects or small arrays · Issue #997 · AssemblyScript/assemblyscript · GitHub
Open Graph Title: Idea for x5 optimization for functions that return classes, objects or small arrays · Issue #997 · AssemblyScript/assemblyscript
X Title: Idea for x5 optimization for functions that return classes, objects or small arrays · Issue #997 · AssemblyScript/assemblyscript
Description: I noticed that when we create a functions that return Class, Objects or small Array performance become worse than in JS. I was curious why this happens and created a new version of my code and get x7 boost in performance for f64 struct. ...
Open Graph Description: I noticed that when we create a functions that return Class, Objects or small Array performance become worse than in JS. I was curious why this happens and created a new version of my code and get ...
X Description: I noticed that when we create a functions that return Class, Objects or small Array performance become worse than in JS. I was curious why this happens and created a new version of my code and get ...
Opengraph URL: https://github.com/AssemblyScript/assemblyscript/issues/997
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Idea for x5 optimization for functions that return classes, objects or small arrays","articleBody":"I noticed that when we create a functions that return Class, Objects or small Array performance become worse than in JS. I was curious why this happens and created a new version of my code and get x7 boost in performance for f64 struct. It can be little bit optimistic because I have too simple structure.\r\n\r\nThe idea:\r\n\r\nWhen you compile a code it often allocated objects with the same Shapes. It can be a Points, some Tuples or general Objects. All is ok when you create it once or twice in your code, but it can be huge problem when you run this code in loop.\r\n\r\nSo we can allocate only once a relatively big Turing tape with this objects. And when we invoke a function that return objects with this shapes, we can pass a new index from tape in which we can store result object.\r\n\r\nAlso we can notice that we can reuse space in this tape for different function scopes. Here a lot of room for your imagination how to do this. For example all methods in one class can have only one temporary cache and another cache for another functions.\r\n\r\nSource code:\r\n[before](https://pastebin.com/h3eVzdub), [after](https://github.com/munrocket/double.js/blob/master/wasm/mandel.ts)\r\n\r\nPicture with [results](https://munrocket.github.io/double.js/docs/benchmark.html):\r\n\r\n","author":{"url":"https://github.com/munrocket","@type":"Person","name":"munrocket"},"datePublished":"2019-12-07T18:28:04Z","url":"https://github.com/AssemblyScript/assemblyscript/issues/997"}
| 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:1c80e79d-0b8f-18f9-664e-bf32a3eb9441 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | EA44:2EC689:2CB6403:3D100F6:6B005C8D |
| html-safe-nonce | 838a9619147ee1e39c18069c7598014ab9b84660f46e3fb2ecd37c67d76b982f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQTQ0OjJFQzY4OToyQ0I2NDAzOjNEMTAwRjY6NkIwMDVDOEQiLCJ2aXNpdG9yX2lkIjoiMzcyNDMzODg0MDQ5Njc5MDY2OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 7ab3bfe3fcde5ca0193366ba1e3c6395f86961ec4cb826d2ff462d1a88ab2c41 |
| hovercard-subject-tag | issue:534435400 |
| 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/AssemblyScript/assemblyscript/997/issue_layout |
| twitter:image | https://opengraph.githubassets.com/56895a510e26d979ce233e31efc84fc0c03105c0b2f940555587c958b303114f/AssemblyScript/assemblyscript/issues/997 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/56895a510e26d979ce233e31efc84fc0c03105c0b2f940555587c958b303114f/AssemblyScript/assemblyscript/issues/997 |
| og:image:alt | I noticed that when we create a functions that return Class, Objects or small Array performance become worse than in JS. I was curious why this happens and created a new version of my code and get ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | munrocket |
| hostname | github.com |
| expected-hostname | github.com |
| None | 29be975efff6507a5d135de9c7d634cf7ff8f0c55222a64386ab3202209aaf73 |
| turbo-cache-control | no-preview |
| go-import | github.com/AssemblyScript/assemblyscript git https://github.com/AssemblyScript/assemblyscript.git |
| octolytics-dimension-user_id | 28916798 |
| octolytics-dimension-user_login | AssemblyScript |
| octolytics-dimension-repository_id | 105138356 |
| octolytics-dimension-repository_nwo | AssemblyScript/assemblyscript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 105138356 |
| octolytics-dimension-repository_network_root_nwo | AssemblyScript/assemblyscript |
| 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 | eacd927ba6112e3b01ba99c762bd699a4a4f5df7 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width