Mostrando postagens com marcador otimizar. Mostrar todas as postagens
Mostrando postagens com marcador otimizar. Mostrar todas as postagens

sábado, 29 de agosto de 2020

DICAS 3057 -WINDEV TUTORIAL 80 -Licao 6.4-04-09-2020 14Hrs- Debugging a project



https://youtu.be/jzPZInXIOeM




Bom Dia/Boa Tarde/Boa Noite

Esse Ao Vivo vai estrear as 14:00 do dia 04/09/2020 

DICAS 3057 -WINDEV TUTORIAL 80 -Licao 6.4-04-09-2020 14Hrs- Debugging a project
Tutoriel WINDEV : Leçon 6.4. Optimiser et déboguer - Débogage d'un projet

ASSUNTOS

O QUE VAMOS APRENDER
USANDO O DEPURADOR
VISAO GERAL
USANDO O DEPURADOR
CTRL + PAUSE , INICIO -> ISSO MUITO LEGAL 
CTRL + B , PONTO VERMELHO
F8 PARA CONTINUAR DEBUG
F7 PARA IR PARA OUTRO PROCEDIMENTO
ADICIONANDO EXPRESSAO PARA DEBUG
AUTO STOP 
  ESTA VERDE, COLOCAR VERMELHO,COLOCAR CONDICAO EXPRESSAO
F6 - executar ate o cursor - MUITO TOP
f5 = SEM INTERRUCAO
AMARILDO DANDO UMA OPINIAO



Video original da Franca

https://youtu.be/AmPOIkl1vMI


Playlist Windev TUTORIAL

Repositorio Windev

https://repository.windev.com/


https://youtu.be/3DshsXJ8I2M



DICAS 2978 - WINDEV TUTORIAL 1 - 1.1B - WINDEV TEMA ESCURO E IDIOMA DO AMBIENTE
DICAS 2979 - WINDEV TUTORIAL 2 - 1.2- CRIAR JANELA E INSERIR TEXTO E EXIBIR
DICAS 2980 - WINDEV TUTORIAL 3 - 2.1- VARIAVEIS PARTE 1
DICAS 2981 - WINDEV TUTORIAL 4 - 2.2- VARIAVEIS ESCOPO - PARTE 2
DICAS 2982 - WINDEV TUTORIAL 5 - 2.1- VARIAVEIS OPERADORES PARTE 3
DICAS 2983 - WINDEV TUTORIAL 6 - 2.1.D - VARIAVEIS STRINGS PARTE 4
DICAS 2984 - WINDEV TUTORIAL 7 - 2.1.E - VARIAVEIS ARRAYS PARTE 5
DICAS 2985 - WINDEV TUTORIAL 8 - 2.2.A - CONDICOES IF-SWITCH PARTE 1
DICAS 2986 - WINDEV TUTORIAL 9 - 2.2.B - CONDICOES PARTE 2
DICAS 2987 - WINDEV TUTORIAL 10 - 2.3.A - LOOP PARTE 1
DICAS 2988 - WINDEV TUTORIAL 11 - 2.3.B - LOOP EXEMPLOS PARTE 2
DICAS 2989 - WINDEV TUTORIAL 12 - Lesson 2.4. The procedures - PARTE 1
DICAS 2990 - WINDEV TUTORIAL 13 - Leçon 2.4.b. Procedures Parametros - PARTE 2
DICAS 2991 - WINDEV TUTORIAL 14 - PROCEDURES REFERENCIA - PARTE 3
DICAS 2992 - WINDEV TUTORIAL 15 - PROCEDURES OPCIONAIS OU OBRIGATORIAS - PARTE 4
DICAS 2993 - WINDEV TUTORIAL 16 - PROCEDURES EXEMPLOS - PARTE 5
DICAS 2994 - WINDEV TUTORIAL 17 - PERGUNTAS E RESPOSTA - PARTE 1
DICAS 2995 - WINDEV TUTORIAL 18 - PERGUNTAS E RESPOSTA - PARTE 2
DICAS 2996 - WINDEV TUTORIAL 19 - WINDEV E OS BANCOS DE DADOS
DICAS 2997 - WINDEV TUTORIAL 20 - PROJETO E ANALISE - CRIACAO
DICAS 2998 - WINDEV TUTORIAL 21 - PROJETO E ANALISE - ARQUIVOS DADOS CLIENTE - PARTE 2
DICAS 2999 - WINDEV TUTORIAL 22 - PROJETO E ANALISE - ARQUIVOS DADOS CRIACAO ARQUIVO PEDIDO - PARTE 3
DICAS 3000 - WINDEV TUTORIAL 23 - PROJETO E ANALISE - IMPORTANDO CVS-ARQUIVO TEXTO - PARTE 4
DICAS 3001 - WINDEV TUTORIAL 24 - PROJETO E ANALISE - IMPORTANDO ARQUIVO PRODUTO - PARTE 5
DICAS 3002 - WINDEV TUTORIAL 25 - PROJETO E ANALISE - LINK - PARTE 6
DICAS 3003 - WINDEV TUTORIAL 26 - RAD COMPLETO
DICAS 3004 - WINDEV TUTORIAL 27 - VISAO GERAL
DICAS 3005 - WINDEV TUTORIAL 28 - Adicionar e Modificar Janelas PRODUTOS - PARTE A
DICAS 3006 - WINDEV TUTORIAL 29 - Adicionar e Modificar Janelas PRODUTOS Formulario - PARTE B
DICAS 3007 - WINDEV TUTORIAL 30 - Adicionar e Modificar Janelas PRODUTOS ALINHAR CAMPOS - PARTE C

















Lesson 6.4. Debugging a project
This lesson will teach you the following concepts
  • Overview.
  • Using the debugger.
Lesson duration

Estimated time: 15 mn
Previous LessonTable of contentsNext Lesson
Overview
Let's take a look at the debugger supplied with WINDEV.
What is the debugger?
The debugger is a powerful tool used to follow the code or application progress, step by step. Enhancing a process or even an application becomes child's play.
We are going to use the debugger on the long process found in the WIN_PerformanceProfiler window.
Using the debugger
  • To debug the WIN_PerformanceProfiler window:
    1. Open "WIN_PerformancepRofiler" in the window editor (double-click its name in the "Project explorer" pane).
    2. Run the test of "WIN_PerformanceProfiler" window ( Running the test of the window among the quick access buttons).
    3. Start the debugger by using one of the following methods:
      • Press Ctrl + [Pause]: the debugger will be automatically started during the next user action in the window whose test is run.
      • Go back to the WINDEV editor and position a breakpoint in the WLanguage code associated to the Button control "Process to analyze" (click next to the first line of code of the "Click" event or press Ctrl + B; a red dot will appear). The debugger will be automatically started when the line preceded by the breakpoint is run.

        Remark

        Several methods can be used to start the debugger.
        See Start modes of debugger for more details.
    4. Click "Process to analyze". The debugger starts. The current line is preceded by a little arrow.
      Debugger
      The "Debugger" pane appears in the lower section of the screen. This pane displays two distinct areas:
      • the call stack: This area allows you to know the hierarchy of the events and processes displayed in the debugger. In our example, we are currently debugging the event "Click BTN_LongProcess".
      • the list of expressions to evaluate. By default, the main variables used in the WLanguage code are displayed in this area. You can add variables in order to follow their evolution (this feature will be presented later).
We are going to perform some operations in the debugger to discover its capabilities.
  • First of all, we are going to run the different statements step by step and see the content of variables:
    1. Press the F8 key (or click the "Step by step" button found in the ribbon). The line following the current line is automatically run. The values of variables are modified (if necessary) in the "Debugger" pane (displayed at the bottom of the screen).
    2. When the cursor shaped like an arrow reaches the "PROGBAR_Progress..MaxValue = ..." line, hover "PROGBAR_Progress" with the mouse. A tooltip is displayed with the expression value:
      Tooltip
    3. The value of "PROGBAR_Progress..MaxValue" is displayed in a tooltip. This value corresponds to 100 because the code line was not run.
    4. Press F8 to run the line.
    5. Hover "PROGBAR_Progress..MaxValue" again. The value of "PROGBAR_Progress..MaxValue" displayed in the tooltip corresponds to the result of HNbRec(Product).
      Tooltip
  • Let's continue our operations in the debugger. We are now going to run the UpdateProductStock procedure step by step in the debugger.
    1. To run this procedure step by step, press the F7 key (or click the "Detailed step by step" button in the ribbon).
    2. The procedure code is displayed in the debugger.
  • We are now going to add an expression to monitor the evolution of its value in the "Debugger" pane. This expression can have any type: variable, function, operation on variables, ... The expression result is calculated and displayed.
This expression is used to perform a custom debugging. For example, you can find out the content of a variable while it is being used in the application.
  1. Press F7 to run the different lines of UpdateProductStock procedure until you reach the line:
    PROGBAR_Progress++
  2. Hover "PROGBAR_Progress". The value displayed in the tooltip is 0.
  3. Select "PROGBAR_Progress" in the code editor and open the popup menu (right click). Select "Add expression to debugger".
  4. The expression is automatically added into the debugger pane at the bottom of the screen.
    Debugger pane
  • The debugger can also be used to run a set of code lines:
    1. Press F8 until you reach the line:
      HModify(Product)
      The F8 key is used to run the code of InterrogateSupplierDatabase procedure without running it step by step in the debugger.
    2. Click the following line with the mouse (caution: click inside the line and not in front of it):
      IF HExecuteQuery(QRY_QuantityOrdered) THEN
    3. Press the F6 key (or click the "Run until cursor" button found in the ribbon).
    4. The arrow indicating the line currently run moves until it reaches the code line where the cursor is positioned. The code lines found before the cursor are automatically run.
  • We are now going to add a breakpoint and to run the code until it reaches the breakpoint:
    1. Click in the hatched area with the mouse, in front of HModify. A breakpoint (red bullet) appears.
      Breakpoint
    2. Press F5 (or click "Continue" in the ribbon). The code is run until it reaches the breakpoint. The arrow used to identify the current line moves until it reaches the breakpoint.
    3. Click the breakpoint to remove it.
  • To end this test, we will be using an "Auto-stop" expression. An "Auto-stop" expression is used to start the debugger as soon as a condition is checked or when the value of a variable is modified. In our example, the debugger will be started as soon as the value of progress bar is set to 50%:
    1. In the "Debugger" pane, select the "PROGBAR_Progress" expression that was added beforehand.
    2. Click the green circle.
    3. Press F5 to continue the test.
    4. A message is displayed, indicating that the value of "PROGBAR_Progress" expression changed.
      Message indicating the change in value
    5. Validate.
    6. In the "Debugger" pane, select the "PROGBAR_Progress" expression. Click the expression again: the "Expression" column becomes editable. In the "Expression" area, add "=50". You will get "PROGBAR_Progress = 50".
      Debugger pane
    7. Press F5. The program continues to run. The debugger is started again when the value of the progress bar is set to 50.
  • That's it, the main features of debugger have been presented here. To stop the test in the debugger, click "End the test" found in the ribbon.









sexta-feira, 28 de agosto de 2020

DICAS 3056 - WINDEV TUTORIAL 79 -04-09-2020 11Hrs- OTIMIZAR ANALISADOR DE DESEMPENHO

https://youtu.be/w3HJ3X-PnSA




Bom Dia/Boa Tarde/Boa Noite

Esse Ao Vivo vai estrear as 11:00 do dia 04/09/2020 

DICAS 3056 - WINDEV TUTORIAL 79 -04-09-2020 11Hrs- OTIMIZAR ANALISADOR DE DESEMPENHO
Tutoriel WINDEV : Leçon 6.3. Optimiser et déboguer - Analyseur de performances

ASSUNTOS

VAMOS VER O QUE SERA ENSINADO
VISAO GERAL
O QUE PROFILER
INICIANDO O PERFIL DE DESEMPENHO 
DUAS OPCOES
PELO EDITOR WINDEV
POR PROGRAMACAO 
profillerstart
profillerend 
INICIANDO TESTE DE DESEMPENHO 
ESTUDANDO O RESULTADO




Video original da Franca

https://youtu.be/wdYlVdAzE5I


Playlist Windev TUTORIAL

Repositorio Windev

https://repository.windev.com/












DICAS 2978 - WINDEV TUTORIAL 1 - 1.1B - WINDEV TEMA ESCURO E IDIOMA DO AMBIENTE
DICAS 2979 - WINDEV TUTORIAL 2 - 1.2- CRIAR JANELA E INSERIR TEXTO E EXIBIR
DICAS 2980 - WINDEV TUTORIAL 3 - 2.1- VARIAVEIS PARTE 1
DICAS 2981 - WINDEV TUTORIAL 4 - 2.2- VARIAVEIS ESCOPO - PARTE 2
DICAS 2982 - WINDEV TUTORIAL 5 - 2.1- VARIAVEIS OPERADORES PARTE 3
DICAS 2983 - WINDEV TUTORIAL 6 - 2.1.D - VARIAVEIS STRINGS PARTE 4
DICAS 2984 - WINDEV TUTORIAL 7 - 2.1.E - VARIAVEIS ARRAYS PARTE 5
DICAS 2985 - WINDEV TUTORIAL 8 - 2.2.A - CONDICOES IF-SWITCH PARTE 1
DICAS 2986 - WINDEV TUTORIAL 9 - 2.2.B - CONDICOES PARTE 2
DICAS 2987 - WINDEV TUTORIAL 10 - 2.3.A - LOOP PARTE 1
DICAS 2988 - WINDEV TUTORIAL 11 - 2.3.B - LOOP EXEMPLOS PARTE 2
DICAS 2989 - WINDEV TUTORIAL 12 - Lesson 2.4. The procedures - PARTE 1
DICAS 2990 - WINDEV TUTORIAL 13 - Leçon 2.4.b. Procedures Parametros - PARTE 2
DICAS 2991 - WINDEV TUTORIAL 14 - PROCEDURES REFERENCIA - PARTE 3
DICAS 2992 - WINDEV TUTORIAL 15 - PROCEDURES OPCIONAIS OU OBRIGATORIAS - PARTE 4
DICAS 2993 - WINDEV TUTORIAL 16 - PROCEDURES EXEMPLOS - PARTE 5
DICAS 2994 - WINDEV TUTORIAL 17 - PERGUNTAS E RESPOSTA - PARTE 1
DICAS 2995 - WINDEV TUTORIAL 18 - PERGUNTAS E RESPOSTA - PARTE 2
DICAS 2996 - WINDEV TUTORIAL 19 - WINDEV E OS BANCOS DE DADOS
DICAS 2997 - WINDEV TUTORIAL 20 - PROJETO E ANALISE - CRIACAO
DICAS 2998 - WINDEV TUTORIAL 21 - PROJETO E ANALISE - ARQUIVOS DADOS CLIENTE - PARTE 2
DICAS 2999 - WINDEV TUTORIAL 22 - PROJETO E ANALISE - ARQUIVOS DADOS CRIACAO ARQUIVO PEDIDO - PARTE 3
DICAS 3000 - WINDEV TUTORIAL 23 - PROJETO E ANALISE - IMPORTANDO CVS-ARQUIVO TEXTO - PARTE 4
DICAS 3001 - WINDEV TUTORIAL 24 - PROJETO E ANALISE - IMPORTANDO ARQUIVO PRODUTO - PARTE 5
DICAS 3002 - WINDEV TUTORIAL 25 - PROJETO E ANALISE - LINK - PARTE 6
DICAS 3003 - WINDEV TUTORIAL 26 - RAD COMPLETO
DICAS 3004 - WINDEV TUTORIAL 27 - VISAO GERAL
DICAS 3005 - WINDEV TUTORIAL 28 - Adicionar e Modificar Janelas PRODUTOS - PARTE A
DICAS 3006 - WINDEV TUTORIAL 29 - Adicionar e Modificar Janelas PRODUTOS Formulario - PARTE B
DICAS 3007 - WINDEV TUTORIAL 30 - Adicionar e Modificar Janelas PRODUTOS ALINHAR CAMPOS - PARTE C





Lesson 6.3. Performance profiler
This lesson will teach you the following concepts
  • Overview.
  • Starting the performance profiler.
  • Studying the result.
Lesson duration

