Title: Reuse stack states during decoding to optimize GC load by sergeyzenchenko · Pull Request #228 · msgpack/msgpack-javascript · GitHub
Open Graph Title: Reuse stack states during decoding to optimize GC load by sergeyzenchenko · Pull Request #228 · msgpack/msgpack-javascript
X Title: Reuse stack states during decoding to optimize GC load by sergeyzenchenko · Pull Request #228 · msgpack/msgpack-javascript
Description: hey @gfx found optimisation that I've missed somehow 2 years ago :D StackStates are constantly being created for each array or map parsed. If for example we parse array with 10k objects inside, it will allocate 10001 stack states, but in reality we only need 2 allocations. Max amount of allocation equals the max depth of nested objects/arrays inside on payload. I've run msgpack benchmark, but it didn't show any large improvements. But I think these tests can't show it because they are very short living and GC have no time to kick off. Change is simple and can have meaningful impact of apps processing large amount of data. Also unified stack state object creation with fields from both types created in one place should have impact on V8 optimisation pipeline, because now each object will have the same shape.
Open Graph Description: hey @gfx found optimisation that I've missed somehow 2 years ago :D StackStates are constantly being created for each array or map parsed. If for example we parse array with 10k objects inside,...
X Description: hey @gfx found optimisation that I've missed somehow 2 years ago :D StackStates are constantly being created for each array or map parsed. If for example we parse array with 10k objects ins...
Opengraph URL: https://github.com/msgpack/msgpack-javascript/pull/228
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:65885304-6e47-a3ed-d522-d345532c5bac |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | E502:2BA57F:2D48775:3DFA276:6A549BD9 |
| html-safe-nonce | f3cbf8a8da5bd9dc504424711b3a237082a4e1cc1b0cccc6e297cf9f0017e11f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNTAyOjJCQTU3RjoyRDQ4Nzc1OjNERkEyNzY6NkE1NDlCRDkiLCJ2aXNpdG9yX2lkIjoiODMxNTU1ODc2ODUxNjgzMjIxNyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 2d8732851e54600ca359b7b50bf2c488c8ec20f4c43796dad047ad692afec16f |
| hovercard-subject-tag | pull_request:1330148085 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,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/msgpack/msgpack-javascript/pull/228/files |
| twitter:image | https://avatars.githubusercontent.com/u/81555?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/81555?s=400&v=4 |
| og:image:alt | hey @gfx found optimisation that I've missed somehow 2 years ago :D StackStates are constantly being created for each array or map parsed. If for example we parse array with 10k objects inside,... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/msgpack/msgpack-javascript git https://github.com/msgpack/msgpack-javascript.git |
| octolytics-dimension-user_id | 198264 |
| octolytics-dimension-user_login | msgpack |
| octolytics-dimension-repository_id | 2761854 |
| octolytics-dimension-repository_nwo | msgpack/msgpack-javascript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 2761854 |
| octolytics-dimension-repository_network_root_nwo | msgpack/msgpack-javascript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | f8cfff6384f62259baea531c7f58bc7040f8dd92 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width