<html><body><div style="font-family: times new roman, new york, times, serif; font-size: 12pt; color: #000000"><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;" data-mce-style="border-left: 2px solid #1010FF; margin-left: 5px; padding-left: 5px; color: #000; font-weight: normal; font-style: normal; text-decoration: none; font-family: Helvetica,Arial,sans-serif; font-size: 12pt;"><div>...<br class=""><blockquote class=""><div class=""><div style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; font-family: 'times new roman', 'new york', times, serif; font-size: 12pt;" class="" data-mce-style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; font-family: 'times new roman', 'new york', times, serif; font-size: 12pt;"><div class=""><br class=""></div><blockquote style="border-left-width: 2px; border-left-style: solid; border-left-color: rgb(16, 16, 255); margin-left: 5px; padding-left: 5px; font-weight: normal; font-style: normal; text-decoration: none; font-family: Helvetica, Arial, sans-serif; font-size: 12pt;" class="" data-mce-style="border-left-width: 2px; border-left-style: solid; border-left-color: #1010ff; margin-left: 5px; padding-left: 5px; font-weight: normal; font-style: normal; text-decoration: none; font-family: Helvetica, Arial, sans-serif; font-size: 12pt;"><div class=""><div class="">over 10000 mostly empty surfaces. There will be one extra indirection when accessing the surface_client_lossy region, but x86_64 became pretty darn good at chasing pointers like that thanks to C++ vtables ;-)</div></div></blockquote><div class="">Last sentence is a bit cryptic I think :-)<br class=""></div></div></div></blockquote><div><br class=""></div><div>Sorry. Did not mean to be. What I meant is that chasing pointers like a->b->c is required to perform well for virtual function calls in C++ (this->foo() translates into this->vptr->vtbl[n]()). At some point, it was a huge performance hit for many workloads, because CPUs were not that good at prefetching this kind of double-dereferences. But C++ and other similar programming techniques with double indirection became so prevalent that CPUs are now quite good at it.</div></div></blockquote><div>Was thinking at some more complicated like recent destructuring or something.<br></div><div>I think the most optimization came from h/w having more caches :-)<br></div><div>It's true that C++ can do more optimization that C as it has the full control of vtables (like merging<br></div><div>or putting in separate sections) but still you have the double dereference.<br></div><div>On the other way even Linux kernel uses a lot of xxxx_ops structures that are quite similar to<br></div><div>C++ vtables. I think you have two options basically... or you copy the function pointers for each<br></div><div>object (not really flexible, could be costly for small object or lot of pointers and hard to change<br></div><div>dynamically) or use the double dereference.<br></div><div><br></div><div>Frediano<br></div><div><br></div></div></body></html>