• 1 Post
  • 110 Comments
Joined 11 months ago
cake
Cake day: March 13th, 2025

help-circle
  • mina86toPython@programming.devHow uv got so fast
    link
    fedilink
    English
    arrow-up
    1
    ·
    2 days ago

    No bytecode compilation by default. pip compiles .py files to .pyc during installation. uv skips this step, shaving time off every install. You can opt in if you want it.

    So it makes installation faster by making runtime slower.

    Ignoring requires-python upper bounds. When a package says it requires python<4.0, uv ignores the upper bound and only checks the lower. This reduces resolver backtracking dramatically since upper bounds are almost always wrong. Packages declare python<4.0 because they haven’t tested on Python 4, not because they’ll actually break. The constraint is defensive, not predictive.

    So it makes installation faster by installing untested code.

    Sounds like a non-starter to me.









  • mina86toLinux@lemmy.mlhelp made mistake with export and ~/.bashrc
    link
    fedilink
    English
    arrow-up
    22
    ·
    edit-2
    1 month ago

    Firstly, and most importantly, executing grub-install requires super-user privileges. Rather than adding it to PATH you should instead run the command through sudo. A regular user typically does not need any of sbin directories in their PATH.

    As for the command itself, there are three things wrong with it:

    1. PATH should only include directories whereas you tried to add to it a path to an executable. So rather than /usr/sbin/grub-install/grub-install you should just add /usr/sbin.
    2. White space is significant, so the space before colon would make your command not work anyway.
    3. Rather than appending to PATH you’ve overwritten the variable. Instead you need PATH="$PATH:/usr/sbin/:/usr/local/sbin" (notice $PATH: at the beginning of the assignment).

    Also, export is unnecessary since PATH is already an environment variable. (That’s also bashism but that’s likely an irrelevant issue).











  • I’m essentially trying to find the most performant way to get a simple read/write buffer.

    Stack is hot so it’s probably better to put things there than to have static array which is out of memory cache and whose address is out of TLB.

    To answer your question, yes, this is undefined behaviour if the function is called from multiple threads. It’s also undefined behaviour if, by accident, you take second reference to the array.

    It’s unlikely that you really need to do anything fancy. I/O is usually orders of magnitude slower than dealing with memory buffers. Unless you profile your code and find the bottleneck, I’d advice against static mutable buffer.

    PS. On related note, a shameless plug: Rust’s worst feature.