• 2 Posts
  • 13 Comments
Joined 1 year ago
cake
Cake day: March 13th, 2025

help-circle
    • My rule of thumb is at least 2GB of RAM per compilation jobs. Even if you have more cores, the jobs may start swapping or crashing slowing down the build in the end. This may of course depends on the size of the project.
    • Disable LTO during development. Is it only when you’re ready to release your binary.
    • If your editor doesn’t keep up, disable fancy IDE features such as Rust analyser. Run checks periodically the same way you run test.






  • Also there is strictyaml that validates against schemas. Don’t touch the builtin yaml module.

    Thanks. I’ll include that in an update.

    protobuf needs to be compiled. This introduces possibility of coder error. Just forgetting to compile and commit protobuf files after a change. This affected the electrum btc and ltc (light) wallets.

    Yes, that’s certainly a downside. It also demonstrates one should not commit such generated files. A better approach is to commit the source files (in this instance message definition) and have a compilation step included in the program’s build/install recipe.

    strictyaml





  • mina86@lemmy.wtftoPython@programming.devHow uv got so fast
    link
    fedilink
    English
    arrow-up
    1
    ·
    2 months 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.



  • 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.