You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With new numbers implementation some calls to == are replaced with call to scala.runtime.Comparator.equals.
That comparator works slow if operands are not equal and not instanceof Number.
I've optimized Comparator a bit. Result is: [http://mx1.ru/~yozh/scala-comparator/Comparator.java] (diff: [http://mx1.ru/~yozh/scala-comparator/Comparator.java.diff]).
I've tested with [http://mx1.ru/~yozh/scala-comparator/Test.java] and got results:
with new comparator: about 1.7 s
with orig comparator: about 2.3 s
with o.equals(o2): about 1.0 s
So overhead of old comparator in test is about 1.3 s vs. overhead of new comparator about 0.7 seconds.
Test executed on PPC notebook (1.5 HHz, 1.5Gb) on JDK 1.5.
The text was updated successfully, but these errors were encountered:
Aladdin: [http://scala-webapps.epfl.ch/bugtracking/contribs/load.do?id=479 contrib 479]
With new numbers implementation some calls to == are replaced with call to scala.runtime.Comparator.equals.
That comparator works slow if operands are not equal and not instanceof Number.
I've optimized Comparator a bit. Result is: [http://mx1.ru/~yozh/scala-comparator/Comparator.java] (diff: [http://mx1.ru/~yozh/scala-comparator/Comparator.java.diff]).
I've tested with [http://mx1.ru/~yozh/scala-comparator/Test.java] and got results:
with new comparator: about 1.7 s
with orig comparator: about 2.3 s
with o.equals(o2): about 1.0 s
So overhead of old comparator in test is about 1.3 s vs. overhead of new comparator about 0.7 seconds.
Test executed on PPC notebook (1.5 HHz, 1.5Gb) on JDK 1.5.
The text was updated successfully, but these errors were encountered: