Earlier quoted context omitted.
You shouldn't read too much into the PowerShell story. Creating your own programming language is in most cases a frivolous vanity project. Spending company resources on your own frivolous vanity projects is the sort of thing that can get you fired.
! I disagree. CMD badly needed replacing. MS needed a new shell language. A functional company would connect people with a passion for X with the resources to achieve X, if X has a chance of helping the company. Windows Terminal and WSL show how far MS has come from the PS days. (Disclaimer: I work for MS)
The Windows malloc() implementation from MSVCRT is slow
71–80 of 187 posts
Re: The Windows malloc() implementation from MSVCRT is slow
#72Earlier quoted context omitted.
It's effectively mandatory. Microsoft provides about twelve different C Runtimes. But if you're building something like an open source library, you can't link two different C runtimes where you might accidentally malloc() memory with one and then free() with the other. If you want to be able to pass pointers around your dynamic link libraries, you have to link the one C runtime everyone else uses, which is MSVCRT. Al…
It isn't mandatory. I have never actively linked against MSVCRT on Windows. From my experience it's mostly software that isn't built with Visual Studio that uses MSVCRT, or software that that takes extreme care of its binary size (e.g. 64k intros). MSVCRT is not even an up-to-date C runtime library. You wouldn't be able to use it for writing software requiring C11 library features without implementing them somewhere…
Re: The Windows malloc() implementation from MSVCRT is slow
#73Earlier quoted context omitted.
>but Microsoft never considered the MSVCRT that ships with Windows to be public API It was in the past. At first msvcrt.dll was the runtime library used up to Visual C++ 6. Later, VC++ moved to their own separate dlls, but you could still link with system msvcrt.dll using corresponding DDK/WDK up to Windows 7. I'm also not sure that this is just ancient library left for compatibility, some system components still lin…
> It was in the past. At first msvcrt.dll was the runtime library used up to Visual C++ 6. At that time it was already a big mess, because at first it was the runtime library of Visual C++ 4 in fact! The gory details are here: https://devblogs.microsoft.com/oldnewthing/20140411-00/?p=12... > some system components still link to it Some system components themselves are very much ancient and unmaintained and only exist…
Re: The Windows malloc() implementation from MSVCRT is slow
#74Earlier quoted context omitted.
malloc() isn't part of the Linux API which provides mmap().
Since we are getting pedantic, Linux isn't a UNIX.
I think this isn't quite right - I think some distributions are actually certified as UNIX.
Re: The Windows malloc() implementation from MSVCRT is slow
#75My understanding is mimalloc is basically a one-person project[1] from an MSR researcher in support of his research programming languages. It sounds like it's pretty nice, but I also wouldn't expect it to be somehow pushed as the default choice for Windows allocators.
[1]: https://github.com/microsoft/mimalloc/graphs/contributors
Re: The Windows malloc() implementation from MSVCRT is slow
#76Earlier quoted context omitted.
Libc being just a library is indeed one of the ways that Linux is unlike Unix.
What do you mean by "Unix"? Are you talking about some specific Unix version, or is there something in the POSIX spec that says that libc isn't a library?
Re: The Windows malloc() implementation from MSVCRT is slow
#77> it basically represents control flow as a gigantic DAG Control flow is not a DAG.
I guess they're just trying to say that LLVM's control-flow graph is implemented as individually heap-allocated objects for nodes, and pointers for edges. (I haven't looked at the LLVM code, but that sounds plausible).
Even if those allocations are fast on Linux/Mac, I wonder whether there are other downsides of that representation, for example in terms of performance issues from cache misses when walking the graph. Could you do better, e.g. with a bump allocator instead of malloc? But who knows, maybe graph algorithms are just inherently cache-unfriendly, no matter the representation.
Re: The Windows malloc() implementation from MSVCRT is slow
#78Earlier quoted context omitted.
There's also UCRT, which ships with the OS since Windows 10. The logic of this rant was a real head-scratcher. If you must blame one side, it's LLVM. Fragmentation of C runtimes is annoying but inescapable. Glibc for example isn't any better.
Could you elaborate why Glibc isn't any better? I remember some funny problems with Glibc, like, 20 years ago, but it's been invisible to me (as a user) since then. You get a new Glibc, old binaries still work, it's fine.
Re: The Windows malloc() implementation from MSVCRT is slow
#79My knowledge is like 10 years old - For a long time, Microsoft's stl implementation was based on their licensning of dinkumware's STL ( https://www.dinkumware.com/ ). Not something maintained in house. It seemed to work OK'ish - giving lowest common denominator functionality. However, it was pretty easy to create higher performing specialized data structures for your use case then what seemed like simple uses of dink…
Re: The Windows malloc() implementation from MSVCRT is slow
#80I mean, why exactly is the malloc of the compatibility msvcrt so slow compared to newer allocators? What is it doing?
An analysis of that would have been some actual content of interest.