Skip to content
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

Create blog/ component in antora docsite #4151

Merged
merged 10 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
8 changes: 8 additions & 0 deletions blog/antora.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: blog
title: Mill Blog
version: ~
nav:
- modules/ROOT/nav.adoc
asciidoc:
attributes:
mill-version: dummy-mill-version
2 changes: 2 additions & 0 deletions blog/modules/ROOT/nav.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

* xref:java-compile.adoc[]
9 changes: 9 additions & 0 deletions blog/modules/ROOT/pages/index.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Mill Build Tool Development Blog

Welcome to the Mill development blog! This page contains posts and articles on
technical topics related to the development of the Mill build tool. These discuss
topics related to JVM languages and monorepo build tooling.

include::java-compile.adoc[tag=header,leveloffset=1]

xref:java-compile.adoc[Read More...]
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
// tag::header[]

# How Fast Does Java Compile?
:page-aliases: xref:mill:ROOT:comparisons/java-compile.adoc

_Li Haoyi, 29 November 2024_
Copy link
Member

@lefou lefou Dec 17, 2024

Choose a reason for hiding this comment

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

Suggested change
:page-aliases: xref:mill:ROOT:comparisons/java-compile.adoc
_Li Haoyi, 29 November 2024_
:page-aliases: xref:mill:ROOT:comparisons/java-compile.adoc
:author: Li Haoyi
:revdate: 29 November 2024

Copy link
Member

Choose a reason for hiding this comment

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

Don't know, it they already render as you want, but these a the default attributes to use. They are also used in document/HTML meta data.

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

Do you know if the :author: and :revdate: attributes get shown anywhere? Otherwise we'll have to include it in the text manually anyway

Copy link
Member

Choose a reason for hiding this comment

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

It depends on the template that Antora uses. I haven't checked yet. If you need to include it manually, you should keep the tags and refer to them with {author} and {revdate}.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ended up doing the {author} {revdate} thing


include::partial$gtag-config.adoc[]
include::mill:ROOT:partial$gtag-config.adoc[]

Java compiles have the reputation for being slow, but that reputation does
not match today's reality. Nowadays the Java compiler can compile "typical" Java code at over
Expand All @@ -24,6 +29,8 @@ all build tools fall short of how fast compiling Java _should_ be. This post exp
these numbers were arrived at, and what that means in un-tapped potential for Java build
tooling to become truly great.

// end::header[]

## Mockito Core

To begin to understand the problem, lets consider the codebase of the popular Mockito project:
Expand Down Expand Up @@ -291,8 +298,8 @@ Tabulating this all together gives us the table we saw at the start of this page
| Gradle | 4.41s | 9,400 | 15.2x | Maven | 4.89s | 6,100 | 16.9x
|===

We explore the comparison between xref:comparisons/gradle.adoc[Gradle vs Mill]
or xref:comparisons/maven.adoc[Maven vs Mill] in more detail on their own dedicated pages.
We explore the comparison between xref:mill:ROOT:comparisons/gradle.adoc[Gradle vs Mill]
or xref:mill:ROOT:comparisons/maven.adoc[Maven vs Mill] in more detail on their own dedicated pages.
For this article, the important thing is not comparing the build tools against each other,
but comparing the build tools against what how fast they _could_ be if they just used
the `javac` Java compiler directly. And it's clear that compared to the actual work
Expand All @@ -307,8 +314,8 @@ we explored above only deals with compiling a single small module. But a similar
Clean Compile* benchmarks which compiles the entire Mockito and Netty projects on
a single core shows similar numbers for the various build tools:

* xref:comparisons/gradle.adoc#_sequential_clean_compile_all[Gradle compiling 100,000 lines of Java at ~5,600 lines/s]
* xref:comparisons/maven.adoc#_sequential_clean_compile_all[Maven compiling 500,000 lines of Java at ~5,100 lines/s]
* xref:mill:ROOT:comparisons/gradle.adoc#_sequential_clean_compile_all[Gradle compiling 100,000 lines of Java at ~5,600 lines/s]
* xref:mill:ROOT:comparisons/maven.adoc#_sequential_clean_compile_all[Maven compiling 500,000 lines of Java at ~5,100 lines/s]
* Mill compiling at ~25,000 lines/s on both the above whole-project benchmarks

All of these are far below the 100,000 lines/s that we should expect from Java compilation,
Expand Down Expand Up @@ -342,7 +349,7 @@ compiling Java_ is pure overhead. Checking for cache invalidation in _shouldn't_
as long as actually compiling your code. I mean it obviously does _today_, but it _shouldn't_!

The Mill build tool goes to great lengths to try and minimize overhead, and already gets
xref:comparisons/why-mill.adoc#_performance[~4x faster builds] than Maven or Gradle on
xref:mill:ROOT:comparisons/why-mill.adoc#_performance[~4x faster builds] than Maven or Gradle on
real-world projects like Mockito or Netty. But there still is a long way to go give Java
developers the fast, snappy experience that the underlying Java platform can provide. If
Java build and compile times are things you find important, you should try out Mill on
Expand Down
1 change: 0 additions & 1 deletion docs/modules/ROOT/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
** xref:comparisons/gradle.adoc[]
** xref:comparisons/sbt.adoc[]
** xref:comparisons/unique.adoc[]
** xref:comparisons/java-compile.adoc[]
* The Mill CLI
** xref:cli/installation-ide.adoc[]
** xref:cli/flags.adoc[]
Expand Down
4 changes: 4 additions & 0 deletions docs/package.mill
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ object `package` extends RootModule {
os.write.over(dest / "antora.yml", (lines ++ newLines).mkString("\n"))
}

def blogFolder = Task.Source(build.millSourcePath / "blog")
def githubPagesPlaybookText(authorMode: Boolean) = T.task { extraSources: Seq[os.Path] =>
val taggedSources = for (path <- extraSources) yield {
s""" - url: ${build.baseDir}
Expand All @@ -226,6 +227,9 @@ object `package` extends RootModule {
|
| - url: ${build.baseDir}
| start_path: ${devAntoraSources().path.relativeTo(build.baseDir)}
|
| - url: ${build.baseDir}
| start_path: ${blogFolder().path.relativeTo(build.baseDir)}
|ui:
| bundle:
| url: https://gitlab.com/antora/antora-ui-default/-/jobs/artifacts/master/raw/build/ui-bundle.zip?job=bundle-stable
Expand Down
Loading