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

optimize: make mntinfo_add_list O(1) by adding a tail pointer #2584

Conversation

ankushT369
Copy link

The mntinfo_add_list function previously traversed the entire linked list to find the tail node, resulting in a time complexity of O(n). This commit introduces a mntinfo_tail pointer to track the last node of the list, reducing the time complexity of insertion to O(1).

This change addresses the FIXME comment in the code and improves performance for large lists.

@ankushT369 ankushT369 force-pushed the optimize-mntinfo-add-list branch from 747a9eb to 1094c7a Compare February 4, 2025 20:08
@ankushT369
Copy link
Author

Could someone please review this PR? If there are any issues, could you kindly point them out and suggest how I can resolve them?

@adrianreber
Copy link
Member

If you look at the output of the CI runs you can see that all mount related tests are now failing.

@ankushT369 ankushT369 closed this by deleting the head repository Feb 5, 2025
@ankushT369
Copy link
Author

Thankyou for replying @adrianreber yea I am getting some mount related test failing. But in my system it worked fine and tests are passed. How will I know about other systems and rectify that according to that (apologies if it's a very beginner type question I am new to this).

@adrianreber
Copy link
Member

Good to heat that tests are passing on your system, but make sure they also work in our different CI setups.

How will I know about other systems

Just have a look what is running in CI

and rectify that according to that

Unfortunately I do not know. Maybe use a container to reproduce the different setups we have in CI.

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