HTTP/1.1 -1 Read error in cache disk data: SuccessContent-Type: text/csv; charset="utf-8" Last-Modified: Sat, 22 Jan 2022 04:00:41 GMT Content-length: 2263 Connection: Close Proxy-Connection: Close X-Cache: HIT from web1.osuosl.org Server: ProxyTrack 0.5 (HTTrack 3.49.2) id,summary,reporter,owner,description,type,status,priority,milestone,component,version,severity,resolution,keywords,cc,lang,patch,platform 725,[PATCH] Add c-level branch prediction annotations,Infinoid,,"Gcc allows you to tell the optimizer which path of a branch is more likely. The Linux kernel uses this heavily, through the use of the likely() and unlikely() macros. This patch adds these to parrot, and starts using them in a few places. I intend to update this patch to add more annotations; I have callgrind data from a non-optimized parrot, but I need to re-analyze it for an optimized parrot. (non-optimized GCC doesn't make use of the annotations, and optimized GCC generates code which looks quite a bit different.) The first rev of this patch already seems to make about half a second of difference. It's not huge, but it is measurable. Before: {{{ ./perl6 -e 'my $i = 0; while ( $i < 100000) { $i++ }' 39.32s user 1.39s system 99% cpu 40.933 total ./perl6 -e 'my $i = 0; while ( $i < 100000) { $i++ }' 39.20s user 1.46s system 99% cpu 40.991 total ./perl6 -e 'my $i = 0; while ( $i < 100000) { $i++ }' 39.08s user 1.41s system 99% cpu 40.766 total ./perl6 -e 'my $i = 0; while ( $i < 100000) { $i++ }' 38.69s user 1.42s system 99% cpu 40.250 total ./perl6 -e 'my $i = 0; while ( $i < 100000) { $i++ }' 39.25s user 1.38s system 98% cpu 41.148 total }}} After: {{{ ./perl6 -e 'my $i = 0; while ( $i < 100000) { $i++ }' 38.54s user 1.40s system 99% cpu 40.211 total ./perl6 -e 'my $i = 0; while ( $i < 100000) { $i++ }' 37.98s user 1.49s system 98% cpu 40.193 total ./perl6 -e 'my $i = 0; while ( $i < 100000) { $i++ }' 38.57s user 1.46s system 99% cpu 40.349 total ./perl6 -e 'my $i = 0; while ( $i < 100000) { $i++ }' 39.16s user 1.33s system 99% cpu 40.864 total ./perl6 -e 'my $i = 0; while ( $i < 100000) { $i++ }' 37.91s user 1.53s system 98% cpu 40.064 total }}} I believe we can improve this further, by making heavier use of it. This will take some work to find these cases, though. Any case where you see a branch in callgrind which hits 6 million times and misses 3 times (or less), or vice versa, could use one of these annotations. ",patch,closed,normal,,none,1.2.0,medium,wontfix,,,,new, PWdRYB2SwytSt8Yioe9s7TVcSfXAS