Skip to content

perf: use hash map for installed packages#7878

Open
calebdw wants to merge 1 commit intorectorphp:mainfrom
calebdw:calebdw/push-vwytuonwkypl
Open

perf: use hash map for installed packages#7878
calebdw wants to merge 1 commit intorectorphp:mainfrom
calebdw:calebdw/push-vwytuonwkypl

Conversation

@calebdw
Copy link
Contributor

@calebdw calebdw commented Feb 3, 2026

Hello!

We can turn a package lookup into O(1) by using a hash map instead of an O(n) with a linear array.

Thanks!

@calebdw calebdw force-pushed the calebdw/push-vwytuonwkypl branch from f924011 to 19ec4b8 Compare February 7, 2026 22:47
@calebdw calebdw force-pushed the calebdw/push-vwytuonwkypl branch from 19ec4b8 to 4d4a674 Compare March 26, 2026 12:42
@calebdw
Copy link
Contributor Author

calebdw commented Mar 26, 2026

@TomasVotruba, thoughts on this? The only error is because ->getName() is not used anymore, but I can ignore that

@TomasVotruba
Copy link
Member

I'll look into this. Can you remove the unused method?

We can turn a package lookup into O(1) by using a hash map instead of an
O(n) with a linear array.
@calebdw calebdw force-pushed the calebdw/push-vwytuonwkypl branch from 4d4a674 to 8f94788 Compare March 27, 2026 14:16
@calebdw
Copy link
Contributor Author

calebdw commented Mar 27, 2026

@TomasVotruba, fixed! I added @api because otherwise the name would be inaccessible from the object itself

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