Uploaded image for project: 'Karaf'
  1. Karaf
  2. KARAF-6235

Date.getTime() can be changed to System.currentTimeMillis()

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 4.3.0, 4.2.5
    • karaf
    • None
    • Patch

    Description

      Hello,
      I found that System.currentTimeMillis() can be used instead of new Date.getTime().
      Since new Date() is a thin wrapper of light method System.currentTimeMillis(). The performance will be greatly damaged if it is invoked too much times.
      According to my local testing at the same environment, System.currentTimeMillis() can achieve a speedup to 5 times (435 ms vs 2073 ms), when these two methods are invoked 5,000,000 times.

      Attachments

        1. 1.patch
          0.9 kB
          bd2019us

        Issue Links

          Activity

            People

              jbonofre Jean-Baptiste Onofré
              bd2019us bd2019us
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: