Skip to content
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

"duplicate export name" check is O(n^2) #3407

Open
yamt opened this issue May 9, 2024 · 3 comments
Open

"duplicate export name" check is O(n^2) #3407

yamt opened this issue May 9, 2024 · 3 comments
Labels
enhancement New feature or request performance

Comments

@yamt
Copy link
Collaborator

yamt commented May 9, 2024

"duplicate export name" check in load_export_section is too slow for modules with many exports.

@wenyongh
Copy link
Contributor

wenyongh commented May 9, 2024

Maybe we can create the export list first, and then sort the list by name, and then check whether the contiguous two exports have the same name, and report error if yes?

@yamt
Copy link
Collaborator Author

yamt commented May 9, 2024

Maybe we can create the export list first, and then sort the list by name, and then check whether the contiguous two exports have the same name, and report error if yes?

maybe.
for the other runtime, i do something along the line. https://github.com/yamt/toywasm/blob/115e895007bb77b12f6a632a3f4354644b236c56/lib/module.c#L2122-L2143

@wenyongh
Copy link
Contributor

wenyongh commented May 9, 2024

OK, got it, thanks.

@wenyongh wenyongh added enhancement New feature or request performance labels May 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request performance
Projects
None yet
Development

No branches or pull requests

2 participants