Is there some way to automatically run a pre- and post-build script in Flash Builder/Eclipse to track the amount of time spent compiling throughout the day? Basically I'd want something like this:
Pre-Build: Output timestamp to file (or set some sort of Eclipse variable, if possible)
Post-Build: Read starting timestamp from file, subtract from current timestamp, append this build time to another file (or add to a running total)
The idea is that I can track how much time I spend throughout the day just waiting for my project to compile, to make a case for the product team to spend some time improving build times, as it would end up saving us time in the long-run.
It seems like I might be able to do this with Flex Ant Tasks, but 1) I've never set up a Flex Ant Task, so I'm not sure how, and 2) coming from the world of Visual Studio, it seems like there'd be some easy way to set scripts to run before and after compilation.
I know this probably doesn't work either (since it requires ant-contrib), but we use the "Stopwatch" task of ant-contrib.
http://ant-contrib.sourceforge.net/tasks/tasks/
Also, ant-contrib has some other very useful features like:
if
for
foreach
PropertyRegex
Variable
Example of the end of our build scripts:
BUILD SUCCESSFUL
Total time: 37 minutes 46 seconds
[timestamp]: Build started on: Sat Aug 31 06:05:50 PDT 2013
[timestamp]: Build completed on: Sat Aug 31 06:43:35 PDT 2013
[timestamp]: Total Build Time: 37 Min 45 seconds
Finished: SUCCESS
Related
Hi working on Production Model where I am working in shifts( 8:00AM to 4:30PM) and the requirement is that work should be done in one shift only otherwise shift it to next day. so for example lets say my agent enter the service block at 4:00 PM and shift end at 4:30 PM, the average time require to complete this task is 3hours, What I want to do is to check the available time and if time is not sufficient ( like in this case i have only 30 mins) the agent should be sent to waiting area and next day service block should start working on that agent first.
One way: Add A SelectOutput block ahead of the Service. In the condition, check
mySchedule.getTimeOfNextValue() - time() > x
Where x is the remaining time window you allow, i.e. the task duration the agent will require once entering the servive.
If there is not enough x left, you send the agent to some Wait block, else they are allowed to enter
PS: Also check the other functions that Schedule allows, might be you need some of them. Always check all capabilities a block offers you via code-complete (ctrl+space or Option+space on Mac)
Working with the source code from AOSP, after I make a trivial change to a
source file under frameworks/base/core/java/android/,
mmm frameworks/base -j9 takes about 4 minutes.
A large portion of that time seems to be waiting for steps with names containing "Droiddoc" or "Docs droiddoc" to complete:
...
[ 14% 4/28] Docs droiddoc: out/target/common/docs/api-stubs
[ 21% 6/28] //frameworks/base:test-api-stubs-docs Droiddoc [common]
DroidDoc took 102 sec. to write docs to out/soong/.intermediates/frameworks/base/test-api-stubs-docs/android_common/docs/out
[ 28% 7/25] Docs droiddoc: out/target/common/docs/api-stubs
DroidDoc took 113 sec. to write docs to out/target/common/docs/api-stubs
[ 32% 8/25] //frameworks/base:api-stubs-docs Droiddoc [common]
DroidDoc took 115 sec. to write docs to out/soong/.intermediates/frameworks/base/api-stubs-docs/android_common/docs/out
[ 40% 9/22] //frameworks/base:system-api-stubs-docs Droiddoc [common]
DroidDoc took 117 sec. to write docs to out/soong/.intermediates/frameworks/base/system-api-stubs-docs/android_common/docs/out
...
I really don't need or want any documentation to be built on every little incremental recompile.
Is there a way to omit all these doc-related steps?
I'd be interested in either a command line flag if there is one,
or a hopefully simple hack to one or more Makefiles and/or .mk files.
I've looked through the .mk files; in particular build/make/core/droiddoc.mk
seems relevant. I tried cutting some wires in it without really understanding what I was doing, without success.
I'm hoping someone who understands how these .mk files are put together
will know how to do this easily.
I expect this will be of interest to anyone who runs mmm frequently.
During make or mmm invocations, there are apparently two different kinds of build steps that build docs.
Each must be dealt with in its own way.
The build steps that have "Docs droiddoc" in their progress messages. That string comes from build/make/core/droiddoc.mk.
I was able to suppress these build steps as follows: delete all lines from build/make/core/droiddoc.mk, so it becomes an empty file.
The build steps that have "Droiddoc" in their progress messages. That string comes from build/soong/java/droiddoc.go.
I was able to suppress these build steps as follows: delete or comment out the last two blocks in the calling file build/soong/java/androidmk.go:
func (jd *Javadoc) AndroidMk() android.AndroidMkData {
...
}
func (ddoc *Droiddoc) AndroidMk() android.AndroidMkData {
...
}
I confirmed that it's no longer spending time building docs, on Darwin, by keeping an eye on the Activity Monitor during the build,
and verifying that javadoc processes no longer appear.
With docs omitted, mmm frameworks/base -j9 after a small code change now takes 45 to 55 seconds, instead of 4 minutes.
I have a open source project and the counter of files in project are more than 40.
I build the project when the configuration is Debug and the compile time is 2m22s.
And I also use the BuildTimeAnalyzer, the longest time of all is 28ms.
But when I build the project with the Release configuration, it stuck in Compile Swift source files more than one hour.
I have no idea about this, please help me.
In the DEBUG build, if you add up all the time spent on each function, you get about 7s. The numbers don't quite add up — you have spent 142s to build the whole thing, but these functions just take about than 7s to compile??
That's because these timing just accounts for type-checking each function body. In the Swift frontend there are three flags you could use:
-Xfrontend -debug-time-compilation
-Xfrontend -debug-time-function-bodies
-Xfrontend -debug-time-expression-type-checking
Let's use the first to see the whole picture. Pick one slow file, say Option.swift, and look:
===-------------------------------------------------------------------------===
Swift compilation
===-------------------------------------------------------------------------===
Total Execution Time: 30.5169 seconds (43.6413 wall clock)
---User Time--- --System Time-- --User+System-- ---Wall Time--- --- Name ---
23.5183 ( 80.1%) 0.7773 ( 67.6%) 24.2957 ( 79.6%) 34.4762 ( 79.0%) LLVM output
3.7312 ( 12.7%) 0.0437 ( 3.8%) 3.7749 ( 12.4%) 5.4192 ( 12.4%) LLVM optimization
1.8563 ( 6.3%) 0.2830 ( 24.6%) 2.1393 ( 7.0%) 3.1800 ( 7.3%) IRGen
0.2026 ( 0.7%) 0.0376 ( 3.3%) 0.2402 ( 0.8%) 0.4666 ( 1.1%) Type checking / Semantic analysis
... <snip> ...
29.3665 (100.0%) 1.1504 (100.0%) 30.5169 (100.0%) 43.6413 (100.0%) Total
Turns out it's not Swift that is slow, but LLVM! So there is not point looking at type-checking time. We can further check why LLVM is slow using -Xllvm -time-passes, but it won't give us useful information, it's just saying X86 Assembly / Object Emitter is taking most time.
Let's take a step back and check which files take most time to compile:
Option.swift 30.5169
Toolbox.swift 15.6143
PictorialBarSerie.swift 12.2670
LineSerie.swift 8.9690
ScatterSerie.swift 8.5959
FunnelSerie.swift 8.3299
GaugeSerie.swift 8.2945
...
Half a minute is spent in Options.swift. What's wrong with this file?
You have a huge struct, with 31 members. Compiling that struct alone takes 11 seconds.
You have a huge enum, with 80 variants. Compiling this enum alone takes 7 seconds.
The first problem is easy to fix: Use final class instead! The second problem would not have a simple fix (I don't see any time improvement with alternatives e.g. replace the enums with class hierarchy). All other slow files have a similar problem: large structure, large enums.
Simply replacing all struct with final class is enough to bring the compilation time from "over hours and still compiling" to "2.5 minutes".
See also Why Choose Struct Over Class?. Your "struct"s may not qualify as structs.
Note that changing from struct to class do change the semantics of users' code since classes have reference semantics.
Try this....
under Build Settings -> Swift Compiler - Code Generation for your Release choose SWIFT_OPTIMIZATION_LEVEL = -Owholemodule. Then under Other Swift Flags enter -Onone. Doing this carved off big chunks of time off my project.
I have created task on controller and there is loop which is loading for 100 times.
Now I want to load it for 25 times and pause that loop for 1 min and after that it will execute next 25 items same for next 25.
I have checked it with sleep but its not working.
Can you please advise me if is there any way on plugin event or any other method.
Thanks
This is actually unrelated to Joomla! Since you're creating a long running process you need to start it with something else than a browser. A CRON job is a good idea here if you want to execute this operation multiple times. Otherwise it can run via command line. Make sure the max_execution time setting of PHP does not cause any trouble.
If you still need this within Joomla please have a look at the CLI documentation.
https://docs.joomla.org/How_to_create_a_stand-alone_application_using_the_Joomla!_Platform
I'm using EF6 rc1 with Code First strategy, without precompiled views and the problem is:
If I compile and run the exe application it takes like 15 seconds to run the first query (that's okay, since I'm still working on the pre-generated views). But if I use Visual Studio 2013 Preview to Debug the exact same application it takes almost 2 minutes BEFORE running the first query:
Dim Context = New MyEntities()
Dim Query = From I in Context.Itens '' <--- The debug takes 2 minutes in here
Dim Item = Query.FirstOrDefault()
Is there a way to remove this extra time? Am I doing something wrong here?
Ps.: The context itself is not complicated, its just full with 200+ tables.
Edit: Found out that the problem is that during debug time the EF appears to be generating the Views ignoring the pre-generated ones.
Using the source code from EF I discovered that the property:
IQueryProvider IQueryable.Provider
{
get
{
return _provider ?? (_provider = new DbQueryProvider(
GetInternalQueryWithCheck("IQueryable.Provider").InternalContext,
GetInternalQueryWithCheck("IQueryable.Provider").ObjectQueryProvider));
}
}
is where the time is being consumed. But this is strange since it only takes time in debug. Am I missing something here?
Edit: Found more info related to the question:
Using the Process Monitor (by Sysinternals) I found out that there its the 'desenv.exe' process that is consuming tons of time. To be more specific its consuming time with an 'Thread Exit'. It repeats the Thread Exit stack 36 times. I don't know if this info is very useful, but I saved a '.cvs' with the stack, here is his body: [...] (edit: removed the '.cvs' body, I can post it again by the comments if someone really think its going to be useful, but it was confusing and too big.)
Edit: Installed VS2013 Ultimate and Entity Framework 6 RTM. Installed the Entity Framework Power Tools Beta 4 and used it to generate the Views. Nothing changed... If I run the exe it takes 20 seconds, if I 'Start' debugging it takes 120 seconds.
Edit: Created a small project to simulate the error: http://sdrv.ms/16pH9Vm
Just run the project inside the environment and directly through the .exe, click the button and compare the loading time.
This is a known performance issue in Lazy (which EF is using) when the debugger is attached. We are currently working on a fix (the current approach we are looking at is removing the use of Lazy). We hope to ship this fix in a patch release soon. You can track progress of this issue on our CodePlex site - http://entityframework.codeplex.com/workitem/1778.
More details on the coming 6.0.2 patch release that will include a fix are here - http://blogs.msdn.com/b/adonet/archive/2013/10/31/ef6-performance-issues.aspx
I don't know if you have found the solution. But in my case, I had similar issue which wasted me close to a week after trying different suggestions. Finally, I found a solution by changing my web.config to optimizeCompilations="true" and performance improved dramatically from 15-30 seconds to about 2 seconds.