Bug 1099917
| Summary: | Optimize loading libosinfo | ||
|---|---|---|---|
| Product: | [Community] Virtualization Tools | Reporter: | Cole Robinson <crobinso> |
| Component: | libosinfo | Assignee: | Matthias Clasen <mclasen> |
| Status: | CLOSED DEFERRED | QA Contact: | |
| Severity: | unspecified | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | unspecified | CC: | berrange, cfergeau, fidencio, gscrivan |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2018-09-04 18:35:53 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
Cole Robinson
2014-05-21 13:50:24 UTC
Thanks for filing this. I had been thinking about this every now and then but never came up with any concrete ideas. One idea I had was: 1. Also allow data to be provided in JSON format. 2. Whenever libosinfo parses data from .xml, it write it into a json file, in ~/cache/libosinfo (or some other location) with the name SHA256_OF_XML_FILE_PATH.json. 3. Before loading a .xml file, check if a corresponding JSON file exists and is not newer than .xml file. If so, load from JSON file intead. Otherwise, do the same as #1. What do you guys think? It depends whether parsing JSON is actually faster than parsing XML or not :-) Actually, what would be better is to actually profile libosinfo to see exactly where the slowness is. Perhap it isn't even the XML parsing that's the problem ! (In reply to Daniel Berrange from comment #2) > It depends whether parsing JSON is actually faster than parsing XML or not > :-) Surely we need to test and measure but based on my experience with both, i'm betting parsing json is a lot faster than parsing of XML. I might be wrong about the difference being significant enough though. > Actually, what would be better is to actually profile libosinfo to see > exactly where the slowness is. Perhap it isn't even the XML parsing that's > the problem ! Yeah, even though it seems unlikely the culprit is something else, we really should start with that. upstream master now should be around 30% faster than 0.2.10. The functions osinfo_loader_process_file_reg_usb and osinfo_loader_process_file_reg_pci take a lot of time and it seems that the reason is in the cost of creating gobjects: g_object_new is quite expensive and called many times. Things can always get faster but I don't think keeping this bug open is going to motivate any more change, so closing it |