All Projects → gkossakowski → Scalac Aspects

gkossakowski / Scalac Aspects

Playground for instrumenting `scalac` using AspectJ.

Labels

Projects that are alternatives of or similar to Scalac Aspects

Gradle Kotlin Aspectj Weaver
A Gradle plugin that allows you to weave your compiled Java and Kotlin files with AspectJ
Stars: ✭ 14 (-66.67%)
Mutual labels:  aspectj
Androidaspectjexample
demo project releasing aspectJ environment
Stars: ✭ 23 (-45.24%)
Mutual labels:  aspectj
Automon
Automon combines the power of AOP (AspectJ) with monitoring or logging tools you already use to declaratively monitor your Java code, the JDK, and 3rd party libraries.
Stars: ✭ 548 (+1204.76%)
Mutual labels:  aspectj
Paonet
【MVVM+RxJava2+AspectJ】泡网第三方客户端,网站主页:http://www.jcodecraeer.com/index.php
Stars: ✭ 374 (+790.48%)
Mutual labels:  aspectj
Android Gradle Aspectj
gradle plug-in adding supports of AspectJ into Android project
Stars: ✭ 323 (+669.05%)
Mutual labels:  aspectj
Yan
使用Maven构建,整合Dubbo+Zookeeper+SpringMVC+Spring+MyBatis+Redis支持分布式的高效率便捷开发框架
Stars: ✭ 293 (+597.62%)
Mutual labels:  aspectj
T Mvp
Android AOP Architecture by Apt, AspectJ, Javassisit, based on Realm+Databinding+MVP+Retrofit+Rxjava2
Stars: ✭ 2,740 (+6423.81%)
Mutual labels:  aspectj
android-aop-analytics
Demo application that implements Google Analytics tracking in an aspect-oriented way using AspectJ.
Stars: ✭ 31 (-26.19%)
Mutual labels:  aspectj
metrics-aspectj
AspectJ integration for Dropwizard Metrics
Stars: ✭ 78 (+85.71%)
Mutual labels:  aspectj
Argusapm
Powerful, comprehensive (Android) application performance management platform. 360线上移动性能检测平台
Stars: ✭ 2,452 (+5738.1%)
Mutual labels:  aspectj
Fragmentrigger
💥A powerful library powered by AOP to manage Fragments.(一个基于AOP设计的Fragment管理框架)
Stars: ✭ 2,260 (+5280.95%)
Mutual labels:  aspectj
Photonoter
📓Material Design风格的开源照片笔记。(MVP+Dagger2+RxJava+AspectJ+Dex处理)
Stars: ✭ 1,592 (+3690.48%)
Mutual labels:  aspectj
Disid Proofs
DISID's repository of proofs of concept.
Stars: ✭ 120 (+185.71%)
Mutual labels:  aspectj
Crepecake
An compile-time aop engine like AspectJ but easier to use in android application development.
Stars: ✭ 103 (+145.24%)
Mutual labels:  aspectj
Androidlearn
Android Custom Views
Stars: ✭ 66 (+57.14%)
Mutual labels:  aspectj
S Mvp
🔥🔥优化版MVP,使用注解泛型简化代码编写,使用模块化协议方便维护,APT过程使用注解解析器利用JavaPoet🌝完成重复模块的编写,利用ASpect+GradlePlugin 完成横向AOP编程+Javassist动态字节码注入+Tinker实现热修复+Retrofit实现优雅网络操作+RxJava轻松玩转数据处理
Stars: ✭ 1,095 (+2507.14%)
Mutual labels:  aspectj

Playground for instrumenting scalac using AspectJ.

Exploration of the idea of instrumenting scalac with AspectJ. There are two main use cases for instrumentation of scalac:

  • debugging
  • profiling

Examples below focus mostly on profiling scalac. They help with identifying source files or even single lines causing unusually slow compilation times.

If your Scala code compiles slower than 500-600LoC/s then you might find this tool useful. You can count lines of code in your project with cloc.

Examples

Tracing where Symbols get created (TraceSymbol.aj)

This example implements the functionality @JamesIry tried to implement in scalac directly: https://github.com/scala/scala/pull/1756

To see it in action run

./scalac-aspects TraceSymbol.aj -DtraceSymbolIds=500,505 Foo.scala

Per-file timings (PerUnitTiming.aj)

This example shows how to bring back -Dscala.timings. See this discussion: https://groups.google.com/d/topic/scala-internals/ZCToaWda7tQ/discussion

To see it in action run

./scalac-aspects PerUnitTiming.aj Foo.scala

Type completion timings (TypeCompletionTiming.aj)

This example shows how to measure how much time is spent on calculating given type. The cool thing about it is that it also shows position in a file where given type is referred.

Too see it in action run

./scalac-aspects TypeCompletionTiming.aj Foo.scala

The cool thing is that scalac options work as expected. Try:

./scalac-aspects TypeCompletionTiming.aj -Yshow-symkinds Foo.scala

Typing timings (TypingTimings.aj)

The TypingTimings.aj has strictly more functionality (it collects more information) than the TypeCompletionTiming.aj but it's not an example of the best code.

I include it because it's powerful enough to discover real problem with compilation times. I used it for compiling Scala library and I discovered that some types take 0.25s to compute. If you are wondering, that'ts a lot.

Too see it in action run

./scalac-aspects TypingTimings.aj Foo.scala

Also, check out the little tool I created for post-processing data printed by this tool:

https://gist.github.com/4543164

Maven support

François Armand (@fanf) has a blog post showing how to use aspects mentioned above with Maven projects.

Scala versions supported

This project has been tested with Scala 2.10 and 2.11 compilers.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].