11 Mar 2021 (in calibre source):
- Performance improvement of the virtual_libraries() template function
The performance of the virtual_libraries function has been improved substantially. For example, on my Windows machine using a test database with 3900 books, 15 virtual libraries, and one composite column that calls virtual_libraries(), the performance change is:
Code:
First call to virtual_libraries()
old = 368,381 μs
new = 382,352 μs
Typical time for each call thereafter (once per displayed book), until data changes:
old = 165,338 μs
new = 1 μs
Result: scrolling 20 books goes from 3.3 seconds to 20 microseconds.
On a smaller library of 200 books with 5 virtual libraries the numbers are:
Code:
First call to virtual_libraries()
old = 7,852 μs
new = 7,846 μs
Typical time for each call thereafter, until data changes:
old = 195 μs
new = <1 μs
The performance improvement is directly related to the number of virtual libraries.