Summary: | Speed up get_overall() and get_bad() | ||
---|---|---|---|
Product: | libatasmart | Reporter: | Martin Pitt <martin.pitt> |
Component: | library | Assignee: | Lennart Poettering <lennart> |
Status: | RESOLVED FIXED | QA Contact: | Lennart Poettering <lennart> |
Severity: | normal | ||
Priority: | medium | CC: | zeuthen |
Version: | unspecified | ||
Hardware: | Other | ||
OS: | All | ||
Whiteboard: | |||
i915 platform: | i915 features: | ||
Attachments: | speed up patch |
Description
Martin Pitt
2010-03-02 01:06:59 UTC
Created attachment 33683 [details] [review] speed up patch For comparing I added this to the beginning of get_overall(): access("MARK: smart_get_overall(): start", F_OK); and a corresponding "end" line to the end of the function, and called strace -e access -tttf -o /tmp/trace ./skdump --load=blob-examples/FUJITSU_MHY2120BH--0084000D >/dev/null This shows that with current git trunk, the function needs 0.305 s on my laptop. With the caching patch, the time reduces to 0.0005 s. I can't really explain why it's that fast, since it only reduces the four sk_disk_smart_parse_attributes() calls to one, so it should have been 0.08 s. I guess there is some additional effect with CPU caches somewhere. I diffed the output of for i in blob-examples/*; do echo "-- $i"; ./skdump --load=$i; done > /tmp/atasmart-test.out without and with the patch, and there is no difference. Hmm, so finally find the time to review this. Looks good. Applied. Thanks! |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.