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

[improvement]: reduce boot time by ~20% by removing unnecessary xml config queries #653

Open
zebastian opened this issue Mar 16, 2024 · 2 comments
Assignees
Labels
improvement support-level-core Functionality with core support level

Comments

@zebastian
Copy link

Improvement Description

cachegrind indicates that ~15-20 % of bootup time are spent in ast_xmldoc_query.
In order to do the lookups for certain options always all the loaded documentation xmls are traversed:

AST_LIST_TRAVERSE(&xmldoc_tree, doctree, entry) {
		if (!(results = ast_xml_query(doctree->doc, ast_str_buffer(xpath_str)))) {
			continue;
		}
		break;
	}

An alternative approach would be to store the module name inside the doc_tree on load and only query the xml documents matching the module name on query.
eg instead of:

if (!(results = ast_xmldoc_query("/docs/configInfo[@name='%s']/configFile/configObject[@name='%s']/configOption[@name='%s']", module, object_name, name))) {

do:

if (!(results = ast_xmldoc_query_module(module, "/docs/configInfo[@name='%s']/configFile/configObject[@name='%s']/configOption[@name='%s']", module, object_name, name))) {
@jcolp
Copy link
Member

jcolp commented Mar 18, 2024

Are you going to submit such improvements?

@zebastian
Copy link
Author

@jcolp yes, i can do that

@mbradeen mbradeen added support-level-core Functionality with core support level and removed triage labels Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement support-level-core Functionality with core support level
Projects
None yet
Development

No branches or pull requests

3 participants