Comment by repsilat

Comment by repsilat 5 days ago

3 replies

Many simple scripts at my work that more or less just argparse and fire off an HTTP request spend half a minute importing random stuff because of false deps and uncommon codepaths. For some unit tests it's 45 seconds, substantially longer than the time taken to run the test logic.

In dev cycles most code is short-running.

instig007 4 days ago

> Many simple scripts at my work [...] For some unit tests it's 45 seconds

> I spend a lot of time rewriting the python logic in C++, which makes it 100x faster

Nice! Your workplace didn't care to pick a better tool for the job in the past, and it seems to not care what you're doing at present, if you have to spend time rewriting the stuff in C++, instead of picking Nim and calling it a day, in a day.

  • cb321 4 days ago

    Even better, in Nim these little CLI tools could use https://github.com/c-blake/cligen and have had terminal colorized, auto-generated help for many years now with much less dev-effort than raw argparse. Start-up time of statically linked Nim programs is like O(100..500 microseconds, just like C programs).

nickpsecurity 5 days ago

Have you thought about packing that stuff into an executable or precomputing or preloading it? There's techniques for each of those things that help in some scenarios.