In what order are Panels the most efficient in terms of render time and performance?

I think it is more concise and understandable to describe the performance characteristics of each panel than it is to try to give an absolute relative performance comparison. WPF makes two passes when rendering content: Measure and Arrange. Each panel has different performance characteristics for each of these two passes. The performance of the measure … Read more

Why is it slower to iterate over a small string than a small list?

TL;DR The actual speed difference is closer to 70% (or more) once a lot of the overhead is removed, for Python 2. Object creation is not at fault. Neither method creates a new object, as one-character strings are cached. The difference is unobvious, but is likely created from a greater number of checks on string … Read more

Any optimization for random access on a very big array when the value in 95% of cases is either 0 or 1?

A simple possibility that comes to mind is to keep a compressed array of 2 bits per value for the common cases, and a separated 4 byte per value (24 bit for original element index, 8 bit for actual value, so (idx << 8) | value)) sorted array for the other ones. When you look … Read more