-
Notifications
You must be signed in to change notification settings - Fork 72
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
Bytewise read() of files is slow #146
Labels
Comments
Thanks for looking into this. I need to look at the API. |
Confirm it gives ~16 x improvement on large xml files. |
Fixed by patch ^ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
By changing to buffered read in yang_parse_file(), I reduced the startup time of clixon_backend to a fifth. In the test I loaded many large YANG models, but only a small data store. I only tested on PC for now, getting a speed up of 200 ms. On a slow target, I suspect improvement can be seconds.
For the test I just did a fp=fdopen(fd, "r"); and then replaced the read with fread( &c, 1, 1, fp)). I think it would be best to change the API so that yang_parse_file(), clixon_xml_parse_file() and clixon_json_parse_file() gets a FILE* instead of a int file descriptor. But I don't know if you like to change the API.
The text was updated successfully, but these errors were encountered: