Uploaded image for project: 'NetBeans'
  1. NetBeans
  2. NETBEANS-2408

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • None
    • Patch

    Description

      Hello,
      I found that System.currentTimeMillis() can be used here 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
          1.0 kB
          bd2019us

        Activity

          People

            Unassigned Unassigned
            bd2019us bd2019us
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 2h 10m
                2h 10m