Details

    • Type: Sub-task Sub-task
    • Status: Resolved Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.3.2
    • Fix Version/s: 1.3.3rc1
    • Component/s: JDO
    • Labels:
      None
    • Number of attachments :
      3
    1. patch-C3155-20110724.txt
      9 kB
      Wensheng Dou
    2. patch-C3155-20110725.txt
      10 kB
      Ralf Joachim
    3. patch-C3155-20110727.txt
      9 kB
      Ralf Joachim

      Activity

      Hide
      Wensheng Dou added a comment -

      In this patch, use ConcurrentHashMap to improve the performance.

      Show
      Wensheng Dou added a comment - In this patch, use ConcurrentHashMap to improve the performance.
      Hide
      Ralf Joachim added a comment -

      Slightly improved patch.

      At TimeLimited.put() the internal map has been accessed twice. This prevented some construction of QueueItem instances and therefore reduced garbage collection. While this was good idea when put method has been synchronized it could have produced unpredictable results without the synchronization. At least its difficult to understand what may happen.

      This change also allowed some other improvements to QueueItemand tick() method.

      What's your opinion on these changes?

      Show
      Ralf Joachim added a comment - Slightly improved patch. At TimeLimited.put() the internal map has been accessed twice. This prevented some construction of QueueItem instances and therefore reduced garbage collection. While this was good idea when put method has been synchronized it could have produced unpredictable results without the synchronization. At least its difficult to understand what may happen. This change also allowed some other improvements to QueueItemand tick() method. What's your opinion on these changes?
      Hide
      Wensheng Dou added a comment -

      Yes, very good improvement, thanks.
      My patch made the code more difficult to understand, especially for the twice access and volitable value. Your improvement simplifies the code, and make it more understandable.

      Show
      Wensheng Dou added a comment - Yes, very good improvement, thanks. My patch made the code more difficult to understand, especially for the twice access and volitable value. Your improvement simplifies the code, and make it more understandable.
      Hide
      Ralf Joachim added a comment -

      Last patch has some problems if put() gets called during tick() method. New patch should solve this problem.

      Show
      Ralf Joachim added a comment - Last patch has some problems if put() gets called during tick() method. New patch should solve this problem.
      Hide
      Wensheng Dou added a comment -

      Yes, the new patch will work well. And the usage of putIfAbsent is very clever Thanks.

      Show
      Wensheng Dou added a comment - Yes, the new patch will work well. And the usage of putIfAbsent is very clever Thanks.

        People

        • Assignee:
          Wensheng Dou
          Reporter:
          Ralf Joachim
        • Votes:
          0 Vote for this issue
          Watchers:
          0 Start watching this issue

          Dates

          • Created:
            Updated:
            Resolved: