diff --git a/application-tuning-guide/docs/appendix-a-syntax-of-profile-user-command.md b/application-tuning-guide/docs/appendix-a-syntax-of-profile-user-command.md
new file mode 100644
index 0000000000..0c3f21df47
--- /dev/null
+++ b/application-tuning-guide/docs/appendix-a-syntax-of-profile-user-command.md
@@ -0,0 +1,160 @@
+
Appendix A
+
+Syntax of the `]Profile` User Command
+
+The `]Profile` user command is always followed by a report type; modifiers can be included to customise the output.
+
+Syntax: ]Profile [reporttype][-avg][-code][-lines]|[-outfile{=name}] [-format{=xml|csv|txt}][-cumpct][-exclusive][-first{=n}|-pct{=n}][-fn{=name}][-infile{=name}][-separators{="decimalsep phrasesep"}][-bias{=t}][-decimal{=n}][-expr{=expression}][-title{=name}]
+
+## Report Types
+
+The six possible report types are detailed below. If no report type is specified then a default report type is assumed; this is dashboard on the Microsoft Windows operating system and summary on the AIX, Linux and Mac OS operating systems.
+
+|Report Type|Description|
+|-----------|-----------|
+|`calls`|Shows how the consumption of a named function (the `-fn` modifier is required) is broken down by calling function. The `summary` and `calls` report types are the most frequently used reporting tools.|
+|`dashboard`|Opens the Dashboard, a graphical overview of the profiling data collected by the `⎕PROFILE` system function. For more information on the Dashboard, see [Appendix B](./appendix-b-dashbord.md)
+|`data`|Writes the raw data produced by `⎕PROFILE'data'` to a file for use with tools other than `]Profile`, for example, Microsoft Excel.|
+|`state`|Displays the current profiling state of `⎕PROFILE` (see [Collecting Data]( ./data-collection.md#collecting-data)).|
+|`summary`|Reports the number of calls, total consumption and consumption as a percentage of overall consumption. The `summary` and `calls` report types are the most frequently used reporting tools. This is the default report type on the AIX, Linux and macOS operating systems.|
+|`tree`|Writes the raw data produced by `⎕PROFILE'tree'` to a file for later use. Intended as a tool for storing data using the `-outfile=` modifier, for subsequent reporting using the `-infile=` modifier.|
+
+!!! windows "Dyalog on Microsoft Windows"
+ The Dashboard is only available on Microsoft Windows
+
+## Modifiers
+
+The report types can be qualified using modifiers. These can, for example, filter the data that is displayed, add optional output columns, read input from a previously saved file or store the results of a command in a file.
+
+Each of the report types can have different combinations of modifiers applied. The state report type does not take any modifiers; the valid modifiers for each of the other report types are shown in. the following table:
+
+|Modifier|calls|dashboard|data|summary|tree|
+|-----------|-|-|-|-|-|
+|-avg |y| |y|y| |
+|-bias |y|y|y|y|y|
+|-code |y| | | |y|
+|-cumpct |y| |y| |y|
+|-decimal |y| |y|y|y|
+|-exclusive |y| |y| |y|
+|-expr |y|y|y|y|y|
+|-first |y| |y| |y|
+|-fn |y|y|y|y| |
+|-format |y| |y|y|y|
+|-infile |y|y|y|y|y|
+|-lines |y| |y|y|y|
+|-outfile |y| |y|y|y|
+|-pct |y| |y|y| |
+|-separators|y *| |y *|y *|y *|
+|-title** |y** |y **| y **| y **| y **|
+
+\* can only be used when -“format=csv is included
+
+** only relevant when -“format=xml or -“format=txt
+
+|Modifier| Description|
+---------|------------
+|-avg| Includes the average CPU consumption (in ms) per execution of each function call (or line if the -lines modifier is specified).
+|-code| Includes the source code for the line being executed (including the -code modifier forces the -lines modifier). Cannot be used with the -outfile modifier.|
+|-cumpct|Displays the cumulative percentage of overall CPU consumption that each function call (or line if the -lines modifier is specified) and each function call above it was responsible for. This is usually only useful if the -exclusive modifier is also set.|
+|-exclusive|Displays the CPU consumption of each function call (or line if the -lines modifier is specified) excluding consumption due to called functions.|
+|-first= n|After sorting into descending order of CPU consumption, displays only the first n function calls (or lines if the -lines modifier is specified). This is usually only useful if the -exclusive modifier is also set. Cannot be used with the -pct modifier.
+|-fn= name|Mandatory for a calls report type, when it specifies the function that the calls analysis report is for. Optional for other report types, when output is filtered to only include data for the specified function and other functions that it calls.
+|-lines|Displays a breakdown of consumption by individual line rather than a total for each function (the default). Assumed when the -code modifier is specified.|
+|-pct= n|After sorting into descending order of CPU consumption, displays only those function calls (or lines if the -lines modifier is specified) for which the cumulative percentage of overall CPU consumption is less than or equal to n. This is usually only useful if the -exclusive modifier is also set. Cannot be used with the -first modifier.|
+|-format= n|Selects the file format to use when saving a file using the -outfile modifier. Possible values are: * xml - writes data to an XML file (the default), * csv - writes data to a CSV file * txt - writes data to a text file (and retains the display format)|
+|-infile= n| Opens the Dashboard on the dataset contained in the specified.xml file. Doing this does not destroy any existing `⎕PROFILE` data.|
+|-separators= nn|For use with -format=csv. Specifies the decimal and comma separators to use. The default is '.,'|
+|-title= n|For use with -format=xml or -format=txt. Specifies the string that is used as a title caption in the Dashboard and XML reports. Especially useful when running the same expression multiple times as different captions can differentiate between different sets of results. If the -title modifier is not specified, then the caption defaults to the string specified by the -expr modifier. If neither the -title nor the -expr modifiers are specified, then the caption defaults to `]profile Dashboard: `|
+|-outfile= n| Redirects the output from the Session to the specified full path and filename (the full path must already exist). Cannot be used with the -code modifier.
+|-bias= t| Overrides the function call overhead estimated by â••PROFILE during the current session (or read from an infile), and uses t instead. Use -bias=0 to ignore bias, or a fixed value if you want to make sure that you use the same bias for data collected at different times. Depending on environment, t is likely to be in the range 0.00001-0.001 (in ms).|
+|-decimal= n| Specifies the number of decimal places to display for non-integer numbers. The default is 1.|
+|-expr= n| Executes the expression specified as the modifier value and replaces any existing â••PROFILE data with that for the specified expression.|
+
+
+Examples
+These examples are intended to show at least one use of every modifier.
+
+```apl
+ )LOAD sharpplot
+C:\...\ ws\sharpplot.dws saved Mon May 8 09:57:02 2017
+ ⎕PROFILE 'start'
+
+ #.Samples.Sample 'Sample.svg'
+mySharpPlot Sample.svg
+ ⎕PROFILE 'stop'
+```
+
+To see which 5 functions consumed the most CPU time:
+```apl
+ ]Profile summary -expr="#.Samples.Sample 'Sample.svg'" -first=5
+ Element msec % Calls
+ #.Samples.Sample 56.1 100.0 1
+ #.SharpPlot.DrawLineGraph 24.9 44.4 1
+ #.SharpPlot.Plot 18.0 32.1 1
+ #.SharpPlot.DrawBarChart 7.8 14.0 1
+ #.SharpPlot.CH∆PLOT 3.2 5.6 1
+```
+Show the five biggest CPU consumers, excluding CPU time spent in sub-functions. Display decimal numbers to 3 decimal places, include a cumulative percentage and only include functions up to 65% of the cumulative CPU:
+```apl
+ ]Profile summary -exclusive -decimal=3 -cumpct -pct=65
+ Element msec % Calls %(cum)
+ #.Samples.Sample 19.351 33.249 1 33.249
+ #.SharpPlot.Plot 14.719 25.290 1 58.540
+```
+
+To see the average CPU consumption per call without adjusting for timer bias:
+```apl
+ ]Profile summary -exclusive -decimal=3 -avg -bias=0 -first=3
+ Total time: 61.8 msec
+ Element msec % Calls Avg
+ #.Samples.Sample 19.362 31.316 1 19.362
+ #.SharpPlot.Plot 14.733 23.829 1 14.733
+ #.SharpPlot.DrawLineGraph 7.254 11.733 1 7.254
+```
+
+The second set of numbers are higher than the first – the total time is 3.6 ms higher when the timer bias adjustment is not made and the function with the highest consumption, `#.Samples.Sample`, is reported as having consumed 0.011 ms more. The raw data recorded for a function can be displayed (without bias adjustment) by the data report type; in this case the function with the highest consumption is the one of interest:
+```apl
+ ]Profile data –fn=#.Samples.Sample
+ Total time: 389.7 msec; Selected time: 104475.0 msec
+ Element Calls msec(exc) msec(inc)
+ #.Samples.Sample 1 23.0 104.5
+ #.Samples.Sample[1] 1 0.0 0.0
+ #.Samples.Sample[2] 1 0.0 0.0
+ #.Samples.Sample[3] 1 0.0 0.0
+ #.Samples.Sample[4] 1 0.0 0.0
+ #.Samples.Sample[5] 1 0.0 0.0
+ #.Samples.Sample[6] 1 0.0 0.0
+ #.Samples.Sample[7] 1 1.4 2.3
+ #.Samples.Sample[8] 1 0.0 0.0
+ ...etc...
+```
+
+For a summary or calls report, the `-code` modifier can be used to include source code in a report:
+```apl
+ ]Profile summary -code -lines -first=5
+ Total time: 56.1 msec Element msec % Calls Code
+ #.Samples.Sample[33] 25.5 45.4 1 sp.DrawBarChart⊂data1
+ #.Samples.Sample[42] 24.9 44.4 1 sp.DrawLineGraph⊂data2
+ #.SharpPlot.DrawLineGraph[43] 24.9 44.3 1 Plot yValues xValues'linegraph'
+ #.SharpPlot.Plot[174] 17.3 30.9 1 cv←CH∆PLOT DATA VAL ptype iLine iMarker(bFramed∨bCropped)
+ #.Samples.Sample[7] 2.0 3.5 1 sp←⎕NEW Causeway.SharpPlot
+```
+
+The `-outfile` modifier allows output to be directed to a file instead of displaying it in the Session. By default, the format of the data in the file is XML, but this can be changed to CSV or text with the `-format` modifier. For example:
+```apl
+ ]Profile data -outfile=c:\temp\data.csv -format=csv ‑separators='.,'
+```
+creates a CSV file using a period as the decimal separator and a comma as the field separator. For more information on the `-outfile` modifier, see [Data Storage](../data-storage).
+
+If output is directed to an XML or text file, then the `-title` modifier can be used to specify a title that will be displayed when viewing that file in the Dashboard:
+```apl
+ ]Profile tree -expr="queens 8" -title="queens eight" ‑outfile="c:\temp\q8profile.xml"
+```
+
+If the `-title` modifier is omitted then the specified expression is used as the title.
+
+
+The `-infile` modifier loads a previously-saved dataset for analysis – specifying this does not destroy any existing `⎕PROFILE` data:
+`]Profile -infile="c:\temp\test.xml"`
+
+This only applies when the dataset being loaded was a tree report saved in [XML format]( ./data-storage/xml-format.md).
diff --git a/application-tuning-guide/docs/appendix-b-dashbord.md b/application-tuning-guide/docs/appendix-b-dashbord.md
new file mode 100644
index 0000000000..0870fac3d9
--- /dev/null
+++ b/application-tuning-guide/docs/appendix-b-dashbord.md
@@ -0,0 +1,162 @@
+Appendix B
+
+The Dashboard
+
+!!! windows "Dyalog on Microsoft Windows"
+ The Dashboard is only available on the Microsoft Windows operating system.
+
+
+To open the Dashboard on a dataset, call the `]Profile` user command without specifying any report type, that is: `]Profile`
+
+The Dashboard will open and display an overview of the data currently stored by `⎕PROFILE` (`⎕PROFILE` must be stopped/inactive).
+
+## Panels
+
+The main body of the Dashboard is divided into four panels by moveable splitters, as shown in [](#B-1).
+
+{ #B-1 }
+
+The panels shown in [](#B-1) above are:
+
+* panel 1 – Functions panel Consumption broken down by function. Displayed as a pie chart by default, but can be displayed as a table using the drop-down selector in the top right corner.
+
+* panel 2 – Lines panel Consumption broken down by line. Displayed as a table with lines presented in order of decreasing CPU percentage consumed, but can be displayed as a pie chart using the drop-down selector in the top right corner.
+
+* panel 3 – Line details panel Only populated when a line is clicked in panel 2; displays the code of the function in which the selected line appears.
+
+* panel 4 – Function details panel Only populated when a function is clicked in panel 1; displays the code of the selected function.
+
+In [](#B-1) above, the Function details panel was populated by clicking on the pie segment for `#.SharpPlot.Plot` in the Functions panel and the Line Details panel was populated by clicking on the row for `#.SharpPlot.Plot[174]` in the table in the Lines panel.
+
+## Display Options
+
+The information presented in the four panels can be configured using the options described in this section.
+
+Immediately above the Lines panel are two drop-down lists:
+
+* **Pcts of** – how the percentages listed in tables and as labels on pie charts are computed:
+
+ * Total: The given percentage is the percentage of overall consumption.
+This is the default.
+
+ * Selection: The given percentage is the percentage of consumption of the
+function currently being displayed.
+
+* **Showing** – whether tables report time consumed inclusive or exclusive of time
+consumed in any sub-functions called (pie charts always report exclusive time):
+
+ * Exclusive: Show the consumption of each line or function excluding time
+consumed in any sub-functions called. This is the default.
+
+ * Inclusive: Show the consumption of each line or function including time
+consumed in any sub-functions called.
+
+
+Changing the selections in these drop-down lists changes the display in the Functions panel and Lines panel.
+
+The Functions panel and Lines panel each have a drop-down list in the top-right
+corner:
+
+* Table – if selected, functions/lines are displayed in tabular form. Left-clicking a row in a table displays information related to that row's function/line in the
+Function details/Line details panel. This is the default for the Lines panel.
+
+* Pie – if selected, functions/lines are displayed in a pie chart with segment sizes related to CPU percentage consumed. Left-clicking a segment in a pie chart
+displays information related to that segment's function/line in the Function
+details/Line details panel. This is the default for the Functions panel.
+
+The Function details panel and Line details panel each have two check boxes in the top-right corner:
+
+* **Blanks/comments** – if selected, the details presented will include lines that are blank or only comprise a comment. The default is for these to be omitted.
+* **Lines not called** – if selected, any lines that were not called at all when running the function will be included. The default is for these to be omitted.
+
+## Navigating the Functions/Lines
+
+A left-click in a pie segment (or on its label) or table row displays the source code for the selected function/line in the quadrant below. A double-click drills down on the relevant function/line (if possible) and updates all quadrants accordingly. Drilling down always allows indirect calls.
+
+### Breadcrumb Trail
+
+Immediately above the panelled body of the Dashboard (see [Panels](#panels)) is a breadcrumb trail describing the function currently displayed in the panels. At the end of this breadcrumb trail is a label that reports the percentage of the overall consumption that this function accounts for. [](#B-2) shows an example breadcrumb trail.
+
+{ #B-2 }
+
+Each breadcrumb in the trail has one of the following symbol/highlighting colour combinations:
+
+* A right arrow (`→`) and blue highlighting indicate a direct call to a function without intermediate functions.
+
+* A star (`*`) and green highlighting indicate a call sequence in which other functions could have been called.
+
+* An upwards arrow (`↑`) and pink highlighting indicate a "show calls" step has been made, that is, consumption is displayed according to the functions/lines that have called the relevant function/line (see [Right-click Menu](#right-click-menu)).
+
+Clicking a function in the breadcrumb trail displays that function in the panels.
+
+### Right-click Menu
+
+A right-click in a pie segment (or on its label) or table row displays a pop-up menu with the following options, each of which impacts one or more panels of the display:
+
+* **Drill Down** – Drills down one level on the relevant function/line (equivalent to double-clicking on the relevant segment/label/row). This option is only included in the pop-up menu when it is possible to drill down.
+
+* **Make Root** – Only displays consumption that originates in the relevant function/line.
+
+* **Reset** – Returns to the starting position.
+
+* **Show Calls** – Breaks down consumption according to the functions/lines that have called the relevant function/line (higher levels of filtering are retained).
+
+* **Up 1 Level** – Drills up one level (equivalent to clicking on the penultimate breadcrumb in the breadcrumb trail). This option is only included in the pop-up menu when it is possible to drill up.
+
+## Menu Bar
+
+This section details the options available under each of the menu items in the menu bar.
+
+### File Menu
+
+The options available under the *File* menu are detailed in [Table 1](#_table-1):
+
+Table: File menu options
+
+|Item |Description|
+|-----|-----------|
+|Open |Opens an explorer window from which an XML file can be selected and analysed. Equivalent to starting the Dashboard with the `-infile` modifier set.|
+|Save |Saves the current dataset. Equivalent to calling the `]Profile` user command with the `-outfile` modifier set.|
+|Reset|Returns the Dashboard to its the initial state, displaying the initial top-level function in four panels (as shown in [](./data-reporting#4-1 )).
+|Exit |Terminates the Dashboard and returns to the Dyalog Session.|
+
+For panel number references, see [Panels](#panels)
+
+### Windows Menu
+
+The options available under the *Windows* menu are detailed in [Table 2](#_table-2):
+
+Table: Windows menu options
+
+|Item|Description|
+|----|---------|
+|Reset|Positions the vertical and horizontal splitters in their default position, as seen when first opening the Dashboard, and display the first function in the breadcrumb trail.|
+|Functions|Moves the vertical splitter to the right hand edge of the Dashboard, displaying only the functions panels (panels 1 and 4). This can also be achieved by double-clicking at the top of the Functions panel (panel 1).
+|Function Details|Moves the vertical splitter to the right-hand edge of the Dashboard and the horizontal splitter to the top of the Dashboard, displaying only the Function details panel (panel 4). This can also be achieved by double-clicking at the top of the Function details panel (panel 4).
+|Lines|Moves the vertical splitter to the left-hand edge of the Dashboard, displaying only the lines panels (panels 2 and 3). This can also be achieved by double-clicking at the top of the Lines panel (panel 2).
+|Line Details|Moves the vertical splitter to the left-hand edge of the Dashboard and the horizontal splitter to the top of the Dashboard, displaying only the Line details panel (panel 3). This can also be achieved by double-clicking at the top of the Line details panel (panel 3).
+
+For panel number references, see [Panels](#panels)
+
+
+### Help Menu
+
+The options available under the *Help menu* are detailed in [Table 3](#_table-3):
+
+Table: Help menu options
+
+|Item |Description|
+|-----|---------|
+|About|Displays the version number of the `]PROFILE` user command and the corresponding user command framework.
+
+## Single Function Mode
+
+If the data set only pertains to a single function, then the dashboard displays two panels rather than four (as shown in [](#B-3)). In this situation, the panel on the left displays the detailed view of the function body (equivalent to panel 3 or 4 in [](#B-1)); the panel on the right displays the Lines panel (equivalent to panel 2 in [](#B-1)).
+
+Example
+```apl
+ )LOAD dfns
+ ]Profile -eqpr="⍴queens 8"
+```
+
+{ #B-3}
diff --git a/application-tuning-guide/docs/data-collection.md b/application-tuning-guide/docs/data-collection.md
new file mode 100644
index 0000000000..f61185fd31
--- /dev/null
+++ b/application-tuning-guide/docs/data-collection.md
@@ -0,0 +1,78 @@
+Data Collection
+
+!!! Warning "Warning"
+ The `⎕PROFILE` system function can collect very large quantities of data. This means that, to profile a large application or to save a dataset as an XML file, the workspace size might need to be increased significantly.
+
+For complete documentation of the `⎕PROFILE` system function, see the [Language Reference Guide](../../language-reference-guide ).
+
+## Before Initiating the Collection of Data
+
+To improve the accuracy of the data and minimise the impact of timer overhead (see [Timer Overhead](#timer-overhead)):
+
+* Switch off as much hardware as possible, including peripherals and network connections.
+* Switch off as many other tasks and processes as possible, including anti-virus software, firewalls, internet services and background tasks.
+* Raise the priority on the Dyalog APL task to higher than normal.
+!!! windows "Dyalog on Microsoft Windows"
+ On Microsoft Windows, avoid giving it the highest priority.
+
+Data collected by the `⎕PROFILE` system function is cumulative whenever the `⎕PROFILE` system function is in an active state (but does not persist between Sessions); to discard any previously-collected data, enter `⎕PROFILE 'clear'`.
+
+## Initiating the Collection of Data
+
+Data collection is initiated by entering:
+```apl
+⎕PROFILE'start'
+```
+
+This puts ⎕PROFILE into an active state.
+
+⎕PROFILE supports profiling using either CPU or elapsed time. CPU
+time is usually of more interest in profiling application performance
+and, by default, ⎕PROFILE will register CPU usage data using the
+best available counter.
+
+## Collecting Data
+
+Whether data is being collected or not can be verified by entering:
+```apl
+⎕PROFILE 'state'
+```
+
+This returns a 4 element vector, in which:
+
+|-----|---------------------------|
+|`[1]`|is a character vector indicating the state of `⎕PROFILE`. Can be either `active` or `inactive` (must be `active` for data collection).|
+|`[2]`|is a character vector indicating the timer being used. Can be `CPU`, `elapsed`, `coverage` or `none`.|
+|`[3]`| is the call time bias in milliseconds, that is the amount of time that is consumed when the system takes a time measurement.|
+|`[4]`| is the timer granularity in milliseconds, that is, the resolution of the timer being used. On most platforms this will be zero, indicating that the granularity is smaller than the cost and cannot be estimated.|
+
+During data collection, the following data is recorded for each function and for each individual line in a function:
+ * Calls – the number of times the function or line was executed.
+ * Exclusive Time – milliseconds spent executing the function or line, excluding time spent in functions that were called by the function or line.
+ * Inclusive Time – milliseconds spent executing the function or line, including time spent in functions that were called by the function or line.
+
+The times collected by the `⎕PROFILE` system function include the time spent calling the timer function. This means that lines that are called a large number of times can appear to consume more resource than they actually do. For more accurate profiling measurements, adjustments should be made for the timer call time bias. To do this, the application should be run for a sufficiently long period to collect enough data to overcome the timer granularity – a reasonable rule of thumb is to make sure the application runs for at least `4000×4⊃⎕PROFILE 'state'` milliseconds.
+
+The profiling data that is collected is stored outside the workspace and does not impact workspace availability.
+
+`⎕PROFILE` can collect data for functions that are dynamically paged in and out of the workspace.
+
+!!! Info "Information"
+ Results can be confusing if several different functions with the same name are used at different times during execution – these are treated as the same function by `⎕PROFILE`.
+
+## Stopping the Collection of Data
+Data collection is stopped by entering:
+```apl
+⎕PROFILE 'stop'
+```
+This puts `⎕PROFILE` into an inactive state.
+
+## Timer Overhead
+
+As with all system timers, a cost is associated with the collection of timing data using the `⎕PROFILE` system function. In optimised applications the overhead can be significant; although it is unlikely to impact the identification of hot spots, it can distort results.
+
+By default, reports produced with the `]Profile` user command automatically adjust for timer bias, using the recorded bias – this can be disabled for a report by including the `‑bias=0` modifier and modifier value.
+
+The cost of querying a timer can vary significantly with system load, and repeatable timings are only possible if there is very little activity on the system; the variability is due to the timer calling the operating system kernel, which is servicing all processes on the machine. Dyalog Ltd. recommends increasing the priority of the application being profiled as this can reduce the variability (but will not eliminate it completely).
+
+The timer cost and granularity are estimated the first time that `⎕PROFILE` is run in an APL session. A new calibration can be requested by calling `⎕PROFILE 'calibrate'`.
diff --git a/application-tuning-guide/docs/data-reporting.md b/application-tuning-guide/docs/data-reporting.md
new file mode 100644
index 0000000000..315bd23ed2
--- /dev/null
+++ b/application-tuning-guide/docs/data-reporting.md
@@ -0,0 +1,105 @@
+Data Reporting
+
+Once data has been collected, summarised data for each function and line within that function can be retrieved using `⎕PROFILE 'tree'`. In both these cases, a very large quantity of data can be returned.
+
+The `]Profile` user command is a reporting tool that acts on the profiling data collected by the `⎕PROFILE` system function, applying filters and limiting the output to a specified subset of the total collected. This results in a reduced data quantity that is tailored to display only what is required. For details of the syntax of the `]Profile` user command, see [Appendix A](appendix-a-syntax-of-profile-user-command.md)
+
+The examples in this document assume that data has been collected as follows:
+
+```apl
+ )LOAD sharpplot
+C:\...\ ws\sharpplot.dws saved Mon May 8 09:57:02 2017
+ ⎕PROFILE 'start'
+ #.Samples.Sample 'Sample.svg'
+mySharpPlot Sample.svg
+ ⎕PROFILE 'stop'
+```
+
+
+## Textual Reports
+
+After collecting the data, the consumption by function can be found using:
+
+```apl
+ ]Profile summary -expr="#.Samples.Sample 'Sample.svg'" -first=10
+Total time: 58.2 msec
+
+Element msec % Calls
+#.Samples.Sample 58.2 100.0 1
+#.SharpPlot.DrawLineGraph 25.6 44.0 1
+#.SharpPlot.Plot 18.4 31.6 1
+#.SharpPlot.DrawBarChart 7.7 13.3 1
+#.SharpPlot.CH∆PLOT 3.2 5.4 1
+#.SharpPlot.DrawPieChart 2.2 3.8 1
+#.SharpPlot.CH∆PIE 1.9 3.3 1
+#.SharpPlot.ConstructorDefault 1.3 2.2 1
+#.SharpPlot.SharpPlot 1.3 2.2 1
+#.psb.Constructor 1.2 2.1 12
+```
+
+In this expression the `-expr` modifier allows the specification of an APL statement to run, and is equivalent to executing:
+
+```apl
+ ⎕PROFILE 'clear'
+ ⎕PROFILE 'start'
+ #.Samples.Sample 'Sample.svg'
+ ⎕PROFILE 'stop'
+```
+
+The inclusion of `-first=10` limits the output to the top 10 functions in terms of CPU consumption. To see the top 5 lines of code instead:
+
+```apl
+ ]Profile summary -lines -first=5
+Total time: 58.2 msec
+```
+
+```apl
+Element msec % Calls
+#.Samples.Sample[33] 25.9 44.5 1
+#.Samples.Sample[42] 25.6 44.0 1
+#.SharpPlot.DrawLineGraph[43] 25.6 43.9 1
+#.SharpPlot.Plot[174] 17.7 30.5 1
+#.Samples.Sample[60] 2.2 3.8 1
+```
+
+Finally, the call analysis report for the `Constructor` function can be displayed:
+
+```apl
+ ]Profile calls -fn=#.psb.Constructor -first=5
+ Total time: 58.2 msec; Selected time: 1248.0 msec
+```
+
+```apl
+Element msec % Calls
+#.SharpPlot.CH∆PLOT 0.4 0.8 3
+#.SharpPlot.SharpPlot 0.3 0.6 4
+#.SharpPlot.CH∆BAR 0.2 0.3 2
+#.SharpPlot.CH∆AXES 0.1 0.2 1
+#.SharpPlot.CH∆XTIC 0.1 0.2 1
+```
+
+## Graphical Reports
+
+!!! windows "Dyalog on Microsoft Windows"
+ >The Dashboard detailed in this section is only available on Microsoft Windows. For information on using the Dashboard, see [Appendix B](appendix-b-dashbord.md)
+
+A graphical version of the textual reports can be viewed using the Dashboard. This provides an overview of the resource consumption of an application that can be drilled down into in pursuit of tuning opportunities.
+
+To open the Dashboard on the dataset, call the `]Profile` user command without
+specifying any report type, that is:
+
+```apl
+ ]Profile
+```
+
+The Dashboard will open and display an overview of the data currently stored by `⎕PROFILE` (`⎕PROFILE` must be stopped/inactive), as shown in [](#4-1)
+
+If the dataset is very large then it can take a few seconds to open the Dashboard.
+
+{ #4-1 }
+
+ To open the Dashboard on a dataset that is not currently stored by `⎕PROFILE`, the modifiers `-expr` and/or `-infile` can be included:
+
+* `-expr` runs the specified expression and then opens the Dashboard on the resultant dataset, for example, `]Profile -expr="#.Samples.Sample 'Sample.svg'"`. Doing this destroys any existing `⎕PROFILE` data and replaces it with data for the specified expression.
+
+* `-infile` opens the Dashboard on the dataset contained in the specified .xml file , for example, `]Profile –infile=c:\temp\one.xml`. Doing this does not destroy any existing `⎕PROFILE` data.
diff --git a/application-tuning-guide/docs/data-storage/csv-format.md b/application-tuning-guide/docs/data-storage/csv-format.md
new file mode 100644
index 0000000000..c7ba63971d
--- /dev/null
+++ b/application-tuning-guide/docs/data-storage/csv-format.md
@@ -0,0 +1,81 @@
+CSV Format
+
+Files saved in CSV format can be used by [`⎕CSV`](../../../language-reference-guide/system-functions/csv) and many external tools. For example:
+```apl
+ ]Profile data -outfile=c:\temp\data.csv -format=csv -separators='.,'
+```
+creates a CSV file using a period as the decimal separator and a comma as the field separator. This file can be viewed either by opening it in a text editor or in a spreadsheet (as shown in [](#5-1) and [](#5-2) respectively).
+
+{ #5-1 }
+
+{ #5-2 }
+
+!!! windows "Dyalog on Microsoft Windows"
+ [](#5-2) shows the `data.csv` file opened in Microsoft Excel; to do this, enter the following in a Session:
+```apl
+ 'XL' ⎕WC 'OLEClient' 'Excel.Application'
+ XL.Visible←1
+ XL.Workbooks.Open⊂'c:\temp\data.csv'
+```
+
+Examples
+
+This section contains a few examples of output files created using `-format=csv` (all files are encoded as UTF-8). The first row of each file contains column names, selected from the same list as the element names that can appear in XML files (see [XML Format](./xml-format.md)).
+
+```apl
+ ]Profile tree -outfile=data1.csv -format=csv
+Data written to: data1.csv
+```
+Content of the `data1.csv` file:
+```csv
+"Depth","Element","Line","Calls","ExclusiveTime","InclusiveTime"
+0,"#.Samples.Sample",¯1,1,19.362,61.828
+1,"#.Samples.Sample",1,1,0.002,0.002
+1,"#.Samples.Sample",2,1,0,0
+1,"#.Samples.Sample",3,1,0,0
+1,"#.Samples.Sample",4,1,0,0
+1,"#.Samples.Sample",5,1,0.005,0.005
+1,"#.Samples.Sample",6,1,0,0
+1,"#.Samples.Sample",7,1,0.874,2.388
+2,"#.SharpPlot.ConstructorDefault",¯1,1,0.007,1.513
+3,"#.SharpPlot.ConstructorDefault",1,1,0,0
+3,"#.SharpPlot.ConstructorDefault",2,1,0.001,0.001
+3,"#.SharpPlot.ConstructorDefault",3,1,0.004,1.51
+4,"#.SharpPlot.SharpPlot",¯1,1,0.219,1.506
+...etc...
+```
+
+```apl
+ ]Profile data -outfile=data2.csv -format=csv -separators=",;"
+Data written to: data2.csv
+```
+
+Content of the `data2.csv` file:
+```csv
+"Element";"Line";"Calls";"ExclusiveTime";"InclusiveTime"
+"#.psb.DrawWedge";;2;0,011;0,021
+"#.psb.DrawWedge";1;2;0,001;0,001
+"#.psb.DrawWedge";2;2;0,001;0,001
+"#.psb.DrawWedge";3;2;0,001;0,001
+"#.psb.DrawWedge";4;2;0,001;0,001
+"#.psb.DrawWedge";5;2;0,001;0,001
+"#.psb.DrawWedge";6;2;0,001;0,001
+"#.psb.DrawWedge";7;2;0,001;0,001
+"#.psb.DrawWedge";8;2;0,001;0,001
+"#.psb.DrawWedge";9;2;0,001;0,001
+...etc...
+```
+```apl
+ ]Profile summary -first=5 -outfile=data3.csv -format=csv
+Data written to: data3.csv
+```
+Content of the `data3.csv` file:
+
+```csv
+"Element","Line","Time","PctOfTot","Calls"
+"#.Samples.Sample",,58.2,100,1
+"#.SharpPlot.DrawLineGraph",,25.626,44.03092784,1
+"#.SharpPlot.Plot",,18.373,31.56872852,1
+"#.SharpPlot.DrawBarChart",,7.726,13.27491409,1
+"#.SharpPlot.CH∆PLOT",,3.153,5.417525773,1
+```
diff --git a/application-tuning-guide/docs/data-storage/index.md b/application-tuning-guide/docs/data-storage/index.md
new file mode 100644
index 0000000000..8788e6fc4f
--- /dev/null
+++ b/application-tuning-guide/docs/data-storage/index.md
@@ -0,0 +1,9 @@
+Data Storage
+
+The `]Profile` user command can direct output to a file instead of displaying it in the Session. To do this, the `-outfile` modifier must be included; its modifier value must be the name of file in which to write the report data. By default, data is stored in an XML format, but this can be changed with the `-format` modifier:
+
+* To save data in [XML format](xml-format.md), include `-format=xml` in the call to the `]Profile` user command (see Section ). This is the default, so does not have to be explicitly stated.
+
+* To save data in [CSV format]( ./csv-format.md), include `-format=csv` in the call to the `]Profile` user command.
+
+* To save data in [text format]( ./text-format.md), include `-format=txt` in the call to the `]Profile` user command.
\ No newline at end of file
diff --git a/application-tuning-guide/docs/data-storage/text-format.md b/application-tuning-guide/docs/data-storage/text-format.md
new file mode 100644
index 0000000000..3eea20c9a5
--- /dev/null
+++ b/application-tuning-guide/docs/data-storage/text-format.md
@@ -0,0 +1,39 @@
+Text Format
+
+If the text format is used, the output is written to the file as it would have been displayed in the Session. The content of such plain text files can then be further processed using external text processing tools, or manipulated using APL (after using [`⎕NGET`](../../../language-reference-guide/system-functions/nget) to import it).
+
+```apl
+ ]Profile summary
+ Total time: 58.2 msec
+```
+
+```text
+Element msec % Calls
+#.Samples.Sample 58.2 100.0 1
+#.SharpPlot.DrawLineGraph 25.6 44.0 1
+#.SharpPlot.Plot 18.4 31.6 1
+#.SharpPlot.DrawBarChart 7.7 13.3 1
+#.SharpPlot.CH∆PLOT 3.2 5.4 1
+#.SharpPlot.DrawPieChart 2.2 3.8 1
+#.SharpPlot.CH∆PIE 1.9 3.3 1
+#.SharpPlot.ConstructorDefault 1.3 2.2 1
+#.SharpPlot.SharpPlot 1.3 2.2 1
+#.psb.Constructor 1.2 2.1 12
+#.psb.psb 1.2 2.1 12
+#.SharpPlot.CH∆BAR 1.0 1.8 1
+#.SharpPlot.DrawNote 1.0 1.6 1
+#.SharpPlot.CH∆XLAB 0.9 1.6 1
+#.SharpPlot.RunElements 0.9 1.6 2
+#.SharpPlot.CH∆NOTE 0.9 1.6 1
+#.psb.MeasureEach 0.9 1.5 8
+#.SharpPlot.CH∆METRIC 0.9 1.5 7
+#.Common.ListAdd 0.8 1.4 152
+#.SharpPlot.CH∆HEAD 0.8 1.3 2
+```
+
+```apl
+ ]Profile summary -outfile=data.txt -format=txt
+Data written to: data.txt
+```
+
+
diff --git a/application-tuning-guide/docs/data-storage/xml-format.md b/application-tuning-guide/docs/data-storage/xml-format.md
new file mode 100644
index 0000000000..b8eb47d35d
--- /dev/null
+++ b/application-tuning-guide/docs/data-storage/xml-format.md
@@ -0,0 +1,94 @@
+XML Format
+
+Using the XML format generates very large files, but the content can be processed using [`⎕XML`](../../../language-reference-guide/system-functions/xml) or many external tools. However, `tree` reports in XML format can be used as input to the `]Profile` user command (using the `-nfile` modifier) and are the only way to store a complete data set that can be reused for reporting at a later time. For example, entering the following command:
+```apl
+ ]Profile tree -outfile=c:\temp\one.xml
+```
+
+saves the tree report in a file called `one.xml` in the `c:\temp` directory. This file can be opened later (in the same or a different Session) by entering:
+```apl
+ ]Profile summary -infile=c:\temp\one.xml
+```
+ <>In addition, as user commands can be executed under program control, an application can record its own usage data. For example:
+```apl
+ ⎕SE.UCMD 'profile tree -outfile=c:\temp\one.xml'
+```
+ The XML format produced by the `]Profile` user command comprises an outer `` element; this contains a `` element followed by a number of `` elements, one for each row of output data.
+ The `` element contains the version number of the `]Profile` user command that produced the file, the report title, information about timer cost and other information, including the total registered time for the report.
+ Each `` element contains an element for each output column, depending on the command and switches, selected from the set listed in [](#_table-1)
+
+Table: Elements that can be contained within the `ProfileEntry` element
+
+|Element|Description|
+|------|--------|
+|`Depth`|Tree depth|
+|`Element`|Function name|
+|`Line`|Line number – empty for a function summary entry|
+|`Calls`|Number of times the function or line was called|
+|`InclusiveTime` `ExclusiveTime`|Time consumed inclusive/exclusive of time consumed in any sub-functions called (in ms)|
+|`AvgTime`|Average time per call (in ms)|
+
+Examples
+
+This section contains a few examples of output files created using `-format=xml` (all files are encoded as UTF-8).
+
+```apl
+ ]Profile tree -outfile=tree.xml
+Data written to: tree.xml
+```
+Content of the `tree.xml` file:`
+
+```xml
+
+
+
+ 1.37
+ 2017/05/08 11:22:19
+ 0.00007458669726290168
+ tree
+ 173.41
+ 173.41
+
+
+ 0
+ #.Samples.Sample
+ ¯1
+ 1
+ 19.362
+ 61.828
+
+ ...
+ ...many more occurrences of ...
+ ...
+
+```
+
+```apl
+ ]Profile summary -outfile=summary.xml
+Data written to: summary.xml
+```
+
+Content of the summary.xml` file:
+```xml
+
+
+
+ 1.37
+ 2017/05/08 11:31:00
+ 0.00007458669726290168
+ summary
+ 58.2
+ 58.2
+
+
+ #.Samples.Sample
+
+ 58.2
+ 100
+ 1
+
+ ...
+ ...many more occurrences of ...
+ ...
+
+```
diff --git a/application-tuning-guide/docs/img/dashboard_breadcrumbs.jpg b/application-tuning-guide/docs/img/dashboard_breadcrumbs.jpg
new file mode 100644
index 0000000000..28d1df5f25
Binary files /dev/null and b/application-tuning-guide/docs/img/dashboard_breadcrumbs.jpg differ
diff --git a/application-tuning-guide/docs/img/dashboard_example.png b/application-tuning-guide/docs/img/dashboard_example.png
new file mode 100644
index 0000000000..67562844ca
Binary files /dev/null and b/application-tuning-guide/docs/img/dashboard_example.png differ
diff --git a/application-tuning-guide/docs/img/dashboard_labelled.png b/application-tuning-guide/docs/img/dashboard_labelled.png
new file mode 100644
index 0000000000..76bcc19029
Binary files /dev/null and b/application-tuning-guide/docs/img/dashboard_labelled.png differ
diff --git a/application-tuning-guide/docs/img/dashboard_singlefn.png b/application-tuning-guide/docs/img/dashboard_singlefn.png
new file mode 100644
index 0000000000..d6d97fe781
Binary files /dev/null and b/application-tuning-guide/docs/img/dashboard_singlefn.png differ
diff --git a/application-tuning-guide/docs/img/example_csv_excel.png b/application-tuning-guide/docs/img/example_csv_excel.png
new file mode 100644
index 0000000000..7d8ee953d6
Binary files /dev/null and b/application-tuning-guide/docs/img/example_csv_excel.png differ
diff --git a/application-tuning-guide/docs/img/example_csv_text.png b/application-tuning-guide/docs/img/example_csv_text.png
new file mode 100644
index 0000000000..56c7cbabc7
Binary files /dev/null and b/application-tuning-guide/docs/img/example_csv_text.png differ
diff --git a/application-tuning-guide/docs/img/example_text.png b/application-tuning-guide/docs/img/example_text.png
new file mode 100644
index 0000000000..bbc2970d19
Binary files /dev/null and b/application-tuning-guide/docs/img/example_text.png differ
diff --git a/application-tuning-guide/docs/index.md b/application-tuning-guide/docs/index.md
new file mode 100644
index 0000000000..925a17dd14
--- /dev/null
+++ b/application-tuning-guide/docs/index.md
@@ -0,0 +1,15 @@
+---
+search:
+ exclude: true
+---
+
+# About
+
+The _Application Tuning Guide_ describes the way in which the `⎕PROFILE`
+system function and the associated `]PROFILE` user command can be
+used to obtain a performance profile of an application. It describes
+both the graphical and textual output that can be obtained following
+data collection and shows how this data can be analysed and potential
+inefficiencies identified.
+
+Assumed knowledge: A reasonable understanding of Dyalog APL.
diff --git a/application-tuning-guide/docs/introduction.md b/application-tuning-guide/docs/introduction.md
new file mode 100644
index 0000000000..4ed0e03682
--- /dev/null
+++ b/application-tuning-guide/docs/introduction.md
@@ -0,0 +1,28 @@
+Introduction
+
+Application design includes assumptions about usage patterns and data
+volumes. Over time, these can evolve to the detriment of the application's
+performance. The most effective way to counter drops in performance caused
+by changes external to the application is to identify the hot spots
+(places in the application where a high proportion of CPU or Elapsed
+Time is consumed); these hot spots can then be tuned to improve the
+application's performance.
+
+The `⎕PROFILE` system function and the `]Profile` user command
+facilitate the hot spot identification process; the `⎕PROFILE` system
+function gathers statistics from an application and the `]Profile`
+user command summarises, filters and reports on this data, simplifying
+the process of drilling down on the (frequently large amounts of) data
+returned by `⎕PROFILE`.
+
+!!! Legacy "Legacy "
+ The `⎕MONITOR` system function, which was in use prior to
+ the introduction of the `⎕PROFILE` system function, has been
+ deprecated and Dyalog Ltd recommends rewriting tools to use the
+ `⎕PROFILE` system function instead; `⎕PROFILE` provides high
+ precision timing, calling tree analysis, and superior dfn and
+ recursive code handling.
+
+For more information on the `⎕PROFILE` system function, see the [Language Reference Guide](../../language-reference-guide).
+For more information on the `]Profile` user command, see [Appendix A](appendix-a-syntax-of-profile-user-command.md).
+
diff --git a/application-tuning-guide/mkdocs.yml b/application-tuning-guide/mkdocs.yml
new file mode 100644
index 0000000000..7fdb19e002
--- /dev/null
+++ b/application-tuning-guide/mkdocs.yml
@@ -0,0 +1,60 @@
+site_name: Application Tuning Guide
+theme:
+ favicon: documentation-assets/images/favicon-32.png
+ logo: documentation-assets/images/dyalog-logo_white.svg
+ features:
+ - navigation.instant
+ - navigation.tracking
+ - navigation.path
+ - navigation.indexes
+ name: material
+ font:
+ text: Be Vietnam Pro
+extra_css:
+ - documentation-assets/css/main.css
+ - documentation-assets/css/extra.css
+extra_javascript:
+ - javascripts/mathjax.js
+ - https://unpkg.com/mathjax@3/es5/tex-mml-chtml.js
+plugins:
+ - privacy
+ - search
+ - macros
+ - site-urls
+ - caption:
+ table:
+ enable: true
+ start_index: 1
+ increment_index: 1
+ position: bottom
+ reference_text: 'Table {index}'
+ caption_prefix: 'Table {index}:'
+extra:
+ version_maj: 20
+ version_majmin: 20.0
+markdown_extensions:
+ - admonition
+ - pymdownx.details
+ - pymdownx.keys
+ - pymdownx.superfences
+ - pymdownx.arithmatex:
+ generic: true
+ - attr_list
+ - abbr
+ - footnotes
+ - md_in_html
+ - markdown_tables_extended
+ - toc:
+ title: On this page
+nav:
+ - index.md
+ - Introduction: introduction.md
+ - Data Collection: data-collection.md
+ - Data Reporting: data-reporting.md
+ - Data Storage:
+ - data-storage/index.md
+ - XML Format: data-storage/xml-format.md
+ - CSV Format: data-storage/csv-format.md
+ - Text Format: data-storage/text-format.md
+ - Appendix A: appendix-a-syntax-of-profile-user-command.md
+ - Appendix B: appendix-b-dashbord.md
diff --git a/application-tuning-guide/print_mkdocs.yml b/application-tuning-guide/print_mkdocs.yml
new file mode 100644
index 0000000000..8112018214
--- /dev/null
+++ b/application-tuning-guide/print_mkdocs.yml
@@ -0,0 +1,58 @@
+site_name: Application Tuning Guide
+theme:
+ favicon: documentation-assets/images/favicon-32.png
+ logo: documentation-assets/images/dyalog-logo_white.svg
+ features:
+ - navigation.instant
+ - navigation.tracking
+ - navigation.path
+ - navigation.indexes
+ name: material
+ font:
+ text: Be Vietnam Pro
+extra_css:
+ - documentation-assets/css/main.css
+ - documentation-assets/css/extra.css
+extra_javascript:
+ - javascripts/mathjax.js
+ - https://unpkg.com/mathjax@3/es5/tex-mml-chtml.js
+plugins:
+ - privacy
+ - search
+ - macros
+ - site-urls
+ - caption:
+ table:
+ enable: true
+ start_index: 1
+ increment_index: 1
+ position: bottom
+extra:
+ version_maj: 20
+ version_majmin: 20.0
+markdown_extensions:
+ - admonition
+ - pymdownx.details
+ - pymdownx.keys
+ - pymdownx.superfences
+ - pymdownx.arithmatex:
+ generic: true
+ - attr_list
+ - abbr
+ - footnotes
+ - md_in_html
+ - markdown_tables_extended
+ - toc:
+ title: On this page
+nav:
+ - index.md
+ - Introduction: introduction.md
+ - Data Collection: data-collection.md
+ - Data Reporting: data-reporting.md
+ - Data Storage:
+ - data-storage/index.md
+ - XML Format: data-storage/xml-format.md
+ - CSV Format: data-storage/csv-format.md
+ - Text Format: data-storage/text-format.md
+ - Appendix A: appendix-a-syntax-of-profile-user-command.md
+ - Appendix B: appendix-b-dashbord.md
diff --git a/mkdocs.yml b/mkdocs.yml
index f804d660bc..8f918e9519 100644
--- a/mkdocs.yml
+++ b/mkdocs.yml
@@ -82,9 +82,11 @@ nav:
- 'Object Reference': "!include ./object-reference/mkdocs.yml"
- 'Interfaces': "!include ./interface-guide/mkdocs.yml"
- '.NET Framework Interface': "!include ./net-framework-interface-guide/mkdocs.yml"
- - 'Dyalog for UNIX':
- - 'Installation/Configuration': "!include ./unix-installation-and-configuration-guide/mkdocs.yml"
+ - 'Dyalog for UNIX':
+ - 'Installation/Configuration': "!include ./unix-installation-and-configuration-guide/mkdocs.yml"
- 'User Interface': "!include ./unix-user-guide/mkdocs.yml"
+ - 'Tools Documentation':
+ - 'Application Tuning Guide': "!include ./application-tuning-guide/mkdocs.yml"
- 'About':
- 'Conventions': conventions.md
- 'Third-party Licences': licences-overview.md