Comments (13)
#1034 の修正でこの問題はほとんど解消されると思います。
リリースされたらお試しください。
もし問題が解決されないようであればこのissueを再度オープンにしたいと思います。
from doma.
対応ありがとうございます!こちらでも確認しました。
きちんと計測していませんが、Java8の時と比較するとまだ少し遅く感じるものの、対応前と比較すると明らかにビルド時間が短くなっていることが確認できました。
from doma.
最近Eclipseを使っていないので見当違いなことを言っていたらすみません。
Eclipseから「Project > Clean... > Start a build immediately」を行う。
この時はEclipse内のコンパイラを使ってビルドが行われGradleは使われない認識です。少なくともEclpse 2020-03くらいまではそのような挙動でした。しかし、Eclipse 2023-09ではEclpseからGradleが呼ばれビルドされるということでしょうか?
このため、Eclipseの問題である気はしています。
私もそんな気がします。
Eclipseに十分なメモリを割り当てたら問題は改善されないでしょうか?
from doma.
回答ありがとうございます!
この時はEclipse内のコンパイラを使ってビルドが行われGradleは使われない認識です。少なくともEclpse 2020-03くらいまではそのような挙動でした。しかし、Eclipse 2023-09ではEclpseからGradleが呼ばれビルドされるということでしょうか?
いえ、最近のEclipseでもビルドの仕組みは変わっていないと思います。
「Project > Clean... > Start a build immediately」の手順は、単純に「クリーンビルドをしている=一番時間がかかる時」を言いたかったまでです。
Eclipseに十分なメモリを割り当てたら問題は改善されないでしょうか?
現在は、-Xmx4g
を指定しています。
8GBまで増やしてみたんですが、状況変わらずでした。
from doma.
いえ、最近のEclipseでもビルドの仕組みは変わっていないと思います。
「Project > Clean... > Start a build immediately」の手順は、単純に「クリーンビルドをしている=一番時間がかかる時」を言いたかったまでです。
なるほど。だとすると、再現手順に記載いただいた「build.gradle の sourceCompatibility targetCompatibility を変更する。」との関係はどうなりますか?「Project > Clean... > Start a build immediately」は、build.gradleの設定を見て動作しているのかしていないかどちらですか?
現象が再現する環境を共有してもらうことは可能でしょうか?Eclipseの設定ファイルが含まれた状態でいただきたいです。
from doma.
なるほど。だとすると、再現手順に記載いただいた「build.gradle の sourceCompatibility targetCompatibility を変更する。」との関係はどうなりますか?「Project > Clean... > Start a build immediately」は、build.gradleの設定を見て動作しているのかしていないかどちらですか?
分かりづらくて申し訳ないです。
- build.gradleを変更し、
- 「Gradle > Refresh Gradle Project」でBuildshipを動かし、変更内容をEclipseの設定ファイルに反映し、
- Eclipseからクリーンビルドを行う。
という手順ですので、build.gradleの設定は間接的に見ている認識です。
現象が再現する環境を共有してもらうことは可能でしょうか?Eclipseの設定ファイルが含まれた状態でいただきたいです。
計測に使ったDAOが外に出せないものを使っているので、すぐには共有できないですが少し検討させてください。
いったん、Eclipseの設定ファイルだけ貼らせてください。(ほぼデフォルト設定のはずです)
また、build.gradleも貼らせていただきます。余計な依存関係が一部含まれてしまっていますが、ご容赦ください。
.classpath
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="bin/main" path="src/main/java">
<attributes>
<attribute name="gradle_scope" value="main"/>
<attribute name="gradle_used_by_scope" value="main,test"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="bin/main" path="src/main/resources">
<attributes>
<attribute name="gradle_scope" value="main"/>
<attribute name="gradle_used_by_scope" value="main,test"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="bin/test" path="src/test/java">
<attributes>
<attribute name="gradle_scope" value="test"/>
<attribute name="gradle_used_by_scope" value="test"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="bin/main" path=".apt_generated"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11/"/>
<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
<classpathentry kind="src" output="bin/test" path=".apt_generated_tests">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="bin/default"/>
</classpath>
.factorypath
<factorypath>
<factorypathentry kind='EXTJAR' id='/Users/kinoue/.gradle/caches/modules-2/files-2.1/org.seasar.doma/doma-processor/2.54.2/b95d49ba0cc1d0806d859adaed5cff2bd174cfd/doma-processor-2.54.2.jar' enabled='true' runInBatchMode='false' />
<factorypathentry kind='EXTJAR' id='/Users/kinoue/.gradle/caches/modules-2/files-2.1/org.seasar.doma/doma-core/2.54.2/b9e06221ca2d0786cc4a08ee858b8250b4a5ad29/doma-core-2.54.2.jar' enabled='true' runInBatchMode='false' />
</factorypath>
.project
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>all-tables</name>
<comment>Project all-tables created by Buildship.</comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.springframework.ide.eclipse.boot.validation.springbootbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
</natures>
</projectDescription>
.settings/org.eclipse.buildship.core.prefs
arguments=
auto.sync=false
build.scans.enabled=false
connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER)
connection.project.dir=
eclipse.preferences.version=1
gradle.user.home=
java.home=
jvm.arguments=
offline.mode=false
override.workspace.settings=true
show.console.view=false
show.executions.view=false
.settings/org.eclipse.jdt.apt.core.prefs
eclipse.preferences.version=1
org.eclipse.jdt.apt.aptEnabled=true
org.eclipse.jdt.apt.genSrcDir=.apt_generated
org.eclipse.jdt.apt.genTestSrcDir=.apt_generated_tests
org.eclipse.jdt.apt.reconcileEnabled=true
.settings/org.eclipse.jdt.core.prefs
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=11
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.processAnnotations=enabled
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=11
.settings/org.springframework.ide.eclipse.prefs
boot.validation.initialized=true
eclipse.preferences.version=1
build.gradle
def jdkVersion = 11
def domaVersion = '2.54.2'
def lombokVersion = '1.18.30'
def springBootVersion = '2.7.18'
repositories {
mavenCentral()
}
apply plugin: 'java'
sourceCompatibility = targetCompatibility = jdkVersion
dependencies {
implementation "org.seasar.doma:doma-core:${domaVersion}"
annotationProcessor "org.seasar.doma:doma-processor:${domaVersion}"
runtimeOnly 'com.mysql:mysql-connector-j:8.2.0'
compileOnly "org.projectlombok:lombok:${lombokVersion}"
annotationProcessor "org.projectlombok:lombok:${lombokVersion}"
implementation 'com.google.code.gson:gson:2.10.1'
implementation "org.springframework.boot:spring-boot-starter-web:${springBootVersion}"
implementation "org.springframework.boot:spring-boot-starter-validation:${springBootVersion}"
}
apply plugin: 'eclipse'
eclipse {
classpath {
file.whenMerged {
entries << new org.gradle.plugins.ide.eclipse.model.SourceFolder(".apt_generated", "bin/main")
}
}
}
eclipseJdt {
task doLast {
file('.factorypath').withWriter { writer ->
def domaCoreJar = configurations.annotationProcessor.copy().find { it.name.startsWith('doma-core-2') }
def domaProcessorJar = configurations.annotationProcessor.copy().find { it.name.startsWith('doma-processor-2') }
new groovy.xml.MarkupBuilder(writer).factorypath() {
factorypathentry(kind:'EXTJAR', id:domaProcessorJar, enabled:true, runInBatchMode:false)
factorypathentry(kind:'EXTJAR', id:domaCoreJar, enabled:true, runInBatchMode:false)
}
}
}
}
def domaResources = ['doma.compile.config', 'META-INF/**/*.sql', 'META-INF/**/*.script']
task copyDomaResources(type: Copy) {
from sourceSets.main.resources.srcDirs
into compileJava.destinationDir
include domaResources
}
compileJava.dependsOn copyDomaResources
processResources.exclude domaResources
from doma.
共有ありがとうございます。再現ができました。
また、本現象の回避方法も見つけました。
Enable processing in editorのオプションをOFFにしてみてください。
私の環境ではこれでパフォーマンスが向上しました。
from doma.
ご確認ありがとうございます。
私の環境でも設定を変えて計測してみたところ、Java8での性能には及ばないものの改善が見られました。
Java8 + オプションON = 約10秒
Java11 + オプションON = 約440秒
Java11 + オプションOFF = 約240秒
無茶を承知でお聞きするのですが、他に改善策に心当たりはありませんでしょうか?
Java8時と比較すると改善後でもそれなりの時間がかかっているため、出来ることがあればやりたいと考えています。
from doma.
改善策と言えるかはわかりませんが、Eclipseの開発者に尋ねてみるのが良いと思います。
質問なのですが、パフォーマンスの問題はDomaのAnnotation Processorだけで顕在化していますか?Lombokをお使いのようですがLombokのAnnotation Processorでは問題になりませんか?
from doma.
ワークアラウンドとしては、Domaの注釈処理が必要なEntityやDaoを別プロジェクトに切り出してそのプロジェクトはJava 8でビルドし、その他のプロジェクトはJava 11でビルドするなどとしても良いかもしれません。
from doma.
やはりこれ以上は本家に聞いてみるしかないですよね。。
少しハードルが高めなので、教えていただいた緩和策で様子を見つつ、どうしても待てないなら考えてみたいと思います。
提示いただいたワークアラウンドも、ソース量を考えると少し難しいですが、選択肢として頭に入れておきます。
質問なのですが、パフォーマンスの問題はDomaのAnnotation Processorだけで顕在化していますか?Lombokをお使いのようですがLombokのAnnotation Processorでは問題になりませんか?
試していなかったので、lombokのアノテーションを消し依存もなくしてEclipseからクリーンビルドを行ってみました。
結果、ビルド時間は変わらなかったので、lombokでは問題になっていないと言えそうです。
from doma.
lombokでは問題になっていないのですね。ご回答ありがとうございます。
from doma.
v2.55.0としてリリース済みです。
https://github.com/domaframework/doma/releases/tag/2.55.0
from doma.
Related Issues (20)
- MySQLのSelectOptioins.countで`SELECT COUNT`に変える方法はありますか? HOT 2
- SelectOptionsでソートしたい HOT 4
- 2.53.3以降でDomainConverterにenumを指定するとコンパイルエラーが発生する HOT 4
- Prevent prepareIdValue if ignoreGeneratedKeys is true HOT 4
- DOMA4084 error occurs when including the Embeddable class HOT 5
- Support java.time.Instant and java.util.UUID types HOT 2
- 一つ項目を抽出して、かつこの項目がNULLの場合、取得できません。 HOT 1
- ( is missing when generating insert sql into auto_increment column only table HOT 2
- Some NativeSQL set queryTimeout to fetchSize HOT 1
- Criteria Apiについて、leftJoinの条件の書き方 HOT 2
- left joinについて HOT 6
- [Security] Workflow gradle-wrapper-validation.yml is using vulnerable action gradle/wrapper-validation-action
- Missing limit, offset words when select with top level `WITH` word HOT 4
- Criteria APIにて、タプルを使ったIN述語を3項目以上で使用する方法を教えてほしい HOT 1
- Criteria APIにて、タプルを使ったIN述語を3項目以上で使用する方法を教えてほしい HOT 3
- MySQLでSelectOptioinsでlimit 0を指定するとlimit 0, 18446744073709551615のSQLが作成される HOT 2
- Criteria APIでページングを実装するとき、絞り込み前の総件数を取得する方法はありますか? HOT 1
- OriginalState comparing BigDecimal by using equals HOT 1
- Doma APT module-info.java is missing `provides javax.annotation.processing.Processor` HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from doma.