Lucene - Core
  1. Lucene - Core
  2. LUCENE-1833

When we move to java 1.5 in 3.0 we should replace all Interger, Long, etc construction with .valueOf

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Trivial Trivial
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.0
    • Component/s: None
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      -128 to 128 are guaranteed to be cached and using valueOf in that case is 3.5 times faster than using contructor

      1. LUCENE-1833.patch
        78 kB
        Uwe Schindler

        Issue Links

          Activity

          Hide
          Robert Muir added a comment -

          Uwe, I agree with what Mark said.
          my previous comment on LUCENE-1936 really was just me wanting to stay out of your way, not the other way around

          Show
          Robert Muir added a comment - Uwe, I agree with what Mark said. my previous comment on LUCENE-1936 really was just me wanting to stay out of your way, not the other way around
          Hide
          Mark Miller added a comment -

          I hope, nobody has problems with merging caused by this!

          Pfff - so many good merge tools out there today, lets not let that get in the way of this sweet rapid movement to java 1.5!

          If anyone is annoyed, I'd be happy to merge any patch for them.

          Show
          Mark Miller added a comment - I hope, nobody has problems with merging caused by this! Pfff - so many good merge tools out there today, lets not let that get in the way of this sweet rapid movement to java 1.5! If anyone is annoyed, I'd be happy to merge any patch for them.
          Hide
          Uwe Schindler added a comment -

          Committed revision: 821186

          I hope, nobody has problems with merging caused by this!

          Show
          Uwe Schindler added a comment - Committed revision: 821186 I hope, nobody has problems with merging caused by this!
          Hide
          Uwe Schindler added a comment -

          This patch changes all "new Number(" code parts with "Number.valueOf(" (changed using find/sed). All tests pass.

          I want to commit this as soon as possible, because it affects lots of files and I do not want to get this patch outdated. The StringBuffer from previous comment is in another issue.

          Show
          Uwe Schindler added a comment - This patch changes all "new Number(" code parts with "Number.valueOf(" (changed using find/sed). All tests pass. I want to commit this as soon as possible, because it affects lots of files and I do not want to get this patch outdated. The StringBuffer from previous comment is in another issue.
          Hide
          Uwe Schindler added a comment -

          ...and also StringBuffers!

          Show
          Uwe Schindler added a comment - ...and also StringBuffers!

            People

            • Assignee:
              Uwe Schindler
              Reporter:
              Mark Miller
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development