glibc
Dota-2
glibc | Dota-2 | |
---|---|---|
45 | 85 | |
1,250 | 462 | |
3.0% | 1.5% | |
9.8 | 3.6 | |
7 days ago | 7 months ago | |
C | ||
GNU General Public License v3.0 or later | - |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
glibc
- I cut GTA Online loading times by 70% (2021)
-
Cray-1 performance vs. modern CPUs
I wonder if you’re using a different definition of ‘vectorized’ from the one I would use. For example glibc provides a vectorized strlen. Here is the sse version: https://github.com/bminor/glibc/blob/master/sysdeps/x86_64/m...
It’s pretty simple to imagine how to write an unoptimized version: read a vector from the start of the string, compare it to 0, convert that to a bitvector, test for equal to zero, then loop or clz and finish.
I would call this vectorized because it operates on 16 bytes (sse) at a time.
There are a few issues:
1. You’re still spending a lot of time in the scalar code checking loop conditions.
2. You’re doing unaligned reads which are slower on old processors
3. You may read across a cache line forcing you to pull a second line into cache even if the string ends before then.
4. You may read across a page boundary which could cause a segfault if the next page is not accessible
So the fixes are to do 64-byte (ie cache line) aligned accesses which also means page-aligned (so you won’t read from a page until you know the string doesn’t end in the previous page). That deals with alignment problems. You read four vector registers at a time but this doesn’t really cost much more if the string is shorter as it all comes from one cache line. Another trick in the linked code is that it first finds the cache line by reading the first 16 bytes then merging in the next 3 groups with unsigned-min, so it only requires one test against a zero vector instead of 4. Then it finds the zero in the cache line. You need to do a bit of work in the first iteration to become aligned. With AVX, you can use mask registers on reads to handle that first step instead.
-
Setenv Is Not Thread Safe and C Doesn't Want to Fix It
That was also my thought. To my knowledge `/etc/localtime` is the creation of Arthur David Olson, the founder of the tz database (now maintained by IANA), but his code never read `/etc/localtime` multiple times unless `TZ` environment variable was changed. Tzcode made into glibc but Ulrich Drepper changed it to not cache `/etc/localtime` when `TZ` is unset [1]; I wasn't able to locate the exact rationale, given that the commit was very ancient (1996-12) and no mailing list archive is available for this time period.
[1] https://github.com/bminor/glibc/commit/68dbb3a69e78e24a778c6...
-
CTF Writeup: Abusing select() to factor RSA
That's not really what the problem is. The actual code is fine.
The issue is that the definition of `fd_set` has a constant size [1]. If you allocate the memory yourself, the select() system call will work with as many file descriptors as you care to pass to it. You can see that both glibc [2] and the kernel [3] support arbitrarily large arrays.
[1] https://github.com/bminor/glibc/blob/master/misc/sys/select....
[2] https://github.com/bminor/glibc/blob/master/sysdeps/unix/sys...
[3] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/lin...
-
How are threads created in Linux x86_64
The source code for that is here.
-
Using Uninitialized Memory for Fun and Profit (2008)
Expanding macro gives three GCC function attributes [2]: `__attribute__ ((malloc))`, `__attribute__ ((alloc_size(1)))` and `__attribute__ ((warn_unused_result))`. They are required for GCC (and others recognizing them) to actually ensure that they behave as the standard dictates. Your own malloc-like functions won't be treated same unless you give similar attributes.
[1] https://github.com/bminor/glibc/blob/807690610916df8aef17cd1...
[2] https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attribute...
-
“csinc”, the AArch64 instruction you didn’t know you wanted
IFunc relocations is what enables glibc to dynamically choose the best memcpy routine to use at runtime based on the CPU.
see https://github.com/bminor/glibc/blob/glibc-2.31/sysdeps/x86_...
-
memmove() implementation in strictly conforming C -- possible?
memmove can be very well implemented in pure C, libc implementations usually have a "generic" (meaning, architecture independent) fallback. Here is musl generic implementation and its x86-64 assembly implementation. For glibc, implementation is a bit more complex, having multiple architectures implemented, but you could find a generic implementation with these two files: memmove.c and generic/memcopy.h.
-
Fedora 38 LLVM vs. Team Fortress 2
Yeah, looks like the Q_strcat(pszContentPath, "/"); is invalid, as glibc has only allocated exactly enough to fit the path in the buffer returned by realpath().
Interestingly, the open group spec says that a null argument to realpath is "Implementation defined" [0]
And the linux (glibc) man pages say it allocates a buffer "Up to PATH_MAX" [1]
I guess "strlen(path)" is "Up to PATH_MAX", but the man page seems unclear - you could read that as implying the buffer is always allocated to PATH_MAX size, but that's not what seems to be happening, just effectively calling strdup() [2]. I have no idea how to feed back to the linux man pages, but might be worth clarifying there.
[0] https://pubs.opengroup.org/onlinepubs/009696799/functions/re...
[1] https://linux.die.net/man/3/realpath
[2] https://github.com/bminor/glibc/blob/0b9d2d4a76508fdcbd9f421...
-
Method implementations
For the actual sources you will have to look at one of the mirrors of the C standard library, such as https://github.com/bminor/glibc/tree/master/sysdeps/ieee754/dbl-64
Dota-2
- Can we talk about the CONFIRMED 10th Anniversary Update?
-
Linux Dota not working since 7.33
Best place to report this issue/ get help is Here: https://github.com/ValveSoftware/Dota-2/issues
-
Game won't launch on Linux since 7.33b
Check https://github.com/ValveSoftware/Dota-2/issues/2285
-
Fedora 38 LLVM vs. Team Fortress 2
Valve does this for a couple of their games, see a similar issue with Dota 2[0].
[0] https://github.com/ValveSoftware/Dota-2/issues/2285
-
New patch crashing Dota 2 a few seconds on iMac
I'm on a M1 and experienced this once so far. Best bet would probably be to report the issue here: https://github.com/ValveSoftware/Dota-2/issues
-
Dota's Client Performance Has Declined: Here's Why (CPU usage)
Many people are not happy with Linux's performance either.
-
Strange crashes after TW 20230402 updates
The first program crashing is DOTA2, which seems to segfault a few moments after starting up, before an application window even spawns. This suggests to me it might be a Vulkan issue, and appears to be affecting some other users on rolling-release distros. The Github issue thread for it suggests it's caused by updating LLVM/clang to 16; I don't know if that's related, but I when I run zypper dup I do see the following package changes:
-
Trying to purchase Dead Reckoning Chest key crashes Dota2 on MacBook
Had a similar issue – found this Github thread that was helpful. You can purchase the key directly through the in-game Treasury tab.
-
[Linux] Awful FPS after today's update
I've filed an issue on Valve's bug tracker, hopefully this gets fixed soon :(
-
DotA2 on M1 (first gen) mac pro is almost unplayable. Anyone know how to make it work better?
Hey you can try searching the MacOS bug forum https://github.com/ValveSoftware/Dota-2/issues or maybe even filing an issue. This definitely seems like a bug if it’s not something to do with your Mac Pro in particular. Do you know anyone else with a Mac Pro?
What are some alternatives?
musl - Unofficial mirror of etalabs musl repository. Updated daily.
gamemode - Optimise Linux system performance on demand
cosmopolitan - build-once run-anywhere c library
DOTA - winter is coming..
dns - DNS library in Go
csgo-osx-linux - Counter-Strike: Global Offensive
0.30000000000000004 - Floating Point Math Examples
Dota-2-Vulkan - Tracker for issues specific to the Vulkan version of Dota 2 on Windows, Linux, and macOS
json-c - https://github.com/json-c/json-c is the official code repository for json-c. See the wiki for release tarballs for download. API docs at http://json-c.github.io/json-c/
halflife - Half-Life 1 engine based games
wepoll - wepoll: fast epoll for windows 🎭
Dota2 - Public Bug Tracker for Dota2 [Moved to: https://github.com/ValveSoftware/Dota2-Gameplay]