Skip to content

Conversation

@nicolasstucki
Copy link
Contributor

Initializing NumericRange instances is expensive due to the implicit class tags used.

@nicolasstucki
Copy link
Contributor Author

test performance please

@dottybot
Copy link
Member

dottybot commented Oct 8, 2017

performance test scheduled: 3 job(s) in queue, 1 running.

@dottybot
Copy link
Member

dottybot commented Oct 8, 2017

Performance test finished successfully:

Visit http://dotty-bench.epfl.ch/3289/ to see the changes.

Benchmarks is based on merging with master (badc855)

Copy link
Contributor

@odersky odersky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise LGTM

val argParams =
for (i <- List.range(1, arity + 1)) yield
enterTypeParam(cls, paramNamePrefix ++ "T" ++ i.toString, Contravariant, decls)
val argParams = List.tabulate(arity) { i =>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename to argParamRefs?

val startOffset = source.offsetToLine(start)
val endOffset = source.offsetToLine(end + 1)
if (startOffset >= endOffset) line :: Nil
else List.tabulate(endOffset - startOffset)(i => i + startOffset)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing the offset to add it back is confusing, I would just keep the original code here since it shouldn't be performance-sensitive, or do (startOffset to endOffset).toList maybe.

@odersky odersky merged commit cf4fda9 into scala:master Oct 9, 2017
@allanrenucci allanrenucci deleted the remove-numeric-ranges branch December 14, 2017 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants