Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Various performance optimizations / experiments [ci: last-only] #5785

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 114 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
114 commits
Select commit Hold shift + click to select a range
dbefe29
Avoid List.apply in favor of ::
retronym Mar 9, 2017
6184561
Larger initial capacity for the uniques table
retronym Mar 11, 2017
19b51b1
Avoid overhead of dead code checking unless `-Ywarn-dead-code` is set
retronym Mar 15, 2017
b8d6928
Optimize isNumericSubclass
retronym Mar 12, 2017
861e4d8
Avoid List#length of targs if implicit pt is not a function symbol
retronym Mar 12, 2017
2110739
Avoid map lookup for fast track macros on every methodSig call
retronym Mar 13, 2017
f0f4b99
Avoid non-local return in typedSelect
retronym Mar 9, 2017
de0ae6d
Avoid BoxesRuntime.equals in Type.unique
retronym Mar 7, 2017
477b2d2
Avoid nonEmpty in hot paths
retronym Mar 9, 2017
5c02beb
Optimize Definitions.isXxxValueClass
retronym Mar 15, 2017
e6409b7
Optimize hot use of List#contains in TypeMaps
retronym Mar 15, 2017
d69a489
Optimize label defs finder in the backend
retronym Mar 15, 2017
3805b99
Optimize invokeDynamicLambda
retronym Mar 9, 2017
9414bcf
optimize makeLocal
retronym Mar 9, 2017
2adcc35
Delete IO intensive lookup of source file in output directory
retronym Mar 8, 2017
96289c5
Avoid excessive directory file stats during classfile writing
retronym Mar 15, 2017
f3cd589
Optimize symSource, symData, and Run#compiles
retronym Mar 15, 2017
acaeb29
Use AnyRefMap in synthetics
retronym Mar 15, 2017
00b0433
Use tree attachments, rather than a hashmap, for namer/typer handoff
retronym Mar 15, 2017
fc86029
Optimize UniquType#computeTypeRef
retronym Mar 15, 2017
c3b4fbf
Use AnyRefMap in labelReferences
retronym Mar 15, 2017
a27b8bd
Avoid needless work in the specialization info transform in the backend
retronym Feb 4, 2017
76bd6c4
Optimize case class namer
retronym Mar 9, 2017
02f2888
cache javaBinaryNameString
retronym Mar 13, 2017
5fcc639
Avoid findMember in early implicit candidate filtering.
retronym Mar 9, 2017
3d11686
Defer calling pt.members for in anon class typechecking
retronym Mar 9, 2017
1c8856f
conserve trees in Refchecks.transformStats / prefer map2 to zipped(f)…
retronym Mar 10, 2017
0799d8b
Reduce stack height
retronym Mar 7, 2017
80528a2
Optimize TypeRef#equals
retronym Mar 8, 2017
35df02c
Avoid going through unique for common TypeBounds
retronym Mar 9, 2017
55bd703
Avoid nasty LUB in pattern match
retronym Mar 9, 2017
9109728
Optimize primitiveOrClassToBType
retronym Mar 15, 2017
742576c
Use j.u.ConcurrentHashMap rather than TrieMap in hot path in backend
retronym Mar 15, 2017
70d53cd
Remove expensive assertion in the backend
retronym Mar 15, 2017
9f4d919
inline toList
retronym Mar 9, 2017
85fa38f
Collections microopts
retronym Mar 9, 2017
30a440a
Use identityhashmap
retronym Mar 10, 2017
5ad4c88
Avoid ##
retronym Mar 10, 2017
7fbd80f
Make -Ystatistics work without recompiling
retronym Mar 11, 2017
0e9e0f6
Try straight line search in baseTypeIndex
retronym Mar 13, 2017
77fc33e
Avoid specializion info transform.
retronym Mar 13, 2017
2cd5459
micro opt in treecopy
retronym Mar 13, 2017
008605f
avoid exponential cost of traversal in specialization
retronym Mar 13, 2017
1b3c9d3
avoid map lookup in backend if map is empty
retronym Mar 13, 2017
d479d65
Revert "Don't cache `MethodSymbol`'s `memberType`."
retronym Mar 9, 2017
deed06a
Lean on cache of SingleType in ModuleTypeRef
retronym Mar 9, 2017
b24cf13
Move dealiasing from Uncurry to Erasure
retronym Feb 6, 2017
ec3019d
Don't try to catch type errors in transform
retronym Mar 15, 2017
72feede
Avoid try/finally in some transforms
retronym Mar 15, 2017
ca6f1ae
Avoid try/catch/finally in RefChecks.transform
retronym Mar 15, 2017
0e8c291
Remove more try/catch/finally
retronym Mar 15, 2017
7a4e657
Resizable hashtable in Scopes
retronym Mar 10, 2017
72f1104
Optimize boundSyms
retronym Mar 15, 2017
84a8b52
Optimize isFunctionSymbol
retronym Mar 15, 2017
9d32526
Larger initial sizes for hot maps
retronym Mar 15, 2017
29bd4a6
Optimize uncurry info tranform
retronym Mar 15, 2017
010fec7
Optimize gen.mkAsInstanceOf
retronym Mar 15, 2017
e236c02
make loop tail recursive in allOverriddenSymbols
retronym Mar 15, 2017
b129fb4
fixup boundsyms
retronym Mar 16, 2017
6ba9eca
Optimize checkCompatibility
retronym Mar 16, 2017
c6c9be1
Fixup asInstanceOf TreeGen special case
retronym Mar 16, 2017
e6bc5cb
Optimize postErasure info transform
retronym Mar 16, 2017
7df44b2
Optimize type comparison around AnnotatedTypes
retronym Mar 16, 2017
d244967
Optimize Symbol#exists
retronym Mar 16, 2017
83e93e4
Breadcrumbs for the debugger
retronym Mar 16, 2017
6d5be16
Optimize copyTypeRef
retronym Mar 16, 2017
da3f5e5
Comment out assert in copyTypeRef
retronym Mar 16, 2017
ccac88b
Bypass typeRef in favour of TypeRef for non-member types
retronym Mar 16, 2017
fb597f2
Optimize IndexedSeqOptimized#toList
retronym Mar 16, 2017
da290fe
Async classfile writing
retronym Mar 16, 2017
32d6e24
4 threads in async classfile writer pool
retronym Mar 16, 2017
d82acbc
Use buffer when reading from ZipInflaterInputStream
retronym Mar 16, 2017
c2fa6ff
Use non-normalizing variant of Type#contains in isTrivial
retronym Mar 16, 2017
de1cf4d
Cache NoArgTypeRef#isHigherKinded
retronym Mar 16, 2017
c8b2d79
opt typedIDent
retronym Mar 16, 2017
6617f76
Refactor ExplicitOuter.transform to avoid Apply#symbol
retronym Mar 16, 2017
2dce658
Optimize isPossibleInRefinement
retronym Mar 16, 2017
d68114b
Avoid calling member type in futile check if we match NoSymbol
retronym Mar 16, 2017
a82efd7
Try moving TypeComparers into a class methods, rather than trait methods
retronym Mar 16, 2017
4437fef
Optimize SpecializeTypes#satisfiable
retronym Mar 16, 2017
582b480
Optimize method descriptor creation
retronym Mar 17, 2017
a9b357e
dont unique types containig type vars
retronym Mar 17, 2017
8bead48
Opt specializedSym, special case for WildCardType
retronym Mar 17, 2017
4061020
More direct implementation of Transformers
retronym Mar 19, 2017
c34298e
Optimize specializedTypeVars
retronym Mar 20, 2017
61230d3
Add TODO comment
retronym Mar 20, 2017
c3b94f9
Fixup specialization info transform
retronym Mar 20, 2017
db77efe
Only do specialation definalization once per run
retronym Mar 20, 2017
6153916
Short circuit specialization transform when no ancestors mention @spe…
retronym Mar 15, 2017
410bff4
Fixup: Optimize method descriptor creation
retronym Mar 21, 2017
7fb59a9
Fixup^2 asInstanceOf TreeGen special case
retronym Mar 22, 2017
b73315e
Revert "Optimize Symbol#exists"
retronym Mar 22, 2017
c5b2f44
Revert "Use identityhashmap"
retronym Mar 22, 2017
20c99f5
Fixup "Don't try to catch type errors in transform"
retronym Mar 23, 2017
8b67214
Decompose implicit pt in to function arity in advance of checkCompati…
retronym Mar 24, 2017
41e5e8a
Revert "Larger initial capacity for the uniques table"
retronym Mar 24, 2017
abb4794
Revert "Reduce stack height"
retronym Mar 24, 2017
ac74765
Revert "Make -Ystatistics work without recompiling"
retronym Mar 24, 2017
19b8318
Revert "avoid map lookup in backend if map is empty"
retronym Mar 24, 2017
40eb235
Revert "Refactor ExplicitOuter.transform to avoid Apply#symbol"
retronym Mar 24, 2017
8a74c99
fixup Opt specializedSym, special case for WildCardType
retronym Mar 24, 2017
4a7f1af
Revert "Try moving TypeComparers into a class methods, rather than tr…
retronym Mar 24, 2017
640abc4
Reduce memory pressure of ::
retronym Mar 26, 2017
d29e651
Lazily load symbols references in java throws clauses
retronym Mar 26, 2017
1dacfbc
fixup
retronym Mar 27, 2017
07fdeb8
fixup debug println
retronym Mar 27, 2017
4a7eb36
Optimize java generic sig generation
retronym Mar 27, 2017
9ad2551
Route around type interning for unpickling reading monomorphic types
retronym Mar 27, 2017
15071cb
Optimize empty AnyRefMap#getOrElse
retronym Mar 27, 2017
bb48b28
fixup sameElementEquals
retronym Mar 27, 2017
df924f4
temp untailrec
retronym Mar 27, 2017
79efd96
temp: disable hash improvement
retronym Mar 27, 2017
a749377
untemp: retailrec
retronym Mar 27, 2017
64ae5a2
Optimize DesugaredParameterType
retronym Mar 27, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
temp: disable hash improvement
  • Loading branch information
