diff options
author | Antonio Cunei <antonio.cunei@epfl.ch> | 2009-11-24 17:30:44 +0000 |
---|---|---|
committer | Antonio Cunei <antonio.cunei@epfl.ch> | 2009-11-24 17:30:44 +0000 |
commit | 839d0ee5ec9c27e2e5da6bab6f03c8a95e90a109 (patch) | |
tree | 613ed692570fb5891f57e76854d9ff4af8ed13d1 /test/files/bench/equality/eq.scala | |
parent | 5f71b9208404015f425f30a0b4b3f4b3df4ec83f (diff) | |
download | scala-839d0ee5ec9c27e2e5da6bab6f03c8a95e90a109.tar.gz scala-839d0ee5ec9c27e2e5da6bab6f03c8a95e90a109.tar.bz2 scala-839d0ee5ec9c27e2e5da6bab6f03c8a95e90a109.zip |
Merged revisions 19624,19629-19630,19645,19651,...
Merged revisions
19624,19629-19630,19645,19651,19655-19660,19666-19668,19670,19673-19679,
19683-19685,19688,19692,19695-19700,19706-19707,19717-19719,19723-19724,
19726,19730,19735-19740,19742-19744,19746-19759,19762-19764,19767-19769,
19773,19776,19781,19787,19789,19792-19793,19798-19800,19803-19804,19806-
19808,19813-19815,19818-19820,19824 via svnmerge from
https://lampsvn.epfl.ch/svn-repos/scala/scala/trunk
........
r19624 | moors | 2009-11-13 13:17:50 +0100 (Fri, 13 Nov 2009) | 2 lines
fixed #1236
another Symbol::tpe bites the dust (should'be been tpeHK)
........
r19629 | rytz | 2009-11-13 16:53:11 +0100 (Fri, 13 Nov 2009) | 1 line
review board scipt
........
r19630 | rytz | 2009-11-13 17:10:35 +0100 (Fri, 13 Nov 2009) | 1 line
updates to review script
........
r19645 | odersky | 2009-11-13 18:31:12 +0100 (Fri, 13 Nov 2009) | 1 line
Fixes #1477 by requiring that abstract types with non-volatile upper
bounds cannot be overridden by volatile types. ........ r19651 |
extempore | 2009-11-14 19:02:10 +0100 (Sat, 14 Nov 2009) | 5 lines
Fixes and test cases for #2087 and #2400. This required fixing a
long-standing bug in fjbg and recompiling fjbg.jar, which had the side
effect of revealing that the current fjbg jar had never been recompiled
with target 1.5, so now it's smaller and (I imagine) faster. ........
r19655 | odersky | 2009-11-15 12:14:57 +0100 (Sun, 15 Nov 2009) | 2
lines
Fixed #2848 and #2630; Improvements in equality speed ........ r19656
| odersky | 2009-11-15 14:56:21 +0100 (Sun, 15 Nov 2009) | 2 lines
Fixed #1459
........
r19657 | odersky | 2009-11-15 15:17:48 +0100 (Sun, 15 Nov 2009) | 2 lines
Added benchmarks with results for equality.
........
r19658 | milessabin | 2009-11-15 16:46:52 +0100 (Sun, 15 Nov 2009) | 1 line
Fixed #2627. Also ensure that a non-empty dependencies file is created
on the first build. ........ r19659 | extempore | 2009-11-15 19:08:45
+0100 (Sun, 15 Nov 2009) | 3 lines
Tweaked a test which has been regularly failing due to heap
exhaustion, although what it's supposed to be testing is stack
utilization. ........ r19660 | milessabin | 2009-11-15 21:57:46 +0100
(Sun, 15 Nov 2009) | 1 line
Corrected help syntax for -Ybuilder-debug.
........
r19666 | milessabin | 2009-11-16 11:17:01 +0100 (Mon, 16 Nov 2009) | 1 line
Fixed #2627.
........
r19667 | rytz | 2009-11-16 11:45:54 +0100 (Mon, 16 Nov 2009) | 1 line
review requests can now be created outside a checkout ........ r19668
| rytz | 2009-11-16 11:55:59 +0100 (Mon, 16 Nov 2009) | 1 line
another minor change to teh review script
........
r19670 | odersky | 2009-11-16 13:31:40 +0100 (Mon, 16 Nov 2009) | 2 lines
Fixed #2323; made Pickler do the right thing.
........
r19673 | moors | 2009-11-16 18:44:25 +0100 (Mon, 16 Nov 2009) | 1 line
test cases in pending
........
r19674 | dragos | 2009-11-16 19:24:40 +0100 (Mon, 16 Nov 2009) | 2 lines
Faster optimizer by caching successors/predecessors in basic blocks,
and better lub for icode ........ r19675 | extempore | 2009-11-16
22:30:22 +0100 (Mon, 16 Nov 2009) | 1 line
Minor pickler organization stemming from optimizer appeasement.
........ r19676 | extempore | 2009-11-16 22:30:36 +0100 (Mon, 16 Nov
2009) | 2 lines
Some organization & duplication removal in GenICode stemming from
optimizer appeasement. ........ r19677 | extempore | 2009-11-16 22:30:54
+0100 (Mon, 16 Nov 2009) | 2 lines
A lot of minor code adjustments to ease the burden on the optimizer,
and various cleanups encountered along the way. ........ r19678 |
extempore | 2009-11-16 22:31:07 +0100 (Mon, 16 Nov 2009) | 2 lines
Some organization & duplication removal in RefChecks stemming from
optimizer appeasement. ........ r19679 | extempore | 2009-11-16 22:56:00
+0100 (Mon, 16 Nov 2009) | 1 line
Fix for #2647.
........
r19683 | extempore | 2009-11-17 05:51:43 +0100 (Tue, 17 Nov 2009) | 1 line
Fix and test case for #2636.
........
r19684 | extempore | 2009-11-17 06:25:48 +0100 (Tue, 17 Nov 2009) | 2 lines
Contents of scala.Math moved into scala.math package object, and
scala.Math deprecated. Also a couple janitorial cleanups. ........
r19685 | milessabin | 2009-11-17 10:04:00 +0100 (Tue, 17 Nov 2009) | 1
line
More String.isEmpty breakage.
........
r19688 | odersky | 2009-11-17 14:12:31 +0100 (Tue, 17 Nov 2009) | 1 line
Allow implicit modifier on single-parameter function literals. Fixes
and closes #1492. ........ r19692 | extempore | 2009-11-17 21:51:23
+0100 (Tue, 17 Nov 2009) | 1 line
Partial fix for #2625.
........
r19695 | extempore | 2009-11-18 01:18:58 +0100 (Wed, 18 Nov 2009) | 11 lines
Removing bits from the library which shouldn't make the 2.8 cut.
Removed outright:
util.Hashable: unused and I have a better plan for this net.Utility:
class created to accomodate expansion which never materialized
reflect.Invocation: doesn't go far enough, needs love it won't find
right now reflect.RichClass: same as Invocation
Moved into compiler:
util.ScalaClassLoader: too useful to lose, not done enough to ship
........ r19696 | extempore | 2009-11-18 01:36:26 +0100 (Wed, 18 Nov
2009) | 1 line
More minor removals and some cleanups of !!!s and XXXs. ........
r19697 | dcaoyuan | 2009-11-18 05:35:07 +0100 (Wed, 18 Nov 2009) | 1
line
Fixed #2631
........
r19698 | dcaoyuan | 2009-11-18 05:36:59 +0100 (Wed, 18 Nov 2009) | 1 line
to fix varies conditions of removed source/class files that were
previously recorded in .scala_dependencies. ........ r19699 | extempore
| 2009-11-18 06:41:16 +0100 (Wed, 18 Nov 2009) | 3 lines
More deprecation work. Removes most elements which have been
deprecated since 2.7.2 (still except for lower case primitive type
aliases) and removes every deprecated method which has never shipped in
a release. ........ r19700 | rytz | 2009-11-18 11:19:30 +0100 (Wed, 18
Nov 2009) | 1 line
recompiled msil.jar, it refered to scala.Math$
........
r19706 | extempore | 2009-11-18 15:45:11 +0100 (Wed, 18 Nov 2009) | 3 lines
Fixed a bug in Range which was causing take and drop to overflow and
return empty if the argument was larger than the actual length
of the Range and arg * step > MaxInt.
........
r19707 | dcaoyuan | 2009-11-18 15:46:01 +0100 (Wed, 18 Nov 2009) | 1 line
Fixed #2645
........
r19717 | extempore | 2009-11-18 23:06:03 +0100 (Wed, 18 Nov 2009) | 3 lines
Finally completed the incredibly tedious task of removing the lower
case primitive aliases from Predef. Had to rebuild msil.jar along the
way. ........ r19718 | extempore | 2009-11-18 23:43:54 +0100 (Wed, 18
Nov 2009) | 2 lines
New starr based on r19717 since I'm finding the current starr doesn't
have TupleN.zipped fully working. ........ r19719 | extempore |
2009-11-19 00:24:23 +0100 (Thu, 19 Nov 2009) | 2 lines
More deprecation soothing. Soon we'll be down to a double-digit
warning count. ........ r19723 | extempore | 2009-11-19 05:59:46 +0100
(Thu, 19 Nov 2009) | 2 lines
Restoring an embarassingly large quantity of deprecated methods whose
time had not yet come. ........ r19724 | dcaoyuan | 2009-11-19 09:24:37
+0100 (Thu, 19 Nov 2009) | 1 line
Path.parent now returns Path instead of Option[Path], and it prefers
relative path. ........ r19726 | rytz | 2009-11-19 14:44:15 +0100 (Thu,
19 Nov 2009) | 1 line
closes #2670. the target-annotations can now be placed on annotation
classes as well ........ r19730 | extempore | 2009-11-19 21:31:46 +0100
(Thu, 19 Nov 2009) | 2 lines
Deprecation patrol exercises the new capabilities in Tuple2.zipped
among other exciting no-ops. ........ r19735 | extempore | 2009-11-20
01:49:58 +0100 (Fri, 20 Nov 2009) | 1 line
Fix for infinite loop in StringBuilder pointed out by dpp. ........
r19736 | extempore | 2009-11-20 04:50:12 +0100 (Fri, 20 Nov 2009) | 1
line
Slightly more fixy fix than the previous fix.
........
r19737 | plocinic | 2009-11-20 10:04:04 +0100 (Fri, 20 Nov 2009) | 1 line
closes #1422
........
r19738 | odersky | 2009-11-20 14:57:22 +0100 (Fri, 20 Nov 2009) | 1 line
Simplifiations in collections libraries, enabled by introduction of
Self type in TraversableLike. ........ r19739 | odersky | 2009-11-20
14:58:36 +0100 (Fri, 20 Nov 2009) | 1 line
new test
........
r19740 | extempore | 2009-11-20 16:16:45 +0100 (Fri, 20 Nov 2009) | 4 lines
More world-shaking deprecation work. Using the scala.math package
object, updating some @deprecated messages to give realistic
alternatives, properly resolving the semantic mismatch between List.--
and diff, its once-recommended but inequivalent alternative. ........
r19742 | prokopec | 2009-11-20 17:11:19 +0100 (Fri, 20 Nov 2009) | 1
line
PriorityQueue fixed, should work ok now.
........
r19743 | prokopec | 2009-11-20 17:11:53 +0100 (Fri, 20 Nov 2009) | 1 line
Priority queue test.
........
r19744 | prokopec | 2009-11-20 17:12:48 +0100 (Fri, 20 Nov 2009) | 1 line
Priority queue test, updated.
........
r19746 | prokopec | 2009-11-20 18:25:08 +0100 (Fri, 20 Nov 2009) | 1 line
Changes made in the clean up phase - now the symbols get interned during classload for each symbol literal - references to them reside in static fields. These static fields get initialized in static constructors - the java backend will now identify ctors with static flags and generate a static initializer containing the necessary code.
........
r19747 | prokopec | 2009-11-20 18:29:39 +0100 (Fri, 20 Nov 2009) | 1 line
Removed a couple of unneeded comments.
........
r19748 | extempore | 2009-11-20 18:39:49 +0100 (Fri, 20 Nov 2009) | 3 lines
Deprecated the Tuple(...) methods in Predef, but at the same time
extended the overload out to 22 and moved them into the scala package
object. ........ r19749 | odersky | 2009-11-20 19:02:42 +0100 (Fri, 20
Nov 2009) | 1 line
Closed #2641
........
r19750 | prokopec | 2009-11-20 19:06:41 +0100 (Fri, 20 Nov 2009) | 1 line
Commented out anonymous function invocation for which Hudson was
complaining it couldn't find the classdef. ........ r19751 | extempore |
2009-11-20 19:08:57 +0100 (Fri, 20 Nov 2009) | 2 lines
Subtly altered implementation of iterator which does not go into an
infinite loop when deprecated "append" is replaced with ++. ........
r19752 | extempore | 2009-11-20 19:09:08 +0100 (Fri, 20 Nov 2009) | 2
lines
Tweak to Iterator.++ to keep it from going into an infinite loop on x
++ x. ........ r19753 | prokopec | 2009-11-20 19:17:13 +0100 (Fri, 20
Nov 2009) | 1 line
Trying to get the test to pass on the server.
........
r19754 | extempore | 2009-11-20 19:35:52 +0100 (Fri, 20 Nov 2009) | 1 line
Eliminated warning about Tuple2 and Tuple3 importing Traversable.
........ r19755 | extempore | 2009-11-20 19:59:30 +0100 (Fri, 20 Nov
2009) | 1 line
More deprecation avoidance and some minor smoothings. ........ r19756
| moors | 2009-11-20 20:25:32 +0100 (Fri, 20 Nov 2009) | 3 lines
closes #2585: generate more precise Java generic signatures for
classes nested in parametric outer classes fix based on review by Martin
baseType is your friend ........ r19757 | michelou | 2009-11-20 21:19:41
+0100 (Fri, 20 Nov 2009) | 2 lines
updated/extended serialization tests
........
r19758 | extempore | 2009-11-20 21:37:12 +0100 (Fri, 20 Nov 2009) | 1 line
Expanding the warning cleansing into -unchecked territory. ........
r19759 | odersky | 2009-11-20 22:02:23 +0100 (Fri, 20 Nov 2009) | 2
lines
Closed #2642
........
r19762 | extempore | 2009-11-21 18:24:29 +0100 (Sat, 21 Nov 2009) | 1 line
Applied performance patch and test case from ijuma; closes #2526.
........ r19763 | extempore | 2009-11-21 20:58:05 +0100 (Sat, 21 Nov
2009) | 2 lines
Partially addresses #2626 - pattern matcher no longer depends
on drop(n) behavior if n < 0.
........
r19764 | extempore | 2009-11-22 00:55:06 +0100 (Sun, 22 Nov 2009) | 2 lines
Cleanup of Cleanup. Finally straightening out a bunch of duplicated
boxing code in the right location. ........ r19767 | extempore |
2009-11-22 02:26:04 +0100 (Sun, 22 Nov 2009) | 2 lines
Fix (I think) for recently introduced MSIL breakage stemming from
eliminating deprecation warnings. ........ r19768 | odersky | 2009-11-22
12:32:26 +0100 (Sun, 22 Nov 2009) | 2 lines
Made implicit resolution compatible with numeric conformance. ........
r19769 | odersky | 2009-11-22 13:28:57 +0100 (Sun, 22 Nov 2009) | 2
lines
Closed #2635
........
r19773 | extempore | 2009-11-22 17:07:46 +0100 (Sun, 22 Nov 2009) | 1 line
Removed all traces of Boxed*Array. New starr.
........
r19776 | odersky | 2009-11-22 19:13:34 +0100 (Sun, 22 Nov 2009) | 2 lines
Moved failing test due to fix of #2635 to pending. ........ r19781 |
prokopec | 2009-11-22 23:47:08 +0100 (Sun, 22 Nov 2009) | 2 lines
Priority queue reverse is undefined - overriden to throw an exception.
Reverse iterator seems to have sense - it is overriden and is defined, and some methods in SeqLike are implemented in terms of it.
........
r19787 | extempore | 2009-11-23 13:51:56 +0100 (Mon, 23 Nov 2009) | 1 line
A couple more warning fixes I meant to check in with r19758. ........
r19789 | dragos | 2009-11-23 14:58:56 +0100 (Mon, 23 Nov 2009) | 2 lines
== for specialized types will not cause boxing anymore ........ r19792
| odersky | 2009-11-23 15:45:44 +0100 (Mon, 23 Nov 2009) | 1 line
Closed #1226. Added new test cases.
........
r19793 | malayeri | 2009-11-23 16:16:25 +0100 (Mon, 23 Nov 2009) | 1 line
Closed #2552. Changed Iterator.takeWhile and Iterator.filter to avoid
recomputing predicate in next and hasNext methods. ........ r19798 |
odersky | 2009-11-23 18:50:54 +0100 (Mon, 23 Nov 2009) | 1 line
Partial fix for #2683
........
r19799 | odersky | 2009-11-23 19:12:34 +0100 (Mon, 23 Nov 2009) | 1 line
Closed #1545
........
r19800 | extempore | 2009-11-23 22:03:51 +0100 (Mon, 23 Nov 2009) | 4 lines
Partitioned scala.Math and scala.math a little bit. ALL_CAP aliases
are deprecated and only in Math. Formerly unavailable members of
java.lang.Math which were added in 1.5 are now available in scala.math.
........ r19803 | extempore | 2009-11-24 01:08:32 +0100 (Tue, 24 Nov
2009) | 2 lines
Some more XML cleanups. I'm seeing if I can break the compiler
dependency on scala.util.automata. ........ r19804 | milessabin |
2009-11-24 02:13:01 +0100 (Tue, 24 Nov 2009) | 1 line
Improved completion for locals and import.
........
r19806 | moors | 2009-11-24 10:09:49 +0100 (Tue, 24 Nov 2009) | 5 lines
close #2665 and close #2667: use weak conformance in polymorphic case
of isApplicable reviewed by: odersky
exprTypeArgs now takes a comparison function: isWeaklyCompatible is
passed in isApplicable's typesCompatible (to mimic what happens in the
monomorphic case) Martin: please review as this is different from my
original proposal (that one broke type inference, this one passes all
tests and does not slow down quick.comp) ........ r19807 | moors |
2009-11-24 11:15:58 +0100 (Tue, 24 Nov 2009) | 1 line
pending test: see #2660, #2691
........
r19808 | moors | 2009-11-24 11:19:08 +0100 (Tue, 24 Nov 2009) | 1 line
close #2626 as specified by Martin
........
r19813 | odersky | 2009-11-24 15:40:04 +0100 (Tue, 24 Nov 2009) | 1 line
relaxed rule requiring `override` modifiers so that it's OK if self
type contains overridden symbol. ........ r19814 | odersky | 2009-11-24
16:50:06 +0100 (Tue, 24 Nov 2009) | 1 line
Closed #2629 #2639 #2669
........
r19815 | odersky | 2009-11-24 16:57:17 +0100 (Tue, 24 Nov 2009) | 1 line
Closed #2696
........
r19818 | odersky | 2009-11-24 17:07:49 +0100 (Tue, 24 Nov 2009) | 1 line
Closed #2698
........
r19819 | odersky | 2009-11-24 17:12:18 +0100 (Tue, 24 Nov 2009) | 1 line
Closed #2664
........
r19820 | prokopec | 2009-11-24 17:35:09 +0100 (Tue, 24 Nov 2009) | 1 line
Added reverse capabilities to PriorityQueue. Seems to work well - tests pass.
........
r19824 | phaller | 2009-11-24 18:11:45 +0100 (Tue, 24 Nov 2009) | 1 line
Made mutable.OpenHashMap a MapLike. Closes #2681. ........
Diffstat (limited to 'test/files/bench/equality/eq.scala')
-rwxr-xr-x | test/files/bench/equality/eq.scala | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/test/files/bench/equality/eq.scala b/test/files/bench/equality/eq.scala new file mode 100755 index 0000000000..8ac5b5ef5c --- /dev/null +++ b/test/files/bench/equality/eq.scala @@ -0,0 +1,34 @@ +object eq extends testing.Benchmark { + + def eqtest[T](creator: Int => T, n: Int): Int = { + val elems = Array.tabulate[AnyRef](n)(i => creator(i % 2).asInstanceOf[AnyRef]) + + var sum = 0 + var i = 0 + while (i < n) { + var j = 0 + while (j < n) { + if (elems(i) eq elems(j)) sum += 1 + j += 1 + } + i += 1 + } + sum + } + + val obj1 = new Object + val obj2 = new Object + + def run() { + var sum = 0 + sum += eqtest(x => if (x == 0) obj1 else obj2, 2000) + sum += eqtest(x => x, 1000) + sum += eqtest(x => x.toChar, 550) + sum += eqtest(x => x.toByte, 550) + sum += eqtest(x => x.toLong, 550) + sum += eqtest(x => x.toShort, 100) + sum += eqtest(x => x.toFloat, 100) + sum += eqtest(x => x.toDouble, 100) + assert(sum == 2958950) + } +} |