Estimated time: 15 mn
Previous LessonTable of contentsNext Lesson
Overview
The performance profiler (also called Profiler) is a tool used to check and optimize the execution time of the processes found in your application.
The principle is straightforward:
  • You run the test of your application.
  • During this test, the performance profiler keeps track of all actions performed and saves the execution times of each one of the processes run.
At the end of test, the performance profiler displays:
  • the 10 most time consuming operations,
  • the duration and the number of calls for all processes run.
The "WD Optimization" project contains a specific window used to see the interesting results with the performance profiler.
Starting the performance profiler
The performance profiler can be started:
  • from the WINDEV editor:
    In this case, the project is automatically run in test mode. You can use your application and start the processes of your choice.
    To go back to the WINDEV editor, all you have to do is exit from your application.
    Then, the performance profiler displays the monitoring result. This result is saved in a WPF file.
  • from one of your WLanguage processes, with the following functions:
    ProfilerStartStarts "collecting data" for the performance profiler.
    ProfilerEndStops "collecting data" for the performance profiler.

    In this case, only the code found between ProfilerStart and ProfilerEnd is studied. The result is saved in a WPF file.
  • The first method will be used in our example. To start the performance profiler on the "WD Optimization" project:
    1. On the "Project" pane, "Audit and performance" group, expand "Analyze performance" and select "Analyze performance".

      Remark

      The performance profiler can also be started from the project dashboard, via the "Performance" widget. Simply:
      • enable the Widget if necessary (click the link "Click here to re-enable").
      • expand the button with arrow and select "Analyze the performance".
        Widget on the dashboard
    2. The project test is run.
    3. Click the "Test window of performance profiler" button.
    4. Click the "Process to analyze" button.
    5. Validate the information window and stop the project test. The performance profiler report window appears.
Studying the result
  • Let's study the report window of the performance profiler. Results are displayed in several tabs:
    • the "Summary" tab presents the ten longest processes.
    • the "Mapping" tab presents a graphical view of main processes.
    • the "Details" tab presents all processes run during the application test (from the slowest one to the fastest one).
    • the "Calls" tab is used to view the details of operations performed in a process.
  • Let's present these different tabs in our example.
    • The "Summary" tab presents the ten longest processes. In our example, you can see that the local procedure named "UpdateProductStock" takes more than 3 seconds to run.
      Performance profiler - Summary
    • The "Mapping" tab is used to visually identify what took the longest time. In our case, it's a call to Ping:
      Performance profiler - Mapping
    • The "Details" tab presents all processes or events run, from the slowest one to the fastest one.
      Performance profiler - Details
      The following information is displayed for each process or event:
      • Function: Function, event or procedure run.
      • Total time: Execution time of function.
      • Internal time: Execution time due to the engine.
      • Nb of calls: Number of calls made to the function (procedure or event).
      • Time 1 call: Execution time of a call to the function (procedure or event).
      • Code %: Percentage of time spent in the process of function or procedure (developer code that can be optimized).
      • Parent: Element that contains the process.
  • In our case, the "Details" tab indicates that the call to the "Ping" function is one of the elements taking the longest time.
    1. Select this line. We are going to check whether this slowdown is caused by a specific problem.
    2. Click the "Calls" button to display the details of calls to the UpdateProductStock procedure. Select the "Ping" line and click the "Code" button: the corresponding code line is displayed in the code editor.
    3. Close the performance profiler.
    4. The following code line is run:
      // Checks the accessibility of supplier server
      Ping("supplier-addr")
      The slowdown is caused by the fact that the address specified for Ping is not accessible.
  • Let's check the operating mode of application by optimizing this code:
    1. Replace the code line containing Ping by the following code line:
      // Checks the accessibility of supplier server
      Ping("www.google.fr")
    2. Save the code (Ctrl + S).
  • We are now going to restart the performance profiler:
    1. On the "Project" pane, "Audit and performance" group, expand "Analyze performance" and select "Analyze performance".
    2. The project test is run.
    3. Click the "Test window of performance profiler" button.
    4. Click the "Process to analyze" button.
    5. Validate the information window and stop the project test. The performance profiler report window appears.
    6. In the "Mapping" tab, Ping does not appear with the same importance.
      Performance profiler - Mapping
  • Close the performance profiler report window.







Teste

Teste
teste