Skip to content

Introduce the basic Moshi benchmark setup in order to use it for further comparisons #2742

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 15, 2024

Conversation

qwwdfsad
Copy link
Member

@qwwdfsad qwwdfsad commented Jul 11, 2024

Relates to #2657

@qwwdfsad qwwdfsad requested a review from sandwwraith July 11, 2024 10:38
@qwwdfsad qwwdfsad changed the title Introduce the basis Moshi benchmark setup in order to use it for furt… Introduce the basic Moshi benchmark setup in order to use it for furt… Jul 11, 2024
@qwwdfsad qwwdfsad requested a review from shanshin July 15, 2024 09:49
@shanshin shanshin changed the title Introduce the basic Moshi benchmark setup in order to use it for furt… Introduce the basic Moshi benchmark setup in order to use it for further comparisons Jul 15, 2024
fun moshiFromString(): DefaultPixelEvent = jsonAdapter.fromJson(pixelEventJson)!!

@Benchmark
fun moshiFromSource(): DefaultPixelEvent = jsonAdapter.fromJson(source.copy())!!
Copy link
Contributor

Choose a reason for hiding this comment

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

For each iteration, we call copy(). This is not critical, because in fact, only the creation of a new instance of the Segment takes place there.

@qwwdfsad qwwdfsad merged commit af5095e into dev Jul 15, 2024
4 checks passed
@qwwdfsad qwwdfsad deleted the moshi-bench-base branch July 15, 2024 13:46
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.

2 participants