doc: update performance tuning section
							parent
							
								
									b3e0827f58
								
							
						
					
					
						commit
						e8e205284c
					
				
							
								
								
									
										19
									
								
								doc/docs.md
								
								
								
								
							
							
						
						
									
										19
									
								
								doc/docs.md
								
								
								
								
							|  | @ -1686,14 +1686,19 @@ eprintln('$vm.name $vm.version\n $vm.description') | ||||||
| 
 | 
 | ||||||
| ## Performance tuning | ## Performance tuning | ||||||
| 
 | 
 | ||||||
| The generated C code is usually fast enough. Although rarely, there | The generated C code is usually fast enough, when you compile your code  | ||||||
| are some situations though, where you want to give additional hints  | with `-prod`. There are some situations though, where you may want to give  | ||||||
| to the C compiler, so that it can further optimize some blocks of code. | additional hints to the C compiler, so that it can further optimize some  | ||||||
| NB: these are *rarely* needed, and should not be used, unless you | blocks of code. | ||||||
| profile your code, and see that there are significant benefits for them. |  | ||||||
| 
 | 
 | ||||||
| [inline] - you can tag functions with [inline], and the C compiler will | NB: These are *rarely* needed, and should not be used, unless you | ||||||
| try to inline them, which in some cases, may be beneficial for peformance. | *profile your code*, and then see that there are significant benefits for them. | ||||||
|  | To cite gcc's documentation: "programmers are notoriously bad at predicting | ||||||
|  | how their programs actually perform". | ||||||
|  | 
 | ||||||
|  | `[inline]` - you can tag functions with `[inline]`, so the C compiler will | ||||||
|  | try to inline them, which in some cases, may be beneficial for peformance,  | ||||||
|  | but may impact the size of your executable. | ||||||
| 
 | 
 | ||||||
| `if _likely_(bool expression) {` this hints the C compiler, that the passed  | `if _likely_(bool expression) {` this hints the C compiler, that the passed  | ||||||
| boolean expression is very likely to be true, so it can generate assembly  | boolean expression is very likely to be true, so it can generate assembly  | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue