| Summary: | Perform pattern lookups without strcmp | ||
|---|---|---|---|
| Product: | fontconfig | Reporter: | Ross Burton <ross> |
| Component: | library | Assignee: | Keith Packard <keithp> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | high | CC: | bugzilla |
| Version: | 2.2 | ||
| Hardware: | x86 (IA32) | ||
| OS: | Linux (All) | ||
| Whiteboard: | |||
| i915 platform: | i915 features: | ||
| Attachments: |
The patch
Make pattern values static Make all values static |
||
|
Description
Ross Burton
2005-03-07 04:06:45 UTC
Created attachment 2028 [details] [review] The patch Obviously the next step is to find where the rest of the strcmp() are being called, and to possibly apply the same algorithm to *all* strings going into the patterns. I did a quick hack which changed FcValueSave on strings from a call to FcStrCopy into call to FcObjectStaticName. Running fc-list with ~400 fonts in Valgrind gives me this. Before: malloc/free: 68325 allocs, 66665 frees, 3506738 bytes allocated. After: malloc/free: 59101 allocs, 57441 frees, 3376916 bytes allocated. Created attachment 2274 [details] [review] Make pattern values static Applying both the first patch and this patch will result in all strings in patterns being made static. This helps as it reduces duplication of values: for example on my system there are 464 copies of the string "Adobe" and 330 copies of the string "Bold". I've just committed the first patch, making the "object" variables static. I'll work on the values patch more, as I'm not happy with it. Created attachment 2283 [details] [review] Make all values static This patch puts all FcPattern string values through FcObjectStaticName, and ignores strings when the values are being destroyed. All .object values are now static after the mmap goodness. Marking FIXED. |
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.