Uploaded image for project: 'Commons JCS'
  1. Commons JCS
  2. JCS-148

Unnecessary use of FileChannel.force() in Indexed and Block Disk Caches

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: jcs-2.0-beta-1
    • Fix Version/s: jcs-2.0-beta-2
    • Component/s: Indexed Disk Cache
    • Labels:
      None

      Description

      In: IndexedDisk.write() and BlokDisk.write() at the end FileChannel.force() is called.

      It introduces a lot of I/O and affects performance.

      After removal of these two lines, mvn test raises no issues.

      The test case org.apache.commons.jcs.auxiliary.disk.indexed.HugeQuantityIndDiskCacheLoadTest goes from 450 seconds needed for completion to 30 seconds on my system.

      As the data file is useless without proper keyfile, which is stored only on shutdown, then I guess we can resign from fc.force() on data writes.

        Attachments

          Activity

            People

            • Assignee:
              tv Thomas Vandahl
              Reporter:
              wiktorn Wiktor N
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: