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

chore: add benchmark case for horizontal coedges #521

Conversation

cwangbh
Copy link
Contributor

@cwangbh cwangbh commented May 9, 2023

Hi Angus,

Hope it's been going well for you lately.
Recently in my use case, i found one specific case that is very time consuming, it has many horizontal coedges and looks like the following image:
input_coedge_2023-05-09_18-35-38

I have extended the coedge numbers and wrote a simple benchmark file in the pull request. The runtime is approximately to be O(N^2) as I increase the horizontal coedge numbers.
benchmark_result_2023-05-09_18-29-35

Through profiling, i found most time is spent on the following two functions:
Clipper2Lib::GetMaximaPair
Clipper2Lib::IsValidAelOrder

It seems that this is related to the internal data structure linked list and the search time is O(N). Do you have any suggestions on how to improve this runtime?

@AngusJohnson
Copy link
Owner

AngusJohnson commented May 10, 2023

Thanks. I certainly appreciate the feedback. I'm currently occupied with other things, but hope to look at this in the next day or two. Nevertheless I'd be surprised if I can make GetMaximaPair() or IsValidAelOrder() significantly faster, but of course I'd welcome suggestions there too.

@Misa-sudo-coder
Copy link

What the heck is going on here?

@cwangbh cwangbh closed this May 13, 2023
@cwangbh cwangbh deleted the improve_performance_of_horizontal_coedge branch May 24, 2023 07:15
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.

None yet

3 participants