summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Commented out assertionsRuediger Klaehn2012-08-281-3/+3
|
* Added test to ensure that ListMap.tail is O(1)Ruediger Klaehn2012-08-251-0/+7
|
* Made ListMap.tail O(1) instead of O(N)Ruediger Klaehn2012-08-251-7/+7
| | | | That way it is possible to check if a ListMap has one element by checking x.tail.isEmpty. Size is O(1), so size==1 won't do!
* Extended test to also check proper handling of collisionsRuediger Klaehn2012-08-211-0/+91
|
* Added test that tests that correct classes are being created when removing ↵Ruediger Klaehn2012-08-211-0/+32
| | | | elements
* Added assertions for tree consistencyRuediger Klaehn2012-08-201-0/+4
|
* Rewrote makeHashTrieMap so that objects are created in a consistent stateRuediger Klaehn2012-08-201-22/+19
| | | | | | The old approach first created a broken HashTrieSet (with elems(0) == null) and then fixed it afterwards by assigning elems(0) from the outside. But that won't work with the assertion. The new method is recursive, but the maximum recursion depth is 7, and on average the method won't recurse at all.
* Check if subNew is the only child and if it is a leaf.Ruediger Klaehn2012-08-201-0/+2
| | | | If this is the case we must return subNew because a HashTrieMap with one leaf element is not allowed by the assertions
* Move code to create two-element HashTrieMap into utility method and make use ↵Ruediger Klaehn2012-08-201-27/+30
| | | | of it from HashMapCollision1.updated0 as well
* Remove unnecessary check for merger eq nullRuediger Klaehn2012-08-201-2/+2
| | | | While we still have to check for merger eq null in updated0 because updated0 gets called with a nu
* Prevent creation of a HashTrieMap with one child unless the child is a ↵Ruediger Klaehn2012-08-201-1/+4
| | | | HashTrieMap itself
* Prevent creation of a HashMapCollision1 with one elementRuediger Klaehn2012-08-201-3/+6
|
* Merge pull request #1164 from gkossakowski/topic/optJosh Suereth2012-08-2041-2096/+2835
|\ | | | | Compiler optimizations (take 3, hopefully final)
| * Attempts to improve inlining behavior for map, flatMap.Grzegorz Kossakowski2012-08-202-5/+33
| | | | | | | | | | | | | | Reduced method size of map/flatMap to under 35 bytes to make them inlinable. Also specialized filterNot code so that it does not create a second closure. Finally, avoided default argument for sizeHint to reduce size of methods calling it.
| * Slightly less drastic disabling of statistics.Martin Odersky2012-08-201-12/+12
| | | | | | | | All statistics code is now subject to a switch at each use site, as opposed to a compile-time constant before. We should veryfy that this does not affect performance. Statistics is a useful ability to have for trouble-shooting compile time speeds on specific code bases. But we should not pay a lot for having it on normal runs.
| * Reverted closure hoisting except for functions returning a Boolean resultMartin Odersky2012-08-2013-57/+45
| | | | | | | | | | | | If our theory wrt map is correct (i.e. that it gets inlined by JVM), then closure hoisting is counter-productive because it migh well prevent the closure from being inlined. This commit removes all hoisted closures that are passed to map and leaves only those boolean closures that are passed to exists and forall. I should have split the early optimizations including closures into separate commits. As that train has left, I am now reverting some bits to see whether the reverts affect performance at all, and in what direction.
| * Some more closure hositing/eliminationMartin Odersky2012-08-202-7/+15
| |
| * Made all statistic code disappear unless built with Statistics.canEnable = trueMartin Odersky2012-08-2011-123/+138
| |
| * Partial revert of itransform commit.Martin Odersky2012-08-201-52/+43
| | | | | | | | Profile data actually showed a small slowdown in steady state. We keep the reordering but merge all submethods into one.
| * Reverted addition of 5 specialized method from LinearSeqOptimized to List.Martin Odersky2012-08-201-56/+0
| | | | | | | | It seems any gains were more then compensated by the loss of making map polymorphic, probably preventing inlining decisions in Hotspot.
| * Manaul inling of `UndoLog.undoUnless`.Grzegorz Kossakowski2012-08-202-25/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | Inline `UndoLog.undoUnless` into `isSubType` and `isSameType` methods. They are responsible for 20% of all Function0 allocations. I had to do manual inlining because inlier doesn't cope with exception handlers well. Let it be noted that I almost cried while doing this ugly change. I'll want to see inliner being fixed so we can revert this change ASAP.
| * Optimizations to SymTree and transformMartin Odersky2012-08-202-85/+97
| | | | | | | | | | | | | | Two optimizations: (1) Make SymTree a class rather than a trait to allow faster access to symbol (2) Split itransform into several smaller methods and order cases according to expected frequency.
| * Specialize hashCode in TypeRef from the generic MurmurHashCode3 implementation.Martin Odersky2012-08-201-1/+15
| |
| * Moved five methods from LinearSeqOptimized to ListMartin Odersky2012-08-202-58/+56
| | | | | | | | | | | | | | | | Curiously, profiling showed that these methods (in particular map) got slower when specialized in LinearSeqOptimized from their generic impl in TraversableLike. I speculate that the virtual calls to head/tail/nonEmpty are more expensive than the closure creation which we save (Note that foreach IS specialized in List, so head/tail are monomorphic, even though isEmpty still has two implementations. If we confirm a speedup in this commit it would make sense to specialize more methods in LinearSeqOptimized again in List.
| * Don't allocate closure in List.hashCode.Grzegorz Kossakowski2012-08-201-1/+19
| | | | | | | | | | | | | | | | | | | | Provided specialized version of hashing algorithm for List that does not allocate the closure. This saves us 124k closures allocated in a compiler when compiling `Vector.scala` from std library. That's aroudn 5% of all closures allocated for that compiler run.
| * Rework synchronization scheme of `UndoLog` for performance.Grzegorz Kossakowski2012-08-202-21/+42
| | | | | | | | | | | | | | | | | | Introduced explicit locking mechanism that allows us to make public methods of `UndoLog` that take thunks as arguments final and thus `@inline`. Once inliner is able to cope with inlining methods with exception handlers we'll be able to get rid of significant (around 5%) number of thunk allocation.
| * Mark logging methods in `SymbolTable` with `@inline`.Grzegorz Kossakowski2012-08-201-2/+4
| | | | | | | | | | Those two methods contribute 2% of Function0 allocation when compiling `Vector.scala`.
| * Make Array creation more efficient in hot places.Grzegorz Kossakowski2012-08-203-1/+23
| | | | | | | | | | Overriden ClassTags in places where we allocate a lot of Arrays.
| * Optimizations to cut down on #closures createdMartin Odersky2012-08-209-31/+144
| | | | | | | | Driven by profile data.
| * Made hashCode a method on Type to avoid megamorphic dispatchMartin Odersky2012-08-205-105/+89
| | | | | | | | | | | | | | | | | | profiling data shows that accessing the hashCode field has a cost of about 10% of fully hot running times. We speculate that it's megamorphic dispatch which is costing us this much. Rewrote code so that UniqueType is not an abstract base class with the hashCode field. Also removed fingerPrinting bloom filter on findMember because it caused complexity and did not gain us anything accdoring to the tests. Made TypeVar an abstract case class to avoid extractor calls in TypeMap.
| * No longer uses generic hashCode in UniqueType, since case class hashCode is ↵Martin Odersky2012-08-201-1/+1
| | | | | | | | now the same and faster.
| * Optimization to atOwnerMartin Odersky2012-08-202-8/+16
| | | | | | | | Moved costly hashMap updates into SuperAccessors from general tree transformers and replaced by immutable map.
| * Replaced isTrivial lazy vals by custom scheme to save space.Martin Odersky2012-08-202-10/+43
| |
| * Optimizations of isTrivial fields and methodsMartin Odersky2012-08-201-8/+19
| |
| * More method splittingMartin Odersky2012-08-205-466/+591
| |
| * Method splitting for erasure, genJVM, parsers, scanners, uncurryMartin Odersky2012-08-206-557/+664
| | | | | | | | Also, added inlined List.foreach
| * Second part of typed1 optimizationMartin Odersky2012-08-201-280/+349
| | | | | | | | All cases factored out into separate methods. Cases ordered according to node frequency.
| * First half of typed1 reorganization, to make it smaller and faster.Martin Odersky2012-08-201-111/+141
| |
| * Splitting large methods into smaller ones.Martin Odersky2012-08-201-432/+482
| |
| * More method hoisting.Martin Odersky2012-08-2016-84/+113
| | | | | | | | | | Also avoided systematically to map (_.tpe) on parameters in favor of lazy val paramTypes.
| * Compilespeed improvements: Exists arguments and othersMartin Odersky2012-08-206-38/+111
|/ | | | | | | | | | | | It turns out that exists is not inlinable, even if put into List. We try to eliminate or hoist most closures passed to exists in Types. There are some other small improvements as well. -- (@gkossakowski): This commit contains also a fix to crasher prepared by @paulp. I squashed that commit and kept the test-case that came with it.
* Merge pull request #1159 from scalamacros/topic/cleanupJosh Suereth2012-08-1917-311/+261
|\ | | | | even more cleanup in Macros.scala
| * pull request feedbackEugene Burmako2012-08-196-101/+87
| |
| * cleanup for macroExpandEugene Burmako2012-08-1815-265/+229
| | | | | | | | | | | | | | | | | | | | | | | | | | Error reporting is moved to ContextErrors to disentangle stuff in Macros.scala. With logics and error reporting intertwined it was an awful mess. Exceptions are used for the same reason. Instead of threading failures through the code polluting it with options/ifs, I outline the success path. It worked much better for typedMacroBody, but I'm also happy with the resulting code of macroExpand. To me a major factor towards applicability of exceptions was that they are short-lived and that there might be max one error per domain, after which we unconditionally bail.
* | Merge pull request #1162 from paulp/aug19-scala-graphPaul Phillips2012-08-183-1/+7
|\ \ | | | | | | Fix for community build blocker.
| * | Fix for community build blocker.Paul Phillips2012-08-183-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | As two character bugfixes go, this was a doozy. I will forego elaborating at length and offer generic instructions for elucidation: % git log --grep=tpeHK
* | | Merge pull request #1161 from VladUreche/issue/5788-hackPaul Phillips2012-08-182-5/+5
|\ \ \ | |/ / |/| | SI-5788 correct test and symbol update
| * | SI-5788 correct test and symbol updateVlad Ureche2012-08-192-5/+5
|/ / | | | | | | | | | | Previously I thought it's fixed because I didn't include the correct testcase. Now it's the correct testcase and this prompted me to change the code a bit to make it work properly.
* | Merge pull request #1154 from hubertp/2.10.x-issue/5676-fixPaul Phillips2012-08-172-2/+2
|\ \ | | | | | | Use rawflags for checking FINAL flag.
| * | Use rawflags for checking FINAL flag.Hubert Plociniczak2012-08-172-2/+2
| | | | | | | | | | | | Partially reverts 18efdedfb97de7ca9f6