flatten: use loop and ArrayDeque instead of recursion#1801
Conversation
|
Could run some benchmark test to try to ensure we don't reproduce the same @hoc081098 ? 🙏 |
Yes, I will add it 😊 |
|
@arnaudgiuliani I have added some benchmarks.
Could you check it again 🙏 ? |
| } | ||
|
|
||
| @OptIn(KoinInternalApi::class) | ||
| internal fun newFlatten(modules: List<Module>): Set<Module> { |
There was a problem hiding this comment.
Out of curiosity: can't you use the original function here instead of duplicating it?
|
Good work. I need to redirect it on 3.6 branch ... will do a merge from main to 3.6 |
|
macos tests are fixed in another branch |
|
@arnaudgiuliani Should I change target branch to 3.6? |
|
:pray |
|
@arnaudgiuliani please review it again 🙏 |
…081098-patch-1
|
@hoc081098 The optimization is really great but we have an issue as, the returned result can randomly not be in the same order as the module list. flatten(m1, m2) can result in <m1,m2> or <m1,m2> which is breaking capacity to overload a definition, given the module order |
|
|
@arnaudgiuliani |
|
I think so, linkedhashmap is better than not.
Vào 9:22 Th 6, 5 thg 4, 2024 Petrus Nguyễn Thái Học <
***@***.***> đã viết:
… DefinitionOverrideTest is failing on branch 3.6.0
I think because I have used HashMap, I will create a PR to fix it
—
Reply to this email directly, view it on GitHub
<#1801 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AMNXWG25SEWZA6WWKEECBIDY3YDIFAVCNFSM6AAAAABEBBFOQ2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMZYGY2DAOJUGY>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
|
|
@arnaudgiuliani please review PR #1841. |
maybe fix #1794