Comments (15)
This is interesting. Could you give me a ballpark of how any parcel annotated classes you're working with?
from parceler.
Basically something like this: https://github.com/doniwinata0309/build-perf-test/blob/test/parceler/androidAppModule1/src/main/java/com/tes1.java
But some are more complex and extending from few parents, also contains field from custom object.
I just created 300+ dummy parcel class on this project
https://github.com/doniwinata0309/build-perf-test/tree/test/parceler
That will produce this flamegraph
android_build-6.7-flames.svg.zip
So it seems this process that taking so long
https://github.com/johncarl81/transfuse/blob/master/transfuse-support/src/main/java/org/androidtransfuse/transaction/CodeGenerationScopedTransactionWorker.java#L49
from parceler.
Right, ok... looking at it deeper, it looks like it's taking a long time to flush the FileOutputStream to disk. Not sure if we'll be able to do anything about this.
A while ago we implemented incremental processing to the annotation processor - does it take this long every time, or only on the first clean build?
from parceler.
Our Incremental build doing pretty well, we only got issue for clean/full build.
I see, it seems the huge number of input and disk IO speed that made it slower. Especially when there are several workers working in the same time. Normally 1 module may take 2 minute to complete, but when they are compiled in parallel (we set 5 workers can run in parallel) it will takes 4 minutes for each module to complete.
Do you think we can do something with FileOutputStream under JCodeModel library by modifying tranfuse library ? perhaps i can try some approach mentioned here: https://stackoverflow.com/a/20555164 or https://www.oracle.com/technical-resources/articles/javase/perftuning.html
from parceler.
Would buffering do the trick then? - maybe just wrap the given OutputStream here with BufferedOutputStream
?
from parceler.
possibly, i will try to modify it a little bit later. thank you for pointing that out.
If you also have some alternative please let me know, i will love to try it
from parceler.
I tried to modify it https://github.com/johncarl81/transfuse/blob/master/transfuse-core/src/main/java/org/androidtransfuse/gen/FilerSourceCodeWriter.java#L53
to this code:
int bufferSize = 8 * 1024;
OutputStream os = new BufferedOutputStream(
resource.openOutputStream(),
bufferSize
);
But the issue not fixed.
From this class:
https://github.com/johncarl81/transfuse/blob/master/transfuse-support/src/main/java/org/androidtransfuse/transaction/CodeGenerationScopedTransactionWorker.java#L49
But how FilerSourceCodeWriter used in that file ? It seems use CodeWriter instead FilerSourceCodeWriter right ?
from parceler.
ah sorry, it does use the FilerSourceCodeWriter, just realise it extending that class and i saw method printed in the flamegraph
from parceler.
from parceler.
There may be no way around it. I'll try to fire it up on my machine to see how slow it is on different hardware.
from parceler.
There is new issue to adress this, we can try to use JavaFileObject.openWriter as alternative. I will try it next week.
from parceler.
hi @johncarl81
johncarl81/transfuse#234
this PR solve my issue and my build is faster now (sorry after few times rerun the scenario on CI and local, seems the build speed is pretty much the same with old parceler). However, the parceler annotation cpu usage now less than dagger and databinding.
do you mind to check it later ? thanks
from parceler.
Can we close @doniwinata0309 ?
from parceler.
yes thank you. is it going to delivered on next release of parceler (1.1.14 i guess) ?
from parceler.
Yes
from parceler.
Related Issues (20)
- Ability to treat reflection warnings as errors HOT 5
- Parceler fails when used with with Lifecycle-viewmodel 2.2.0 HOT 7
- Facing Vulnerabilities in parceler library HOT 1
- Facing Vulnerabilities in parceler library HOT 1
- Polymorphism documentation not updated? HOT 6
- Cannot get working with navigation graph HOT 1
- Crashing on background HOT 4
- Unable to find generated Parcelable class HOT 1
- error: Parceler: Code generation did not complete successfully. HOT 47
- Cant find class to parcel ! HOT 1
- Can't generate code HOT 3
- Unable to Marshall with Parceler HOT 2
- Errors in HashMap$$PackageHelper HOT 3
- cannot running with kapt HOT 1
- Parceler: Code generation did not complete successfully. org.parceler.transfuse.transaction.TransactionRuntimeException: Encountered ErrorType <error>, unable to recover HOT 4
- [Request Feature] Support for Kotlin Symbol Processing
- Parceler code generation fails on AS 2023.3.1
- Getters and Setter Alphabetically Order for Write and Read
- Not sure how to convert a Cursor
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 parceler.