retronym committed Mar 27, 2017
commit 79efd96506f5231b6ec94b924d6a62f1e855f0b9
21 changes: 9 additions & 12 deletions 21 src/reflect/scala/reflect/internal/util/WeakHashSet.scala
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package scala
package reflect.internal.util

import java.lang.ref.{WeakReference, ReferenceQueue}
import java.lang.ref.{ReferenceQueue, WeakReference}

import scala.annotation.tailrec
import scala.collection.mutable.{Set => MSet}
import scala.util.hashing.MurmurHash3

/**
* A HashSet where the elements are stored weakly. Elements in this set are eligible for GC if no other
Expand Down Expand Up @@ -64,19 +66,13 @@ final class WeakHashSet[A <: AnyRef](val initialCapacity: Int, val loadFactor: D
* find the bucket associated with an element's hash code
*/
private[this] def bucketFor(hash: Int): Int = {
// spread the bits around to try to avoid accidental collisions using the
// same algorithm as java.util.HashMap
var h = hash
h ^= h >>> 20 ^ h >>> 12
h ^= h >>> 7 ^ h >>> 4

// this is finding h % table.length, but takes advantage of the
// fact that table length is a power of 2,
// if you don't do bit flipping in your head, if table.length
// is binary 100000.. (with n 0s) then table.length - 1
// is 1111.. with n 1's.
// In other words this masks on the last n bits in the hash
h & (table.length - 1)
hash & (table.length - 1)
}

/**
Expand Down Expand Up @@ -180,20 +176,21 @@ final class WeakHashSet[A <: AnyRef](val initialCapacity: Int, val loadFactor: D
elem
}

def linkedListLoop(entry: Entry[A]): A = entry match {
def linkedListLoop(entry: Entry[A], depth: Int): A = entry match {
case null => add()
case _ => {
val entryElem = entry.get
if (elem.equals(entryElem)) entryElem
else {
val result = linkedListLoop(entry.tail)
result.getClass
val result = linkedListLoop(entry.tail, depth + 1)
if (depth > 0)
result.getClass
result
}
}
}

linkedListLoop(oldHead)
linkedListLoop(oldHead, 0)
}
}

Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.