Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Use toArray instead of toTypedArray in ArrayDeque#5467

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
MukjepScarlet wants to merge1 commit intoJetBrains:master
base:master
Choose a base branch
Loading
fromMukjepScarlet:patch-2

Conversation

MukjepScarlet
Copy link

toArray is much faster thantoTypedArray on JVM. And we don't need a typed array here.

`toArray` is much faster than `toTypedArray` on JVM. And we don't need a typed array here.
@fzhinkin
Copy link
Contributor

There's no publicCollection.toArray function, so the stdlib won't compile after applying the suggested change.

Please make sure that code compiles and tests pass (you can execute thecoreLibsTest Gradle task for that) before opening a PR.

Performance-related changes, in general, have to be accompanied by benchmarks showing performance difference before and after changes. For changes affecting multiple targets, performance needs to be evaluated for all these targets.

MukjepScarlet and jisungbin reacted with thumbs up emoji

@MukjepScarletMukjepScarlet changed the titleuse toArray instead of toTypedArray in ArrayDequeUse toArray instead of toTypedArray in ArrayDequeJun 23, 2025
@MukjepScarlet
Copy link
Author

@fzhinkin Hi! I have a problem on this. Because theArrayDeque is declared in common module, so I can't implement JVM-only functions (liketoArray here) in it. Is it possible to make platform-specific implementation for classes declared in common module, while it might not exist on other platforms?

@MukjepScarletMukjepScarlet marked this pull request as draftJuly 11, 2025 08:04
@fzhinkin
Copy link
Contributor

@MukjepScarlet, in theory, you can introduce an expect function and actualize it differently depending on a platform. But before doing that, it worth ensuring that all these efforts would actually result in a better performance (by writing and running benchmarks).

MukjepScarlet reacted with thumbs up emoji

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@qwwdfsadqwwdfsadAwaiting requested review from qwwdfsadqwwdfsad is a code owner

@ilya-gilya-gAwaiting requested review from ilya-gilya-g is a code owner

@fzhinkinfzhinkinAwaiting requested review from fzhinkinfzhinkin is a code owner

At least 1 approving review is required to merge this pull request.

Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@MukjepScarlet@fzhinkin

[8]ページ先頭

©2009-2025 Movatter.jp