Skip to content

Better logging #33

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 2 commits into from
Closed

Better logging #33

wants to merge 2 commits into from

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Mar 3, 2014

Review by DarkDimius.

It would be good to get the order of files compiled next time dotc-config fails.

odersky added 2 commits March 3, 2014 11:19
1) max constraint is now printed via typr printer, does not clog the output unless typr is set.
2) running a frontend phase informs what is run on which unit under -verbose.
Reason is we want to find out in what order files were compiled when a failure occurs.
@odersky
Copy link
Contributor Author

odersky commented Mar 3, 2014

I meant review by @DarkDimius @samuelgruetter

@samuelgruetter
Copy link
Contributor

Not really related to the changes of this PR, but to the topic "better logging" (I found this when inspecting this PR): In Reporting, the def traceIndented[T](question: => String, printer: Printers.Printer = Printers.default, show: Boolean = false) method uses the printer argument only as a boolean to decide whether to print or not, but it prints to the context instead of printing to the provided Printer, so printing on context and printing on Printer is mixed in a confusing way...

@DarkDimius
Copy link
Contributor

@odersky I'm not sure if we should keep this verbose mode enabled in master. It will be just polluting log after being fixed.

I've restarted travis build once again and it failed. See log https://travis-ci.org/lampepfl/dotty/builds/19964435

@odersky
Copy link
Contributor Author

odersky commented Mar 3, 2014

Agree we can retract the tests commit. I minimized the problem now. See

#34

@odersky odersky closed this Mar 3, 2014
noti0na1 added a commit to noti0na1/dotty that referenced this pull request Oct 28, 2019
Detect NotNull Annotations for Java Methods
odersky referenced this pull request in dotty-staging/dotty Jun 10, 2022
Some tests by Matt had cases where `.nn` figured prominently in the flamegraph.
I optimized it so that the fast path is streamlined and inlined.

In the following test code:
```

  def x: String | Null = "abc"
  val y = x.nn
```
the new implementation is
```
      10: getstatic     #20                 // Field MODULE$:LTest$;
      13: invokevirtual #24                 // Method x:()Ljava/lang/String;
      16: astore_0
      17: getstatic     #29                 // Field scala/runtime/Scala3RunTime$.MODULE$:Lscala/runtime/Scala3RunTime$;
      20: aload_0
      21: invokevirtual #33                 // Method scala/runtime/Scala3RunTime$.nn:(Ljava/lang/Object;)Ljava/lang/Object;
      24: checkcast     #35                 // class java/lang/String
      27: putstatic     #37                 // Field y:Ljava/lang/String;
```
The previous implementation was two bytes shorter, but contained in the critical path

 - A call to a ScalaRuntime method, which was not inlineable by the JIT compiler due to its size,
 - A conversion of a cmparison to a Boolean value (not sure this matters)
 - A cast from the return type `Object` to the actual type.
bishabosha referenced this pull request in dotty-staging/dotty Oct 18, 2022
Some tests by Matt had cases where `.nn` figured prominently in the flamegraph.
I optimized it so that the fast path is streamlined and inlined.

In the following test code:
```

  def x: String | Null = "abc"
  val y = x.nn
```
the new implementation is
```
      10: getstatic     #20                 // Field MODULE$:LTest$;
      13: invokevirtual #24                 // Method x:()Ljava/lang/String;
      16: astore_0
      17: getstatic     #29                 // Field scala/runtime/Scala3RunTime$.MODULE$:Lscala/runtime/Scala3RunTime$;
      20: aload_0
      21: invokevirtual #33                 // Method scala/runtime/Scala3RunTime$.nn:(Ljava/lang/Object;)Ljava/lang/Object;
      24: checkcast     #35                 // class java/lang/String
      27: putstatic     #37                 // Field y:Ljava/lang/String;
```
The previous implementation was two bytes shorter, but contained in the critical path

 - A call to a ScalaRuntime method, which was not inlineable by the JIT compiler due to its size,
 - A conversion of a cmparison to a Boolean value (not sure this matters)
 - A cast from the return type `Object` to the actual type.
szymon-rd added a commit that referenced this pull request Dec 9, 2022
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.

3 participants