2019-08-12 12:31:15 +02:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								### Build
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-10-15 13:15:24 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								```
							 
						 
					
						
							
								
									
										
										
										
											2020-06-17 10:37:36 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								yarn bazel build //packages/core/test/render3/perf:${BENCHMARK}_lib.min_debug.js --config=ivy
							 
						 
					
						
							
								
									
										
										
										
											2019-10-15 13:15:24 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								```
							 
						 
					
						
							
								
									
										
										
										
											2019-08-12 12:31:15 +02:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								### Run 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-10-15 13:15:24 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								```
							 
						 
					
						
							
								
									
										
										
										
											2020-06-17 10:37:36 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								node dist/bin/packages/core/test/render3/perf/${BENCHMARK}_lib.min_debug.js
							 
						 
					
						
							
								
									
										
										
										
											2019-10-15 13:15:24 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								```
							 
						 
					
						
							
								
									
										
										
										
											2019-08-12 12:31:15 +02:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								### Profile
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-10-15 13:15:24 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								```
							 
						 
					
						
							
								
									
										
										
										
											2020-06-17 10:37:36 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								node --no-turbo-inlining --inspect-brk dist/bin/packages/core/test/render3/perf/${BENCHMARK}_lib.min_debug.js
							 
						 
					
						
							
								
									
										
										
										
											2019-10-15 13:15:24 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								```
							 
						 
					
						
							
								
									
										
										
										
											2019-08-19 15:45:13 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								then connect with a debugger (the `--inspect-brk`  option will make sure that benchmark execution doesn't start until a debugger is connected and the code execution is manually resumed). 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								The actual benchmark code has calls that will start (`console.profile` ) and stop (`console.profileEnd` ) a profiling session.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-10-23 09:26:27 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								## Deoptigate
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								yarn add deoptigate
							 
						 
					
						
							
								
									
										
										
										
											2020-06-17 10:37:36 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								yarn deoptigate dist/bin/packages/core/test/render3/perf/${BENCHMARK}_lib.min_debug.js
							 
						 
					
						
							
								
									
										
										
										
											2019-10-23 09:26:27 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-10-15 13:15:24 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								### Run All
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								To run all of the benchmarks use the `profile_all.js`  script:
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								node packages/core/test/render3/perf/profile_all.js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								NOTE: This command will build all of the tests, so there is no need to do so manually.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								Optionally use the `--write`  command to save the run result to a file for later comparison.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								node packages/core/test/render3/perf/profile_all.js --write baseline.json
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								### Comparing Runs
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								If you have saved the baseline (as described in the step above) you can use it to get change in performance like so:
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								node packages/core/test/render3/perf/profile_all.js --read baseline.json
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								The resulting output should look something like this:
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								┌────────────────────────────────────┬─────────┬──────┬───────────┬───────────┬───────┐
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								│              (index)               │  time   │ unit │ base_time │ base_unit │   %   │
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								├────────────────────────────────────┼─────────┼──────┼───────────┼───────────┼───────┤
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								│       directive_instantiate        │ 276.652 │ 'ms' │  286.292  │   'ms'    │ -3.37 │
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								│        element_text_create         │ 262.868 │ 'ms' │  260.031  │   'ms'    │ 1.09  │
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								│           interpolation            │ 257.733 │ 'us' │  260.489  │   'us'    │ -1.06 │
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								│             listeners              │  1.997  │ 'us' │   1.985   │   'us'    │  0.6  │
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								│ map_based_style_and_class_bindings │  10.07  │ 'ms' │   9.786   │   'ms'    │  2.9  │
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								│       noop_change_detection        │ 93.256  │ 'us' │  91.745   │   'us'    │ 1.65  │
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								│          property_binding          │ 290.777 │ 'us' │  280.586  │   'us'    │ 3.63  │
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								│      property_binding_update       │ 588.545 │ 'us' │  583.334  │   'us'    │ 0.89  │
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								│      style_and_class_bindings      │  1.061  │ 'ms' │   1.047   │   'ms'    │ 1.34  │
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								│           style_binding            │ 543.841 │ 'us' │  545.385  │   'us'    │ -0.28 │
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								└────────────────────────────────────┴─────────┴──────┴───────────┴───────────┴───────┘
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-08-19 15:45:13 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								### Notes
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-10-24 17:40:17 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								To run the benchmark use `bazel run <benchmark_target>` , example:
							 
						 
					
						
							
								
									
										
										
										
											2019-11-22 12:07:29 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								-  `yarn bazel run --config=ivy //packages/core/test/render3/perf:noop_change_detection`  
						 
					
						
							
								
									
										
										
										
											2019-10-24 17:40:17 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								To profile, append `_profile`  to the target name and attach a debugger via chrome://inspect, example:
							 
						 
					
						
							
								
									
										
										
										
											2019-11-22 12:07:29 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								-  `yarn bazel run --config=ivy //packages/core/test/render3/perf:noop_change_detection_profile`  
						 
					
						
							
								
									
										
										
										
											2019-10-24 17:40:17 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								To interactively edit/rerun benchmarks use `ibazel`  instead of `bazel` .
							 
						 
					
						
							
								
									
										
										
										
											2020-01-31 15:30:57 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								To debug
							 
						 
					
						
							
								
									
										
										
										
											2020-05-15 12:48:27 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								-  Follow the directions in `profile_in_browser.html`  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								OR
							 
						 
					
						
							
								
									
										
										
										
											2020-01-31 15:30:57 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								-  `yarn bazel build --config=ivy //packages/core/test/render3/perf:noop_change_detection`  
						 
					
						
							
								
									
										
										
										
											2020-06-17 10:37:36 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								-  `node --inspect-brk bazel-out/darwin-fastbuild/bin/packages/core/test/render3/perf/noop_change_detection.min_debug.js`