Announcement

Collapse
No announcement yet.

Mesa Looks At Switching To Jemalloc For Faster Performance

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #11
    Originally posted by Mystro256 View Post
    Lockless 1.2 was released over 4 years ago; jemalloc maybe a better option due to its continued development and use in other applications (i.e. more testing).
    *lol*

    So it was released a while back. What do you think it does and why do you expect it to be so much more complicated? It's a only few functions and the API is ancient and very simple.

    Most allocators follow a complex implementation and therefore require continued development. Not just for the algorithms but for the configuration and build support, too. Lockless malloc is very simple and it works. It just doesn't need further development. It comes as a single C file with a few header files. It's thread-safe without a need for locking by using inline assembler statements for the critical parts. Sure, it doesn't come with a configure script of 10,000 lines, but why is this important when you can have something much simpler?

    Comment


    • #12
      [QUOTE=schmidtbag;n901299If pre-built mesa doesn't require jemalloc as a dependency[/QUOTE]what is this 'pre-built' thing? your distro package? why would you care?

      Comment


      • #13
        Originally posted by schmidtbag View Post
        If pre-built mesa doesn't require jemalloc as a dependency
        what is this 'pre-built' thing? your distro package? why would you care?

        Comment


        • #14
          Originally posted by sdack View Post
          Lockless malloc is very simple and it works. It just doesn't need further development.
          i'm sure it works, but does it work better than jemalloc and why mozilla didn't switch to it?
          Originally posted by sdack View Post
          It's thread-safe without a need for locking by using inline assembler statements for the critical parts.
          you don't get thread safety for free by switching to assembler. maybe you wanted to say it uses atomic operations in lock-free manner, but so are other mallocs

          Comment


          • #15
            Does jemalloc ever return allocated memory back to system yet?
            IIRC that used to be the biggest no-go in many softwares, cacheing and pooling old chunks for reuse is nice and all, but apart from security implications this somewhat disqualifies it from usage in persistent services/daemons.

            Comment


            • #16
              Originally posted by pal666 View Post
              what is this 'pre-built' thing? your distro package? why would you care?
              Y'know... not having to compile it yourself? But that's my point - if I don't need extra dependencies (including whatever jemalloc may depend on) then I don't care and I welcome this change.

              Comment


              • #17
                Originally posted by schmidtbag View Post
                Y'know... not having to compile it yourself? But that's my point - if I don't need extra dependencies (including whatever jemalloc may depend on) then I don't care and I welcome this change.
                Jemalloc will need to be installed for Mesa to work, of course but jemalloc itself doesnt pull anything more as dependency. As far as compile yourself it shouldn't happen unless you use gentoo(where you compile everything anyway) or you use some dark backwater obscure distro that doesnt provide jemalloc package(i mean jemalloc is really really common and a lot of software pull it as dependency already).

                Comment


                • #18
                  Originally posted by schmidtbag View Post
                  if I don't need extra dependencies
                  why would you care about deps, your package manager will install them automatically
                  Originally posted by schmidtbag View Post
                  (including whatever jemalloc may depend on)
                  it takes imagination to think of memory allocator with dependencies

                  Comment


                  • #19
                    Originally posted by pal666 View Post
                    i'm sure it works, but does it work better than jemalloc and why mozilla didn't switch to it?
                    you don't get thread safety for free by switching to assembler. maybe you wanted to say it uses atomic operations in lock-free manner, but so are other mallocs
                    Using LD_RELOAD did I compare the 4 year old lockless malloc to the recent jemalloc by compiling my kernel just now:

                    Code:
                    Default glibc:
                    real    2m56.383s
                    user    20m13.058s
                    sys    1m29.841s
                    
                    jemalloc 4.2.1:
                    real    2m55.498s
                    user    19m34.992s
                    sys    1m53.795s
                    
                    locklessmalloc:
                    real    2m47.544s
                    user    18m57.032s
                    sys    1m38.243s

                    Comment


                    • #20
                      Originally posted by sdack View Post
                      Using LD_PRELOAD ...
                      Sorry, minor typo. Setting the variable to the allocator library will force it to link-load it before libc.

                      Comment

                      Working...
                      X