- How to pass existing script, global, and permanent variables to this new (let's call it) capi.exe?
- How to have capi.exe update project global variables (ie Set,%var%,NewValue,GLOBAL)?
- How to have capi.exe update project permanent variables (ie Set,%var%,NewValue,PERMANENT)?
- How to have capi.exe update the winbuilder log?
External intergration with winbuilder.exe
#1
Posted 21 June 2010 - 01:45 PM
#2
Posted 21 June 2010 - 02:04 PM
If that is a viable option to speed up WB or if this will slow it even more down, can only psc answer.
Better imo would be a CAPI.dll, which integrates with WB.
#3
Posted 21 June 2010 - 05:22 PM
Is it e.g. "very senceful" to currently use the CAPI with reg_add > RegWrite,HKLM
API definitions should make app scripts platform independent.
And it increases WB processing time when API is only used to shorten inputs which are the same for ALL platforms.
Peter
#4
Posted 21 June 2010 - 05:43 PM
One way would be passing them as parameters like MedEvil said or writing them inside another file when the external file is launched.How to pass existing script, global, and permanent variables to this new (let's call it) capi.exe?
Also, do remember that most variables are already stored inside script.project and each script also holds his own set of variables as a INI section. If you're worried about values that might be modified while the project is running, you can also write them back to a INI file.
If you need to change a considerable number of static variables while the project is running then I'd say that this is more of a structural problem in the project than anything else.
From the external program, write the intended variables to a INI section and when returning to winbuilder call "AddVariables" to add multiple variables on a single operation: http://winbuilder.ne...ml#AddVariablesHow to have capi.exe update project global variables (ie Set,%var%,NewValue,GLOBAL)?
These variables are located on script.project and you can edit them there directly.How to have capi.exe update project permanent variables (ie Set,%var%,NewValue,PERMANENT)?
The only influence you can have on wb's log is using Echo. I'd suggest that the program writes it's own log apart from wb's log.How to have capi.exe update the winbuilder log?
If an error appears, I'd suggest a window popup with a timed counter to press the "ok" button. Or since capi is project-wide intended, call it on the finalization scripts to warn users about errors that need attention.
----------------
From experience, writing all variables to a fresh file takes a few milliseconds and can be read by any external app using the standard INI read. You can also reverse the process to understand what went good or wrong with the external program that was called.
As a side note:
The default INI read/write code that comes with most compilers is notoriously slow compared to the custom read/write code found inside WinBuilder. This occurs mostly because wb ignores any duplicate sections and quits reading the rest of the file once the targeted section is found.
I can help you create faster INI read/write code to get better performance if needed.
#5
Posted 21 June 2010 - 08:56 PM
The only influence you can have on wb's log is using Echo. I'd suggest that the program writes it's own log apart from wb's log.
If an error appears, I'd suggest a window popup with a timed counter to press the "ok" button. Or since capi is project-wide intended, call it on the finalization scripts to warn users about errors that need attention.
I can see that being extremely confusing for end users and frustrating for developers/people trying to help the poor confused user. it is much easier to debug something if all the logs are inline with one another instead of trying to mentally or manually put a time line of events together from 2 or more logs.
#6
Posted 21 June 2010 - 09:02 PM
Nuno's suggestions seem rather logical, but possiby may have to involve a rebuild of variables to be successful. Sometimes that can produce unexpected results.
capi.exe sourcecode should be opensource so we can all make changes/updates/suggestions as necessary.
Regards,
Galapo.
#7
Posted 21 June 2010 - 09:07 PM
Regards,
Galapo.
#8
Posted 21 June 2010 - 09:44 PM
Yes, I fully understand what you mean. Tried my best to think on a better proposal.it is much easier to debug something if all the logs are inline with one another instead of trying to mentally or manually put a time line of events together from 2 or more logs.
For the moment, please bear with the current limitation and proceed with an external log if necessary even if not the most elegant or integrated solution.
The hard-core way would be acessing the memory pointer where winbuilder.exe stores the log lines and add the desired text. This would function across all wb's without changes but requires intrinsic knowledge of how to use memory pointers.
Not indicated for the faint of heart but blazzing fast logging..
------
Nevertheless, will keep an eye to solve this shortcoming in the future. Defining a flag on the echo command wouldn't also be a idea to implement along the way.
#9
Posted 21 June 2010 - 10:25 PM
For example require_file if coded as an external dll everything needed could be passed as parameters.
Access to the log file as already pointed out would need to be addressed. Could be done by winbuilder providing all log access through a api dll which it uses and which other external dlls could also use.
#10
Posted 22 June 2010 - 12:49 AM
Certainly it's good to look for improvements with CAPI. But this shouldn't be at the neglect of searching for why 080 is about 2x slower than 077rc2. An external CAPI app run by 077rc2 would currently be the fastest build method, but it would be advantageous to have an updated winbuilder.exe running at 077rc2 speed (or better) also processing api commands with something external. The pressure for such a solution, as I've said before, will be felt more by projects no longer supporting or able to support the speedy 077rc2 version.
Regards,
Galapo.
#11
Posted 22 June 2010 - 09:05 AM
My measurement with TempPE.Script:But this shouldn't be at the neglect of searching for why 080 is about 2x slower than 077rc2.
080_3: 2.657 sec
077_RC2: 2.203 sec.
That is not 2x slower, that is 20%!
With high propability the If command is one reason.
There was a bug which only could be fixed by a lot of additional checks:
Set,%var%,Bla If,1,EQUAL,1,StrFormat,FILENAME,FullFilename,%Var%Rather than executing
StrFormat,FILENAME,FullFilename,%Var%the bug executes the line
StrFormat,FILENAME,FullFilename,Blawich leads to an error message.
BTW: Maybe this sample runs under 77 RC2. It should only explain the principle. I do not remember the original bug situation.
The fix checks evey If command, whether the following action contains a variable name which must not be replaced by the variable value.
Check 100 * the line
If,A,EQUAL,B,Echo,YESIt will take double time in 080 / 081 compared with 77 RC2.
Peter
BTW: for those who are interested:
// search variable names not to translate if ScriptMemo.Count > 1 then m1 := ScriptMemo[1] else m1 := ''; GetVarIndex(command, m1, varIndex, secondIndex); varName := ''; secondName := ''; if varIndex <> -1 then varName := TransInner(ScriptMemo[varIndex]); if secondIndex <> -1 then secondName := TransInner(ScriptMemo[secondIndex]); // translate variables for i := 1 to x - 1 do begin ScriptMemo[i] := TranslateParams(ScriptMemo[i]); if (i <> varIndex) and (i <> secondIndex) and not AnsiStartsText('OUT:', ScriptMemo[i]) then begin ScriptMemo[i] := TranslateVariables(ScriptMemo[i]); if ForceWarning and doVarCheck and ExecBlock and (AnsiPos('%', ScriptMemo[i]) > 0) and isVariable(ScriptMemo[i]) then InstantMsg(LangMan.LangLog('!#2482') + ' [' + ScriptMemo[i] + ']', msgIcon_Warning); end; end;
#12
Posted 22 June 2010 - 11:54 AM
Hi Peter,My measurement with TempPE.Script:
080_3: 2.657 sec
077_RC2: 2.203 sec.
That is not 2x slower, that is 20%!
I could not reproduce your good result. See my logs here: http://www.boot-land...?...st&p=102991.
077rc2 processes the script in 3.484 seconds, while 080 processes the script in 5.938 seconds -- that is close enough to 2x faster to call it 2x faster. Most app scripts will process close to 2x faster as well with 077rc2.
I assume you're doing testing on functions -- you'll notice that the issue isn't restricted to the 'If' command but is basically across the board.With high propability the If command is one reason.
Regards,
Galapo.
#13
Posted 22 June 2010 - 12:07 PM
Because "Single Tests" may depend on some host activity etc., I made a test series with TempPE.Script. Every value is the average of 5 tests.Hi Peter,
I could not reproduce your good result. See my logs here: http://www.boot-land...?...st&p=102991.
077rc2 processes the script in 3.484 seconds, while 080 processes the script in 5.938 seconds -- that is close enough to 2x faster to call it 2x faster. Most app scripts will process close to 2x faster as well with 077rc2.
I got:
In LiveXP with 077RC2: 2.125 sec
In LiveXP with 081RC1: 2.825 sec. That is a difference of 33%
In nativeEx_Barebone with 077RC2: 1.625 sec
In nativeEx_Barebone with 081RC1: 2.190 sec. That is a difference of 35%
The differences are technically identic.
But the "general" difference between LiveXP and nativeEx_Barebone is remarkable. It is also about 30%!
You are right. The "Check variable function" mentioned above, is done in EVERY script line. Theoretically the bug "replace variable name by content" can occur in every statement.I assume you're doing testing on functions -- you'll notice that the issue isn't restricted to the 'If' command but is basically across the board.
Peter
#14
Posted 22 June 2010 - 01:08 PM
To me, using an external dll sounds wildly inefficient. It is much better to use a single winbuilder.exe which is all in a process and will remain loaded for more than one call. ( )Using an external exe to me sounds wildly inefficiant. Much better to use a dll which is all in process and will remain loaded for more than one call.
---------------------
The goal is improve the speed of scripts with these priorities in mind:
- Use the current winbuilder.exe
- Work with previous winbuilder.exe versions
- Avoid requiring any new function for a future version.
---------------------
A small console executable, even if called hundreds of times to perform a repetitive task (create a shortcut, or whatever task), is still far faster than creating the same results with script commands that involve thousands of IF's and string processing commands.
Also, moving some of the scripting to a executable is only part of the equation to improve the performance.
We still need to look better on the structure of projects and see what can be put on a "diet" so that we can keep scripts in a good running shape.
#15
Posted 22 June 2010 - 03:31 PM
It was known from the start, that the API and later CAPI, will have a huge impact on performance.
The only upside was, that it makes writing scripts much easier, which at the time, seemed like a good thing to bait some more members into becoming script developers.
Well, it didn't work this way, the number of script developers hasn't skyrocketed or at least increased.
By simply creating scripts with Pe1, PE2, Pe3 sections, we would also get cross project App scripts, but without any impact on performance.
#16
Posted 22 June 2010 - 03:33 PM
Since when is a dll less efficient, than having the functionality in a monolithic exe?To me, using an external dll sounds wildly inefficient. It is much better to use a single winbuilder.exe which is all in a process and will remain loaded for more than one call. ( )
#17
Posted 22 June 2010 - 04:50 PM
Actually, the main goal was writing scripts that don't need to be rewritten in the future.The only upside was, that it makes writing scripts much easier, which at the time, seemed like a good thing to bait some more members into becoming script developers.
Otherwise we'd have to write all scripts for PE4, PE5, PEnn.. Weren't you around at that time in 2006~2007 when we had to recode scripts for LiveXP, VistaPE, NativePE and so forth?
For a start, we avoid getting into a "DLL hell" with a single exe..Since when is a dll less efficient, than having the functionality in a monolithic exe?
-------------
API scripts are a very good concept when they are kept simple as needed.
#18
Posted 22 June 2010 - 06:02 PM
Yeah, right. And nobody around here complains about app scripts with outdated versions!Actually, the main goal was writing scripts that don't need to be rewritten in the future.
Otherwise we'd have to write all scripts for PE4, PE5, PEnn..
Dll hell - script hell, what's the difference?For a start, we avoid getting into a "DLL hell" with a single exe..
#19
Posted 22 June 2010 - 06:30 PM
I have to comment a lot.API scripts are a very good concept when they are kept simple as needed.
But tomorrow, not now.
Currently I'm starting to view the FIFA championchip Argentinia - Greece.
I wish "Good luck" to my friends Smiley and Billonious.
(And the German trainer Otto)
Peter
#20
Posted 22 June 2010 - 08:27 PM
OOPS!I wish "Good luck" to my friends Smiley and Billonious.
(And the German trainer Otto)
Peter
#21
Posted 22 June 2010 - 08:39 PM
That's one of the advantages of free volunteer work. Personally, I only upgrade to newer versions whenever absolutely necessary if the project already has all app scripts I need and I just want to try another project.Yeah, right. And nobody around here complains about app scripts with outdated versions!
But this is not the point of discussion nor it would be solved here. I think it's more important to look at the scripts that are taking 6 minutes just like paraglider mention and see what can be done to improve them.
Shall we start?
#22
Posted 22 June 2010 - 11:19 PM
I made a test with LiveXP recommended as off the server. Only changes was: disabled mass storage drivers script, disabled emulation and CD burning scripts.
Results:
077rc2 completed in 17 min 11 sec.
080 completed in 25 min 39 sec.
Test_logs_LiveXP_rec.rar 553.99KB 467 downloads
080 in this test takes 55% longer to process the project.
Nuno, based on the tests above, it should be clearly seen that the biggest hurdle to fast builds is winbuilder.exe itself. The current stable is running around 50% slower than previously. By using 077rc2, a project can cut build time dramatically even without a single script optimised (if possible).But this is not the point of discussion nor it would be solved here. I think it's more important to look at the scripts that are taking 6 minutes just like paraglider mention and see what can be done to improve them.
The priority as far as I can tell should therefore be with winbuilder.exe itself rather than work-arounds to the real problem which is a slowdown with winbuilder.exe script processing.
Regards,
Galapo.
#23
Posted 22 June 2010 - 11:44 PM
With pebuilder I can build a 746mb xp based pe iso in about 3.5 minutes.
#24
Posted 23 June 2010 - 12:00 AM
Only a bit over 49%.080 in this test takes 55% longer to process the project.
@paraglider
Though i love the speed of pebuilder too, the speed comes clearly from the very simple scripts that are used.
#25
Posted 23 June 2010 - 12:12 AM
Hi MedEvil,Only a bit over 49%.
Maths isn't my strong suit, but I assume it isn't yours either.
17 min 11 sec = 1031 secs
26 min 39 sec = 1599 sec
Half of 1031 = 515.5.
1031 + 515.5 = 1546.5
1546.5 is less than 1599, therefore more than either 49% and 50%.
55% of 1031 = 567
1031 + 567 = 1598
1598 is close enough to 080 time of 1599, therefore time increase of 55%.
Regards,
Galapo.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users