| Post Reply | RetroFed Forum Forum Index
» Programming
Page 2 of 3 Goto page « First Previous 1, 2, 3 Next Last » |
| Author | Message | ||
|---|---|---|---|
UiUiUiUiUi
piefed.nl
UiUiUiUiUi@piefed.nlJoined: 2026-09-24 |
SQLite > pgsql Disagree. Different tools for different jobs.
My perspective is a self hosting hobbyist I noticed for those running on more reliable vps servers with rollbacks being a last resort the higher requirements are not as important. |
||
| 1 | |||
|
GamingChairModel
lemmy.world
GamingChairModel@lemmy.world Joined: 2023-07-05 |
Web development and using browser renderers for GUIs is one of my most hated aspects of modern software. š¤¢
Sorry guys, back in 2008, I asked a monkey's paw for better first party software support for desktop Linux, and this is what we got. |
||
| 18 | |||
thingsiplay
lemmy.ml
thingsiplay@lemmy.mlJoined: 2026-01-09 |
Counterpoint, I wrote a Python program that reads a load of JSON and runs regex searches over it. It was quite slow. Rewrote it in Rust as a straight 1:1 port, no algorithmic changes. 50x speedup. I think you must have either done something very wrong or your Python program didn't really do anything other than call Python built-ins that are actually written in C.
It wasn't a very wrong what I did in Python. I did the obvious thing. While I do not remember details, I remember it had something to do with adding items I think. But sadly I have not documented this issue, that's on me. It was only noticeable for really huge files like 50MBytes json. Edit: Most weren't this big, but it also combined over 100 Json files into one, so a search would search them all through and be able to save as a single file. |
||
| 1 | |||
|
[object Object]
lemmy.world
SlurpingPus@lemmy.world Joined: 2025-11-03 |
Recently had to develop a Python project, the tests took at least ten seconds to start each single time. This is while I made over a hundred tests for my module and re-ran them after every change. Python is dog slow, but if your tests are taking 10 seconds to start (not even run!), then something is catastrophically wrong with your setup. For comparison, for one of my projects, it takes a total...
It wasn't my project. Afaict it's a standard pytest setup with the Litestar framework (unused in my tests) and an in-memory mock Postgre transaction with like five records per test, so choose for yourself which part of this is 'catastrophically wrong'. However, I can indeed agree that most of it is trash. Same approach with dozens upon dozens of tests worked snappily as heck in PHP, haven't yet tried it with my beloved Lua. |
||
| 1 | |||
|
ISO
lemmy.zip
ISO@lemmy.zip Joined: 2025-06-06 |
Or the fact that you canāt do concurrency especially across the language barrier from another language without multiple python runtimes orchestrated with a queue and IPC because of possible process-wide global state and similar concerns/assumptions for any python library dependency that is not all native across its own dependency chain? This is very out of date. I haven't written Python for ove...
It's not outdated, and maybe you didn't get what I was talking about, but probably because I didn't word it well. So let me quote someone else instead:
This covers the layers below python, but still doesn't fully cover the process wide restrictions (it's not just about thread safety, global initialization and resources are very relevant too). It also doesn't cover the exact same problem which also exists for any layer calling into python from above, which also relies/relied on the GIL for synchronization. This means that you can't effectively, confidently, and safely scale python without scaling the number of python runtime instances, each in its own full OS process. The fact that So not only the proposition (which someone referenced in another sub-thread) to move everything into python is in and of itself a self-defeating argument, since it proves a language being a problem (through forcing language lock-in). But even within a language (python), not all problems are solvable still. Note that this is not all theoretical for me. In one of my previous projects, I had to call into a python library (which didn't have an adequate alternative) from rust code (through pyo3). And I was forced to scale with multiple python runtimes, each getting one request/message at a time. And we still didn't get to any low-level details yet š |
||
| 1 | |||
TrickDacy
lemmy.world
TrickDacy@lemmy.worldJoined: 2023-07-27 |
Nah, software is slow because it runs a web engine for GUI.
God, this again. |
||
| 2 | |||
dylanTheDeveloper
lemmy.world
dylanTheDeveloper@lemmy.worldJoined: 2023-06-09 |
Has everyone forgotten the art of creating or using performance profiling tools |
||
| 33 | |||
Eager Eagle
lemmy.world
eager_eagle@lemmy.worldJoined: 2023-07-07 |
What about the fact that runtime startup alone auto-disqualifies python for all short-lived process use-cases? While Python's start-up time is a lot slower than a corresponding compiled program, in most cases it's not slow enough to matter even if the process itself is short-lived: $ hyperfine 'python3 -c "pass"' Benchmark 1: python3 -c "pass" (412 runs) mean ± Ļ min ⦠max Wall Time 7.1 ms ± 0....
Thanks for putting numbers. People really overblow python performance issues when it literally does not matter most times. |
||
| 4 | |||
|
jason
discuss.online
jason@discuss.online Joined: 2024-12-11 |
Never understood the idea of, "if it needs to be fast, that part is in a faster language." Why not just use the faster language? Most of the libraries that have Python wrappers also come with c headers. Sometimes you wind up in the reverse situation where your dependency doesn't have a Python wrapper and now you're stuck managing silly boilerplate. Python just feels like an extra thing in the way to wrangle for little gain. Also, hotspot-only optimization doesn't seem to have held up in reality, right? We can all agree that software is getting slower every day. The infrastructure is slow. All feels like cope, through and through. |
||
| 1 | |||
0xDREADBEEF
lemmy.dbzer0.com
dreadbeef@lemmy.dbzer0.comJoined: 2024-12-18 |
It still adds a lot of layers between the user and the processor.
What does that even mean? I make GUIs in web technologies, I make GUIs in godot, I make GUIs in bevy, I make GUIs in flutter, etc etc. Blink uses Skia. Flutter uses Skia. Is skia just bad? What are you even saying? What is slow about web tech, really? To me performance is almost always bad engineering choices like not understanding or handling I/O. |
||
| 4 | |||
0xDREADBEEF
lemmy.dbzer0.com
dreadbeef@lemmy.dbzer0.comJoined: 2024-12-18 |
[deleted]
|
||
| 1 | |||
|
Bane_Killgrind
lemmy.dbzer0.com
Bane_Killgrind@lemmy.dbzer0.com Joined: 2025-06-15 |
I'd like you to name 1 that's multi-hundred MB.
Can't, I was thinking of MSN.com but they had a redesign sometime, they come in at 5.6mb now |
||
| 2 | |||
|
Caveman
lemmy.world
olafurp@lemmy.world Joined: 2023-08-19 |
I wrote a program in Python to read some huge Json files. It took forever to finish. Turned out I could optimize it with some simple changes, which reduced 10 minutes to 10 seconds (not literally, just figurative) and made a difference in huge files only. Later I rewrote the program in Rust. And you know what happened? It was slower than the Python version. Only after understanding what I was d...
I mean, python has a very nice set of tools that run at C speed so it's not crazy to think you can get good performance out of it. |
||
| 2 | |||
explodicle
sh.itjust.works
explodicle@sh.itjust.worksJoined: 2024-04-11 |
Never understood the idea of, "if it needs to be fast, that part is in a faster language." Why not just use the faster language? Most of the libraries that have Python wrappers also come with c headers. Sometimes you wind up in the reverse situation where your dependency doesn't have a Python wrapper and now you're stuck managing silly boilerplate. Python just feels like an extra thing in the w...
IMHO it's easier to quickly iterate with Python than with C++. If you aren't even sure what you want and you're just writing stuff, then Python is great. Is "4" true? Ofc it is. |
||
| 6 | |||
|
Caveman
lemmy.world
olafurp@lemmy.world Joined: 2023-08-19 |
Why would that slow it down exactly? Nothing really slow about GPU accelerated graphics these days? Would love to hear the technical reasons. You need to have UI kits for GUIs. Responsive and accessible UI kits are hard. The web solved them a decade ago and made them easier to achieve than ever before. Why invent the wheel twice? I/O is the slowest thing ever. The more I/O dependent your app is...
It's mostly because of memory cache misses. JS creates a ton of closures and has a lot of context switching. JS engines are basically a modern day miracle for how fast they are but somehow webapps are still sluggish. |
||
| 5 | |||
|
capital5
discuss.tchncs.de
capital5@discuss.tchncs.de Joined: 2026-08-20 |
It's not outdated, and maybe you didn't get what I was talking about, but probably because I didn't word it well. So let me quote someone else instead: While pure Python code should work unchanged, code written in other languages or using the CPython C API may not. The GIL was implicitly protecting a lot of thread-unsafe C, C++, Cython, Fortran, etc. code - and now it no longer does. Which may ...
Ah okay, I see what you're saying. GIL removal can break FFI code through the C API. I have a lot of thoughts on this, and most of it is too incoherent to put into a comment someone else can understand, but for the most part, I think the issues are still pretty overblown. I just can't see a world where Python needs true multithreading support when multiprocessing works just fine for most applications. You find a hot loop, you parallelize it in multiprocessing and just like that, your process runs much faster. I do think that GIL removal is a terrible idea in general, for the reasons in the quote you provided, but at least it's optional. I would personally not enable it in anything I maintain for several years if I didn't have to. I also think that polyglot code running in the same process is also a bad idea. I can understand calling C or Fortran from Python for numerical processing for example, but doing the reverse (like calling Python from Rust) is something I try to avoid at all costs. In any project I've worked on, if significant portions of the codebase were written in different languages, you would just use something like protobuf to specify the I/O protocol between the different languages and call them across a socket. It's easier to maintain in my opinion since it defines a concrete boundary between the two different portions of code, and also makes it much easier to test each component separately too. |
||
| 1 | |||
|
boonhet
sopuli.xyz
boonhet@sopuli.xyz Joined: 2025-06-16 |
Has everyone forgotten the art of creating or using performance profiling tools
Pay me to do it and I'll gladly do it. Most companies, however, don't really care much about whether the customers take an extra 100 milliseconds for every request or not. And when it's promotion time, you're often judged by how many tasks you get done, not how fast your code is. |
||
| 15 | |||
|
boonhet
sopuli.xyz
boonhet@sopuli.xyz Joined: 2025-06-16 |
What does that even mean? I make GUIs in web technologies, I make GUIs in godot, I make GUIs in bevy, I make GUIs in flutter, etc etc. Blink uses Skia. Flutter uses Skia. Is skia just bad? What are you even saying? What is slow about web tech, really? To me performance is almost always bad engineering choices like not understanding or handling I/O.
So that means every single developer that has ever used Electron or CEF for something, has been making bad engineering choices? You may have something there. |
||
| 3 | |||
thingsiplay
lemmy.ml
thingsiplay@lemmy.mlJoined: 2026-01-09 |
Yeah nah, Lua runs circles around Python both at runtime and especially at startup. I've made me some desktop automation scripts in Lua to call from Alfred, I had to recheck that I didn't leave static test data in there instead of calling the script, because the results were appearing instantly. Recently had to develop a Python project, the tests took at least ten seconds to start each single t...
Lua also doesn't provide everything Python does and has a totally different use case. |
||
| 2 | |||
thingsiplay
lemmy.ml
thingsiplay@lemmy.mlJoined: 2026-01-09 |
It wasn't my project. Afaict it's a standard pytest setup with the Litestar framework (unused in my tests) and an in-memory mock Postgre transaction with like five records per test, so choose for yourself which part of this is 'catastrophically wrong'. However, I can indeed agree that most of it is trash. Same approach with dozens upon dozens of tests worked snappily as heck in PHP, haven't yet...
Then its the Test environment that is slow, not Python. |
||
| 2 | |||
bss03
infosec.pub
bss03@infosec.pubJoined: 2023-10-02 |
Never understood the idea of, "if it needs to be fast, that part is in a faster language." Why not just use the faster language? Most of the libraries that have Python wrappers also come with c headers. Sometimes you wind up in the reverse situation where your dependency doesn't have a Python wrapper and now you're stuck managing silly boilerplate. Python just feels like an extra thing in the w...
Because the other language is more developer-friendly or faster to write/read even if slower to execute. Some code doesn't need to be fast because it is always waiting on other things anyway. Some languages effectively prevent whole classes of runtime failures / bad code. But, they do that by doing more which takes longer, at compile-time, run time, or both. Some programs can't avoid graph-structured data dependencies. In that case, the simplest solution is a garbage collector, and one built into the runtime is capable of being more efficient (and less buggy) than one written for a specific program. Anyway, there are many factors that determine which language is "best", and not all of them are objective. That's why we don't just use the fastest language. (Currently, I do all my coding in either Idris or Purescript, but I'm also unemployed and just programing for myself, for now.) |
||
| 11 | |||
bss03
infosec.pub
bss03@infosec.pubJoined: 2023-10-02 |
I'd add that most of the time nobody actually measured anything. at work we inherit slow sites all the time and the first guess is always "the stack", then you profile it and it's one query running per item in a loop or something like that. I had the same with my own side project, was sure I needed a bigger server and after measuring the problem was somewhere else completely. measuring first is...
Profiling complex systems can be quite difficult. That said, I believe in the adage "Profile twice, optimize once.", adapted from the old carpenters adage of "Measure twice, cut once." Slowness is rarely essential, but I can be far away from where you expect it. |
||
| 9 | |||
bss03
infosec.pub
bss03@infosec.pubJoined: 2023-10-02 |
...I don't use Goog's search, just like probably many people on Lemmy.
Yeah, I long ago switched to ddg and I also turn off the ddg ai stuff. I hear the paid search is also out-performing Google for people that care their search results are accurate. |
||
| 3 | |||
bss03
infosec.pub
bss03@infosec.pubJoined: 2023-10-02 |
Yes and no. It's not usually the fault of the programming language. But programming languages have a unique ability: The design of the language itself can and will instill bad or good habits into the code of oneself. These languages are designed pretty deliberately, so those habits are a direct consequence of the design of a language. In fact, Sean Goedecke's own C-to-Rust example makes this po...
Malbolge. ;) |
||
| 3 | |||
nebula
lemmy.ca
nebula@lemmy.caJoined: 2023-07-19 |
In reply to an earlier post
Had the same experience when I was testing zed. Was thinking it would be a lot better since it's written in rust but there wasn't any difference in memory/CPU usage between it and VSCodium, which is electron app. |
||
| 1 | |||
|
FizzyOrange
programming.dev
FizzyOrange@programming.dev Joined: 2023-09-24 |
In reply to an earlier post
No. It was a simple enough program that there were no areas for improvement anyway. I also did not use a profiler for the Rust code.
In my experience this is also a sweet sounding lie to make people feel ok with using Python. Yes in some case you make a big mistake and there's a large bottleneck you can easily remove... Or your program has a nice small hotspot where it spends most of its time and you can just write that bit in C++ (AI is the obvious example). But most programs are not like that. They're more like MS Word. Slowness is evenly distributed through the code. There is no hotspot to remove. As an example of this, look at Nicholas Nethercote's excellent series of blogs on making the Rust compiler faster: https://nnethercote.github.io/ The "bottlenecks" they find result in 1% speedups. |
||
| 1 | |||
|
thevoidzero
lemmy.world
thevoidzero@lemmy.world Joined: 2024-01-25 |
Has everyone forgotten the art of creating or using performance profiling tools
I was in a meeting with a senior software engineer, who makes a shit ton more than me. While sharing my screen he saw flame graph I had for one program I was working on. They asked "what is that?", I was taken back, and said it's for looking at which functions are taking more time. Then I was asked "where did you find it?" I was shell shocked, didn't know how to answer that. Similar things have happened before where I taught them certain things, and they go "great find", like dude, I didn't find it just now. That's basic knowledge if you work with database. I am not even a developer hire, I'm self learned, and because the company doesn't have many developers they gave me some of the tasks and I'm doing it because it's more fun than my job responsibilities, and when I don't have enough tasks. |
||
| 25 | |||
|
expr
programming.dev
expr@programming.dev Joined: 2023-07-03 |
Profiling complex systems can be quite difficult. That said, I believe in the adage "Profile twice, optimize once.", adapted from the old carpenters adage of "Measure twice, cut once." Slowness is rarely essential, but I can be far away from where you expect it.
That's what Open Telemetry is for, honestly, specifically tracing. I'm in the process of adding tracing for all of our web handlers, http client calls, database transactions/individual queries, and asynchronous jobs. Should give us a pretty good view into the performance of the system, and allow us to monitor for things like performance regressions without any dedicated profiling needed (though we certainly could add additional profiling information through Otel down the road). Since I know you're a Haskeller (recognize your handle), the |
||
| 7 | |||
|
ISO
lemmy.zip
ISO@lemmy.zip Joined: 2025-06-06 |
Ah okay, I see what you're saying. GIL removal can break FFI code through the C API. I have a lot of thoughts on this, and most of it is too incoherent to put into a comment someone else can understand, but for the most part, I think the issues are still pretty overblown. I just can't see a world where Python needs true multithreading support when multiprocessing works just fine for most applic...
If you didn't automatically register that requiring spawning full OS processes to scale performance immediately disqualifies a language from a whole plethora of use-cases (which is what the intellectually deficient OP tried to argue against), then I'm not sure you're qualified to opine on the matter (hint: spawning a thread per task is already too much overhead for many workloads). And I don't mean any disrespect to you here. Your replies were far from the worst in this thread. Frankly this thread has been very illuminating. My perception of the average p.d user and their concrete knowledge was very inflated. And we didn't even get to low level stuff yet. People are already failing at the macro level. Sad. |
||
| -1 | |||
|
capital5
discuss.tchncs.de
capital5@discuss.tchncs.de Joined: 2026-08-20 |
Did you use a profiler to find the bottlenecks? No. It was a simple enough program that there were no areas for improvement anyway. I also did not use a profiler for the Rust code. good Python devs know how to find bottlenecks in their software and replace them with fast implementations In my experience this is also a sweet sounding lie to make people feel ok with using Python. Yes in some case...
If you didn't use a profiler, then how can you be sure that the issue was Python and not something else? If the slowness really is evenly distributed through the code as you suggest, then a profiler would show that almost instantly and it's very easy to do that in Python using cProfile. On top of that, the Python standard library is built for convenience, not performance. The nature of it being a standard library means that the implementation has to be simple. fastregex uses LLVM and SIMD for example, that's something that's wildly impractical for the Python stdlib to support. In contrast, I have no idea what regex or JSON library you used for your Rust code, but if it were outside the stdlib, chances are high that it had much more leeway to optimize performance because it didn't have all the other maintenance obligations that stdlib code needs to support. All of this is just pure speculation on my part, but ultimately I'm trying to make a point that it is hard to say that the difference was caused by a language issue and not something else. There are lots of other things that could be contributing to this difference and you can't really say for sure without meaningful diagnostics.
The kinds of software that you and I write on a daily basis is nothing compared to pieces of software that get millions of man-hours per year. Assuming you're not Linus Torvalds or Ted Ts'o hiding behind a funny alias, of course. I don't think anyone is suggesting that it's a good idea to write a compiler in Python (outside of prototyping purposes perhaps) since it's obviously not I/O bound, but if you and I are trying to optimize something we wrote ourselves, we're more likely to be in the "nice small hotspot" domain you described, rather than the 1% bottleneck speedups discussed in the link you posted. Very cool link though by the way, I look forward to reading as much of it as I can.... |
||
| 5 | |||
0xDREADBEEF
lemmy.dbzer0.com
dreadbeef@lemmy.dbzer0.comJoined: 2024-12-18 |
To me performance is almost always bad engineering choices like not understanding or handling I/O. So that means every single developer that has ever used Electron or CEF for something, has been making bad engineering choices? You may have something there.
Why is how nodejs or cef does I/O worse than any other GUI toolkit's I/O layer? |
||
| 1 | |||
0xDREADBEEF
lemmy.dbzer0.com
dreadbeef@lemmy.dbzer0.comJoined: 2024-12-18 |
It's mostly because of memory cache misses. JS creates a ton of closures and has a lot of context switching. JS engines are basically a modern day miracle for how fast they are but somehow webapps are still sluggish.
Memory cache hits are destroying performance? Is this profiled or just guesswork? I don't understand how that's tied to perceived performance degradation specific to web-based toolkits like Blink and Webkit |
||
| 3 | |||
|
capital5
discuss.tchncs.de
capital5@discuss.tchncs.de Joined: 2026-08-20 |
If you didn't automatically register that requiring spawning full OS processes to scale performance immediately disqualifies a language from a whole plethora of use-cases (which is what the intellectually deficient OP tried to argue against), then I'm not sure you're qualified to opine on the matter (hint: spawning a thread per task is already too much overhead for many workloads). And I don't ...
That's way too broad of a statement to be true in any absolute sense. It really depends on what you're doing, and sure, there are plenty of ways to do it stupidly, but a lot of people that are smarter than you and me have thought about ways that the overhead of spawning processes can be mitigated. All I can say is that I've had perfectly good success using
What do you want to talk about? Are you writing kernel drivers in Python or something? Why would we talk about writing low level code in Python, that sounds absurdly stupid. Most of the high performance libraries people use are written in Fortran or C. The entire field of data science uses Python, if performance were not a heavily optimized problem, then a lot of people out there must really love wasting their money on compute. Python is a glue language for high performance low level code, everybody knows this already.
At least we agree on something! |
||
| 3 | |||
|
boonhet
sopuli.xyz
boonhet@sopuli.xyz Joined: 2025-06-16 |
Why is how nodejs or cef does I/O worse than any other GUI toolkit's I/O layer?
I haven't gotten deep enough into it to see what's wrong, but pretty much any Electron or CEF application I've used has been pretty slow, though it could be that I have a very weak PC since I only have a Ryzen 5700 and 32 gigs of DDR4 and my NVMe drives (root and home partitions being separate physical drives) are only running on PCIe 3.0, not 4.0 or 5.0. Perhaps I ought to see if things like Steam or Discord run better if I upgrade to a mid-range PC with a Ryzen 9900x, faster RAM and faster drives, but I'm not made of money. Games run smoothly, mind you - those don't require very beefy hardware after all. It's only extremely visually and IO demanding applications like Steam or Discord that run like absolute dogshit for me. Slack used to be pretty bad too, but I don't use it these days, don't need it. Ditto for Mattermost. I have one computer dedicated to Microsoft Teams, it's got a 12th gen i7 in it which can't really handle the task, but that's just Microsoft for you, everything they've made in the last decade has been shit. |
||
| 2 | |||
|
boonhet
sopuli.xyz
boonhet@sopuli.xyz Joined: 2025-06-16 |
In reply to an earlier post
You could just use the standard library and refrain from using third party libraries? That's how you get a smaller binary size in just about any language. |
||
| 1 | |||
|
expr
programming.dev
expr@programming.dev Joined: 2023-07-03 |
Had the same experience when I was testing zed. Was thinking it would be a lot better since it's written in rust but there wasn't any difference in memory/CPU usage between it and VSCodium, which is electron app.
From what I remember, Vscode has quite a fair bit of native code in various areas to make it perform better. So it may not be the representative Electron app for comparison. |
||
| 1 | |||
|
boonhet
sopuli.xyz
boonhet@sopuli.xyz Joined: 2025-06-16 |
In reply to an earlier post
Well that depends. Are you going with micro services because it's fashionable or because different parts of your backend work with completely different data and don't need to communicate with eachother that much? I'm of the opinion that anything that needs to share one database should be one service, and things that are so easily detached that you can just plop the tables over into a separate database, can be separate services, because that will allow you to scale up one without scaling the other and one database's I/O won't get in the way of the other database's I/O (assuming they're on different machines of course). I'd say: Microservices ~ monolith > Distributed monolith Distributed monoliths suck. |
||
| 1 | |||
|
boonhet
sopuli.xyz
boonhet@sopuli.xyz Joined: 2025-06-16 |
My perspective is a self hosting hobbyist I noticed for those running on more reliable vps servers with rollbacks being a last resort the higher requirements are not as important.
That's as a self-hosting hobbyist. Sqlite is great for that. It stops being great when you have thousands of users, and good luck using it with millions. |
||
| 2 | |||
|
[object Object]
lemmy.world
SlurpingPus@lemmy.world Joined: 2025-11-03 |
Then its the Test environment that is slow, not Python.
It is, yes. But I also commented on Lua vs Python, and if you even try to time them, Lua scripts will be finished before Python starts up. Lua is so fast that people mostly don't bother making libs for it in C, the fucking interpreter is quick enough for folks to skip any kind of compiling and just write libraries in the interpreted language. Oh, didn't I mention? The startup thing is with the interpreter, without any kind of bytescript, JIT and such. In the same vein, the K and Q languages and the KDB+ database by Arthur Whitney are so goddamn fast at array processing that they're used in banking for decades despite their extremely inscrutable syntax that would shear any Python programmer's head clean off. They just stay in the cache at most times. And they are also interpreted, not compiled at any time. Python suffers from the same shit as Java, it has to initialize hundreds of objects before the main program even starts, and then it creates hundreds more. Neither Lua nor JavaScript do that. PHP does to some extent, but the fucker is so fast that it can recreate the entire runtime context on every single request and then drop all of it afterwards, and it's still quicker than Python. |
||
| 0 | |||
|
FizzyOrange
programming.dev
FizzyOrange@programming.dev Joined: 2023-09-24 |
If you didn't use a profiler, then how can you be sure that the issue was Python and not something else? If the slowness really is evenly distributed through the code as you suggest, then a profiler would show that almost instantly and it's very easy to do that in Python using cProfile. On top of that, the Python standard library is built for convenience, not performance. The nature of it being...
It was a relatively simple program and I am good at programming. The point is, I put the same amount of effort into writing the same program in Python and Rust, and Rust was 50x faster. With AI, I don't see any reason to use Python these days anyway. I never bought the productivity arguments before (Rust is easily as productive as Python), but with AI Rust is definitely more productive than Python because of the much stronger static checks. |
||
| -2 | |||
|
[object Object]
lemmy.world
SlurpingPus@lemmy.world Joined: 2025-11-03 |
Lua also doesn't provide everything Python does and has a totally different use case.
Oh really? Well guess what, that's a huge benefit for Lua because its entire total size is around 500 KB. It's loaded into memory and executed start to finish faster than you blink. If you need a āstandard libraryā, just use Penlight. As I already mentioned, vast majority of libraries for Lua are written in... Lua itself, because it's so goddamn fast. I'm using Fennel, the Lua Lisp that's transcribed on-the-fly, and it's still faster than Python. Lua is great for interactive tasks like desktop automation, e.g. with Alfred, Hammerspoon (which latter uses Lua throughout), or for scripting in Termux on the phone where Python would kill the memory immediately. Lua's problems with the absence of popular libraries aren't because of any language issues (even the lack of |
||
| 0 | |||
bss03
infosec.pub
bss03@infosec.pubJoined: 2023-10-02 |
That's what Open Telemetry is for, honestly, specifically tracing. I'm in the process of adding tracing for all of our web handlers, http client calls, database transactions/individual queries, and asynchronous jobs. Should give us a pretty good view into the performance of the system, and allow us to monitor for things like performance regressions without any dedicated profiling needed (though...
Yeah we used hs-opentelemetry at my last paid position. The company was an MS shop, tho so we were using ODBC to connect to MS SQL Server which doesn't have great in-process profiling. But, at least we could figure out what quer(y/ies) were running long and then we could use the MS tools to look at the plan and fiddle with that. It was also a small org, so it's not like there was a lot of internal services in one flow -- basically everything either stayed in the Web Yesod app or in the IVR app. All our profiling could have been instrumented process profiling instead of having to use otel at all. So, I haven't seen how easy/difficult it is to actually use otel across multiple internal service calls to satisfy one external request. |
||
| 2 | |||
thingsiplay
lemmy.ml
thingsiplay@lemmy.mlJoined: 2026-01-09 |
It is, yes. But I also commented on Lua vs Python, and if you even try to time them, Lua scripts will be finished before Python starts up. Lua is so fast that people mostly don't bother making libs for it in C, the fucking interpreter is quick enough for folks to skip any kind of compiling and just write libraries in the interpreted language. Oh, didn't I mention? The startup thing is with the ...
The use case for Lua is very different from Python. It's not directly comparable, as Lua is barebones. |
||
| 2 | |||
thingsiplay
lemmy.ml
thingsiplay@lemmy.mlJoined: 2026-01-09 |
Oh really? Well guess what, that's a huge benefit for Lua because its entire total size is around 500 KB. It's loaded into memory and executed start to finish faster than you blink. If you need a āstandard libraryā, just use Penlight. As I already mentioned, vast majority of libraries for Lua are written in... Lua itself, because it's so goddamn fast. I'm using Fennel, the Lua Lisp that's trans...
Filesize doesn't matter, if the functionality is missing. Lua is just not a direct comparison and replacement for Python. Penlight isn't standard library. In example if I want to write a commandline script, I better off doing it in Python. The language is much better to me, has better features, has a standard library builtin and is even installed in all Linux distributions. Lua is meant to be embedded into other applications, not meant to be used on its own.
Wrong. This is a design choice, because Lua isn't meant to be used by its own. The embedded environment is meant to provide the functionality. In example in Neovim they provide their own functionality embedded within the editor. I can't use that script on a different environment. |
||
| 1 | |||
|
[object Object]
lemmy.world
SlurpingPus@lemmy.world Joined: 2025-11-03 |
Well guess what, thatās a huge benefit for Lua because its entire total size is around 500 KB. Filesize doesn't matter, if the functionality is missing. Lua is just not a direct comparison and replacement for Python. Penlight isn't standard library. In example if I want to write a commandline script, I better off doing it in Python. The language is much better to me, has better features, has a ...
Wrong. Lua is meant to be used on its own, because it's so freaking good. It provides everything one needs to begin, while allowing for a wide array of libraries to be made. But I know you haven't made any serious number of scripts in either language, simply because you claim 'filesize doesn't matter', while Lua is so fast partly because of its size.
Wrong again. Lua is amazing on its own, but third-party libraries make it even better. |
||
| 0 | |||
|
[object Object]
lemmy.world
SlurpingPus@lemmy.world Joined: 2025-11-03 |
The use case for Lua is very different from Python. It's not directly comparable, as Lua is barebones.
Lua is directly comparable to Python, as it's incredible at quasi-interactive scripting. Python actually fits better when startup time doesn't matter, while a Lua script can start and finish a dozen times before a Python process just turns on. |
||
| 0 | |||
|
jollyrogue
lemmy.ml
jollyrogue@lemmy.ml Joined: 2021-07-21 |
You could just use the standard library and refrain from using third party libraries? That's how you get a smaller binary size in just about any language.
Sure. People who do that are going to be reimplementing lots of stuff on their own and creating libraries, so they might as well leverage the work of the community. People need to vendor their 3rd-party libraries and audit them regularly. |
||
| 2 | |||
|
Shayeta
feddit.org
Shayeta@feddit.org Joined: 2025-02-24 |
I was in a meeting with a senior software engineer, who makes a shit ton more than me. While sharing my screen he saw flame graph I had for one program I was working on. They asked "what is that?", I was taken back, and said it's for looking at which functions are taking more time. Then I was asked "where did you find it?" I was shell shocked, didn't know how to answer that. Similar things have...
You see, performance is rarely a talking point in retrospectives unless its egregious. If you say a piece of compute is struggling the solution is to always buy more compute. It is rare that anyone would think of optimization unless you're writing libraries. |
||
| 9 | |||
|
ilinamorato
lemmy.world
ilinamorato@lemmy.world Joined: 2023-09-27 |
Never understood the idea of, "if it needs to be fast, that part is in a faster language." Why not just use the faster language? Most of the libraries that have Python wrappers also come with c headers. Sometimes you wind up in the reverse situation where your dependency doesn't have a Python wrapper and now you're stuck managing silly boilerplate. Python just feels like an extra thing in the w...
All programming is a trade-off between what's easy for the developer and what's fast for the machine. Sure, you could theoretically write everything in Assembly and it'd be blazingly fast; but unless you're a particularly elite developer, that process would take forever for any program more complicated than a calculator, the result would be super buggy, and those bugs would be very hard to fix. On the other end of the spectrum, you might imagine a natural language machine learning compiler which translated directly from human prose to binary. It would be dead simple to "program" anything in; but such an application would probably be unbelievably slow, and again, have a staggering number of difficult-to-fix bugs. Somewhere in the middle are modern programming languages that abstract away all of the stuff that's necessary but hard for humans to wrap their minds around (memory management, API interaction, network stack, etc) and let the human write clear and unambitious code to handle all of the business logic and displaying it to the user. The result won't run as blisteringly fast as writing directly in Assembly, and it won't be as quick to market as Vibes-to-ASM, but the application will be developed in a reasonable amount of time and be reasonably easy to maintain. |
||
| 2 | |||
XiJinpingStanAccount
lemmy.ml
XiJinpingStanAccount@lemmy.mlJoined: 2026-10-08 |
You see, performance is rarely a talking point in retrospectives unless its egregious. If you say a piece of compute is struggling the solution is to always buy more compute. It is rare that anyone would think of optimization unless you're writing libraries.
Which is exactly why western AI companies are bankrupting themselves building data centers while China is easily keeping pace with a fraction of the resources. They're not magic. They just do basic things like make things more efficient. |
||
| 5 | |||
| Post Reply |
Page 2 of 3
Goto page
« First
Previous
1, 2, 3
Next
Last »
Back to top |