Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Runtime Performance Optimization#207

Merged
kateinoigakukun merged 20 commits into
mainswiftwasm/JavaScriptKit:mainfrom
katei/perf-optswiftwasm/JavaScriptKit:katei/perf-optCopy head branch name to clipboard
Aug 18, 2022
Merged

Runtime Performance Optimization#207
kateinoigakukun merged 20 commits into
mainswiftwasm/JavaScriptKit:mainfrom
katei/perf-optswiftwasm/JavaScriptKit:katei/perf-optCopy head branch name to clipboard

Conversation

@kateinoigakukun

@kateinoigakukun kateinoigakukun commented Aug 16, 2022

Copy link
Copy Markdown
Member
  • Reduce unnecessary calls of memory and dataView getter in runtime TS code
  • Promote result pointer to return value to reduce memory operations
  • Reduce Swift ARC retain/release operations by:
    • Reduce Optional wrapper
    • Reduce reference escapes
  • Add fast paths for empty arguments call

@github-actions

github-actions Bot commented Aug 16, 2022

Copy link
Copy Markdown

Time Change: -3,602ms (19%) 👏

Total Time: 18,757ms

Test name Duration Change
Serialization/Call JavaScript function directly 4ms +1ms ⚠️
Serialization/Assign JavaScript number directly 5ms +2ms (37%) 🚨
Serialization/Call with JavaScript number directly 5ms -1ms 👏
Serialization/Write JavaScript string directly 4ms +2ms (37%) 🚨
Serialization/JavaScript function call from Swift 195ms -464ms (238%) 🏆
Serialization/Swift Int to JavaScript with call 1,536ms -1,056ms (68%) 🏆
Serialization/JavaScript Number to Swift Int 468ms -221ms (47%) 🎉
Serialization/Swift String to JavaScript with call 1,673ms -1,051ms (62%) 🏆
Object heap/Increment and decrement RC 7,844ms -512ms (6%)
View Unchanged
Test name Duration Change
Serialization/Call with JavaScript string directly 3ms -0ms
Serialization/JavaScript function call through Wasm import 25ms +0ms
Serialization/JavaScript function call through Wasm import with int 20ms +0ms
Serialization/Swift Int to JavaScript with assignment 421ms -14ms (3%)
Serialization/Swift String to JavaScript with assignment 488ms -15ms (3%)
Serialization/JavaScript String to Swift String 6,067ms -272ms (4%)

Comment thread Runtime/src/index.ts Outdated
@kateinoigakukun kateinoigakukun marked this pull request as ready for review August 18, 2022 10:58
@kateinoigakukun kateinoigakukun requested a review from a team August 18, 2022 10:58
Comment thread Runtime/src/index.ts Outdated

@MaxDesiatov MaxDesiatov left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fantastic work, these are very impressive improvements! 👏

I only have a couple of suggestions for improving doc comments, but otherwise this LGTM.

Comment thread Runtime/src/index.ts
Comment thread Runtime/src/js-value.ts Outdated
Comment thread Sources/_CJavaScriptKit/include/_CJavaScriptKit.h Outdated
Comment thread Sources/_CJavaScriptKit/include/_CJavaScriptKit.h Outdated
Comment thread Sources/_CJavaScriptKit/include/_CJavaScriptKit.h Outdated
Comment thread Sources/_CJavaScriptKit/include/_CJavaScriptKit.h Outdated
Comment thread Sources/_CJavaScriptKit/include/_CJavaScriptKit.h Outdated
@kateinoigakukun kateinoigakukun merged commit 1afbfaf into main Aug 18, 2022
@kateinoigakukun kateinoigakukun deleted the katei/perf-opt branch August 18, 2022 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.