For nerd purposes I’ve been trying to custom compile Wine to see if i can squeeze some performance out of it, i pulled out the -g flag and put in its place -O3 with march native. i don’t know how to benchmark properly to see if there at least a marginal gain, so idk if it is a placebo or not. tried to search for articles in the subject but found none

has anyone tried it or know an article that explored the subject?

  • Corngood
    link
    fedilink
    arrow-up
    11
    ·
    4 months ago

    IMO there’s no point in optimising without being able to measure the results.

    A profiler should be able to tell you how much time is spent running the code you’re attempting to optimise. It might turn out that the wine runtime code is not a significant factor in performance.

      • olgas_husband@lemmygrad.mlOP
        link
        fedilink
        arrow-up
        3
        ·
        4 months ago

        i searched phoronix and found nothing, they did other programs whenever a new gcc version launched, they compiled a lot of benchmarks with different flags and measure compile time and program performance, some programs gained a noticeable with -O3 -march=native

  • Max-P@lemmy.max-p.me
    link
    fedilink
    arrow-up
    7
    ·
    4 months ago

    It doesn’t matter because for the most part, you’re not spending most of your time in Wine code, you’re spending your time in the application’s code.

    So you might see some improvements if you’re running something that’s more of a Win32 API performance benchmark than an application benchmark.

    But even then, -O2 is already pretty good, and -O3 is a bit of a gamble whether it’ll be faster or slower. Sometimes O3 will pull the big guns and the real world dataset is always small and it wastes time in setup.

    -march=native might give you some nice speedups but it depends entirely on your CPU. If you have the latest CPU with all the features, it may take advantage of it.

    But it’s still all mostly things like using SIMD instructions to crunch through numbers faster. The Windows API doesn’t do a whole lot of that in the first place, but there’s also a few ABI boundaries you can’t change. It needs to receive and output data in the expected format in the expected registers. It can only optimize things that happen internally in Wine and are never observed by the application it’s running, further reducing the amount of optimization potential.

    So, it’s kind of a waste of time. It’s a lot more worth it for like video codecs and image processing

      • Atemu
        link
        fedilink
        arrow-up
        2
        ·
        edit-2
        3 months ago

        i use a ryzen 5 5600x, so march native should do something.

        It fully depends on the code. If the code in question does not do the kinds of calculations that can benefit from SIMD instructions, march=native will do absolutely nothing for you, no matter how special or new your CPU might be.

        I doubt WINE does many things that would benefit from SIMD but the only way to know for sure is to test it out.

    • melroy@kbin.melroy.org
      link
      fedilink
      arrow-up
      4
      arrow-down
      1
      ·
      4 months ago

      I think the position of the moon and the sun and the relationship between the two has more effect