Issue Details (XML | Word | Printable)

Key: SOLR-665
Type: Improvement Improvement
Status: Closed Closed
Resolution: Duplicate
Priority: Major Major
Assignee: Unassigned
Reporter: Fuad Efendi
Votes: 0
Watchers: 6
Operations

If you were logged in you would be able to see more operations.
Solr

FIFO Cache (Unsynchronized): 9x times performance boost

Created: 28/Jul/08 03:24 AM   Updated: 21/Feb/09 03:31 PM
Return to search
Component/s: None
Affects Version/s: 1.3
Fix Version/s: None

Time Tracking:
Original Estimate: 672h
Original Estimate - 672h
Remaining Estimate: 672h
Remaining Estimate - 672h
Time Spent: Not Specified
Remaining Estimate - 672h

File Attachments:
  Size
Java Source File Licensed for inclusion in ASF works ConcurrentFIFOCache.java 2008-07-29 02:42 PM Noble Paul 2 kB
Java Source File Licensed for inclusion in ASF works ConcurrentFIFOCache.java 2008-07-29 06:26 AM Noble Paul 1 kB
Java Source File Licensed for inclusion in ASF works ConcurrentLRUCache.java 2008-07-29 09:34 AM Noble Paul 3 kB
Java Source File Licensed for inclusion in ASF works ConcurrentLRUWeakCache.java 2008-07-30 04:50 AM Fuad Efendi 2 kB
Java Source File Licensed for inclusion in ASF works FIFOCache.java 2008-07-28 03:25 AM Fuad Efendi 8 kB
Java Source File Licensed for inclusion in ASF works SimplestConcurrentLRUCache.java 2008-07-30 03:05 PM Fuad Efendi 2 kB
Environment: JRockit R27 (Java 6)

Resolution Date: 21/Feb/09 03:31 PM


 Description  « Hide
Attached is modified version of LRUCache where
1. map = new LinkedHashMap(initialSize, 0.75f, false) - so that "reordering"/true (performance bottleneck of LRU) is replaced to "insertion-order"/false (so that it became FIFO)
2. Almost all (absolutely unneccessary) synchronized statements commented out

See discussion at http://www.nabble.com/LRUCache---synchronized%21--td16439831.html

Performance metrics (taken from SOLR Admin):

LRU
Requests: 7638
Average Time-Per-Request: 15300
Average Request-per-Second: 0.06

FIFO:
Requests: 3355
Average Time-Per-Request: 1610
Average Request-per-Second: 0.11

Performance increased 9 times which roughly corresponds to a number of CPU in a system, http://www.tokenizer.org/ (Shopping Search Engine at Tokenizer.org)

Current number of documents: 7494689
name: filterCache
class: org.apache.solr.search.LRUCache
version: 1.0
description: LRU Cache(maxSize=10000000, initialSize=1000)
stats: lookups : 15966954582
hits : 16391851546
hitratio : 0.102
inserts : 4246120
evictions : 0
size : 2668705
cumulative_lookups : 16415839763
cumulative_hits : 16411608101
cumulative_hitratio : 0.99
cumulative_inserts : 4246246
cumulative_evictions : 0

Thanks



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
No work has yet been logged on this issue.