Feature #554
does get_sqlfs() need to be called each time?
Status: | New | Start date: | 01/24/2013 | |
---|---|---|---|---|
Priority: | Low | Due date: | ||
Assignee: | - | % Done: | 0% | |
Category: | - | |||
Target version: | - | |||
Component: | libsqlfs |
Description
When using the thread API and having get_sqlfs() get the sqlfs_t pointer each time its needed, this adds a measureable overhead, my guess is that its about 50% slower this way. Would it possible to cache the sqlfs_t* at the start of each function that needs it?
Here's the merged results of two runs of c_perf.test at only 8192 size, but you can see the general trend:
reads without transactions ------------------------------- read 2097152 bytes in 256 8192 byte chunks in 0.081638 seconds
- read 2097152 bytes in 256 8192 byte chunks in 0.046230 seconds
reads with transactions ------------------------------ - read 2097152 bytes in 256 8192 byte chunks in 0.062073 seconds
- read 2097152 bytes in 256 8192 byte chunks in 0.040215 seconds
writes without transactions ------------------------------ - wrote 2097152 bytes in 256 8192 byte chunks in 0.099259 seconds
- wrote 2097152 bytes in 256 8192 byte chunks in 0.105794 seconds
writes with transactions ------------------------------ - wrote 2097152 bytes in 256 8192 byte chunks in 4.260554 seconds
- wrote 2097152 bytes in 256 8192 byte chunks in 0.066501 seconds
reads without transactions ------------------------------
- read 2097152 bytes in 256 8192 byte chunks in 0.103902 seconds
- read 2097152 bytes in 256 8192 byte chunks in 0.051937 seconds
reads with transactions ------------------------------ - read 2097152 bytes in 256 8192 byte chunks in 0.092716 seconds
- read 2097152 bytes in 256 8192 byte chunks in 0.044551 seconds
writes without transactions ------------------------------ - wrote 2097152 bytes in 256 8192 byte chunks in 0.123683 seconds
- wrote 2097152 bytes in 256 8192 byte chunks in 0.095375 seconds
writes with transactions ------------------------------ - wrote 2097152 bytes in 256 8192 byte chunks in 1.096097 seconds
- wrote 2097152 bytes in 256 8192 byte chunks in 2.242698 seconds
History
#1 Updated by hans almost 5 years ago
- Tracker changed from Bug to Feature
#2 Updated by abeluck almost 5 years ago
- Target version set to 61
- Component set to libsqlfs
Interesting idea.
This seems like a sane idea to me. We should run some tests to see if, once allocated, the value returned from get_sqlfs changes, which would be the value returned from pthread_getspecific().
#3 Updated by hans almost 4 years ago
- Target version deleted (
61)