News for hackers. Stuff that matters.
Re:Crazy fast build times, or when 10 seconds starts to make... by habosa on Wednesday March 24, 2021 @06:34AM (#26565478)
My personal theory of modern software development is that the #1 and #2 things you can to do improve software quality are:

1) Make sure devs can run a realistic version of the whole stack locally.

2) Drive incremental build times and effort on the whole stack to zero.

With today's world of frameworks, dependencies, and microservices it's too hard to just "think through" a change. You need to try it, adjust, and try it again. Reducing friction on the iteration cycle makes this task pleasant and increases the likelihood of discovering the best solution. When this cycle is painful devs are likely to stop at the first working solution (or even partially working).

Re:Crazy fast build times, or when 10 seconds starts to make... by ajsnigrutin on Wednesday March 24, 2021 @07:53AM (#26565971)
I'd be happy if the developers were given an "average" device for testing, and not the newest-shiniest-flagship one.

I get it why for development it's beneficial for a test device to be as fast as possible (because there less time is wasted for (eg.) an app to start after a change in code), but a lot of modern applications don't do more than they did 10 years ago, but eat up a lot more resources for the same output.

Re:Crazy fast build times, or when 10 seconds starts to make... by pitay on Wednesday March 24, 2021 @08:53AM (#26566512)
I'd like it if they tested their distributable product on a hard drive sometimes, not just SSD all the time.

I've come across a game that had major stutter problems, very noticeable on a HDD but still noticeable on SSD, just noticeable on a ramdisk, problem was frequent saving level data to disk and having some things block while they did that. The developer got lots of reports about performance, they said that people should upgrade their computer, game was 2d and graphically simple, the developer did not understand why people were having performance problems and didn't really care, it is essentially abandoned at this point and still for sale.

Another game also had major stutter problems which would last a few seconds each, turns out it was reading a file (which should be read once at startup) over 100 times a second almost all the time it is open. Submitted bug reports in both places they support with log output from the file monitoring I did. No response to either of them.

Firefox generally runs fine, if the HDD where your profile is located is saturated with IO then pages will not load until Firefox is able to write to the disk, this is with disk cache turned off. This isn't unexpected behaviour and not a bug like I would consider the previous two examples, but it is noticeable.

I really would like developers to test on a HDD even if only every few releases, and would also like them to use a monitoring tool on their software sometimes. This is just so their products don't have really bad behaviour on the system it is running on which the developers are completely oblivious to.

Re:Crazy fast build times, or when 10 seconds starts to make... by mamcx on Wednesday March 24, 2021 @03:19PM (#26571761)
Exist an incredible good reason: Because MOST of the tools we must/need to use have atrocious performance.

Not bad. Terrible.

I use Rust, and I like as language. But is terrible experience for compile times. I know what a good one is (Delphi, Pascal) and after it no single compile time language get it close (with exception of GO).

The terrible thing is that the base of all is C/C++/JS and their toolchain is the SLOW incarnate. Then even if I dodge the use of them, I still get impacted, eventually.

For example, I use TailwindCSS... that is great. But it use node. Node is terrible. I must use the speedier machine I can pay because soon or later I will deal with node, c++/llvm/c, Android Studio (damm!) Android emulator (mega damm!) and other tools like that.

And the tricky part ("why not just not use them?") is that they are terrible at performance but maybe good for something else (or: I must use them... I'm contractor!).

So only IF I have total control and can supply my needs with better tools I could use a old machine of the past. But I can't.

Re:Crazy fast build times, or when 10 seconds starts to make... by guitarbill on Wednesday March 24, 2021 @04:31PM (#26572492)
It would be awesome if Rust were faster, of course. At least with Rust, you get the borrow checker, not just compiling. It feels like you're getting something more in return (even though I don't know which step of compilation actually takes the most time).

But that would still suck. Luckily, there is a solution that works in many cases, rust-analyser. Obviously having basic syntax checking in an editor is preferable, because it shortens the feedback loop. I think this is why a lot of IDEs do it, not just for Rust. It's still a work-around, but makes it more bearable.

I'm not hugely experienced in Rust development, but it would be awesome if cargo could compile files when they are saved, so incremental build times and running tests might feel shorter. You could still get into trouble with complex dependencies between code units, but better > perfect. Visual Studio's "Live Unit Testing" takes this to an extreme (yeah, VS itself has poor performance, but doesn't mean the idea is bad).

Basically, if tools must have bad performance, because they are doing a lot of work for us (?), then at least make the development experience not suffer from that bad performance. That's what I care about more than just perf, it's how it impacts me, right?

In general, I still think compiling provides a decent trade-off. Yes, I need a beefier machine, and yes, my dev cycle is just a bit longer. But people using the actual product, they get the benefits. You could go with e.g. Python, where maybe one or two tests take less time to run, but ultimately you'd just be shifting the burden somewhere else. It isn't much consolation in the moment, but worth remembering.

Re:Crazy fast build times, or when 10 seconds starts to make... by whatshisface on Wednesday March 24, 2021 @11:05AM (#26568135)
Another reason why you want a blazing fast test device is that running with certain debugging and profiling tools attached can degrade performance substantially.
Re:Crazy fast build times, or when 10 seconds starts to make... by penagwin on Wednesday March 24, 2021 @01:40PM (#26570494)
I definitely agree things should be tested on realistic hardware - but one of the big reasons for me at least is using a decked out machine is because of all the dev tools + browser tabs, etc. IntelliJ might be using 6GB, chrome another 6GB, 6GB for teams/discord/figma/gitkraken/vscode/spotify. That's not including any image editing software or vm's but I'm already needing over 16GB of ram.
Re:Crazy fast build times, or when 10 seconds starts to make... by habosa on Thursday March 25, 2021 @06:12AM (#26578319)
It would be nice if it was easier to have a setup which is fast for development but realistically slow for testing.

I develop my personal website on a 6-year-old Windows laptop which was only $750 at the time. It definitely keeps me from making a slow website! But it also makes my devserver much slower than I'd like. I wish I could have speedy tools but a slow browser (and no, Chrome's CPU throttling isn't really the same as a truly crappy computer)

Re:Crazy fast build times, or when 10 seconds starts to make... by Rule35 on Wednesday March 24, 2021 @04:24PM (#26572416)
One thing I saw was someone logging all system calls their software generated and comparing that between runs. They'd been bitten by some minor library upgrade that had changed directory scanning which caused huge multiples of normal latency which on an SDD wasn't noticeable but on an HDD went from trivial to insane.

That was handy because it didn't actually involve testing on a slow device but mostly showed what we needed to know.

There are tools like https://github.com/schoentoon/slowpokefs which try to make your fast storage act like a HDD which could be better for black-box testing.

Re:Crazy fast build times, or when 10 seconds starts to make... by muskox2 on Wednesday March 24, 2021 @08:31AM (#26566311)
I find this is true for phones also (or even moreso). Google maps is a bad offender, getting slower every year despite doing essentially the same thing.
Re:Crazy fast build times, or when 10 seconds starts to make... by arnaudsm on Wednesday March 24, 2021 @10:16AM (#26567503)
I kept my 10 yo laptop only for testing my apps on regular consumer hardware, not my typical $3k overkill dev machine.
Re:Crazy fast build times, or when 10 seconds starts to make... by klelatti on Wednesday March 24, 2021 @09:30AM (#26566924)
I've been intentionally developing a data science type app - one where run times are critical - on a 12' MacBook.

I know run times will feel great on a 6 Core i7 machine for my fairly simple test cases. With the MacBook I get immediate feedback if something I've done creates a slowdown.

Re:Crazy fast build times, or when 10 seconds starts to make... by iudqnolq on Wednesday March 24, 2021 @08:34AM (#26566336)
Google (allegedly, in public) does this, although for some NIH-smelling reason they've invented their own representative low-end phone instead of just buying some.
Re:Crazy fast build times, or when 10 seconds starts to make... by wildmanx on Wednesday March 24, 2021 @10:36AM (#26567763)
At least as important for software quality is:

3) Make extension of thorough automatic testing in all levels of the testing hierarchy as effortless as possible.

Nobody is going to bother with thorough testing if it takes a day to add a simple test case for the new minor thing they just added in the last half an hour. Boom, test hole, disaster waiting to happen next time somebody refactors something. No matter how great you are doing with 1) and 2).

Re:Crazy fast build times, or when 10 seconds starts to make... by ericHosick on Wednesday March 24, 2021 @10:55AM (#26567998)
> 1) Make sure devs can run a realistic version of the whole stack locally.

This idea is greatly under-appreciated in the industry.

Re:Crazy fast build times, or when 10 seconds starts to make... by jermaustin1 on Wednesday March 24, 2021 @11:39AM (#26568606)
I'd love to be able to do this where I work, but we have a configuration of our software requires a minimum of 16 machines to work properly. And that is full blown machines, not just tiny dockers or whatever, but our AWS bill is in the 10s of thousands just for our 1 test environment for that setup. That test environment is undersized massively from the production environment, so we can't even do real world load tests against it. It doesn't have the disaster recovery enabled (which would double its size and adds a f5 big-ip load/proxy server in front.

We also have a configuration that is more like a single server mode, which is what we primarily develop against on our local setups, but it isn't the exact same functionally, and there are always defects when deploying to the other configuration.

Re:Crazy fast build times, or when 10 seconds starts to make... by aidenn0 on Wednesday March 24, 2021 @01:20PM (#26570197)
I recently was asked what I liked about common lisp, and one thing I struggled to put into words was how good the #2 experience is.

SBCL is an implementation that is AOT compiled to machine code, yet the incremental build time is shorter than even python because you can recompile a single (file|function|system) without restarting your program. Python fights you if you even want to re-load a single imported module (IIRC there are ways to do it, but it doesn't seem to be a typical way of developing in python).

Re:Crazy fast build times, or when 10 seconds starts to make... by cellularmitosis on Wednesday March 24, 2021 @11:11AM (#26568209)
I’ve been working on native (Swift) components within a React Native app, and the single-line edit/rebuild time was about a minute, which was just killing me.

Creating a separate Xcode project which includes only the Swift code dropped the edit/rebuild cycle down to about 6 seconds.

Re:Crazy fast build times, or when 10 seconds starts to make... by rory on Wednesday March 24, 2021 @12:36PM (#26569489)
This is definitely an issue with microservices, but how do frameworks contribute? I've moved more toward monolithic frameworks over the last year (Next.js and Phoenix specifically), and it feels to me like local setup is easier and build times are shorter than when I'm rolling more of my own setup.
Re:Crazy fast build times, or when 10 seconds starts to make... by habosa on Thursday March 25, 2021 @06:14AM (#26578332)
I agree frameworks help with the dev setup through all the cool hot-reloading tricks, I just meant because of their complexity it's one more thing you have to keep running in testing. I don't want to go back to jQuery in a <script> tag but that had 0 startup cost.
Re:Crazy fast build times, or when 10 seconds starts to make... by phendrenad2 on Friday March 26, 2021 @09:03PM (#26598841)
> Make sure devs can run a realistic version of the whole stack locally.

And through the magic of docker-compose, they can! Now just let me wait while 33 local containers spin up so I can unit test this one-line fix...

Re:Crazy fast build times, or when 10 seconds starts to make... by gnrlst on Wednesday March 24, 2021 @06:56AM (#26565616)
I find 1) especially challenging with microservices. What technologies do you use/recommend to help with this?
Re:Crazy fast build times, or when 10 seconds starts to make... by fouc on Wednesday March 24, 2021 @11:56AM (#26568867)
Not that many companies actually need microservices. Consider going back to a more monolithic setup
Re:Crazy fast build times, or when 10 seconds starts to make... by rutthenut on Wednesday March 24, 2021 @07:25AM (#26565788)
This is where a Docker/K8s containerised setup can help.

Not trivial to get to, but for deve/test environments it can be really beneficial. Can also mean the same clean starting point for every series of tests, if new containers are spun up each time through.

Re:Crazy fast build times, or when 10 seconds starts to make... by bosie on Wednesday March 24, 2021 @07:57AM (#26566012)
how do you combine this approach with some external services (i.e. databases aren't run in docker but AWS RDS or some part of the setup is using AWS lambdas)?
Re:Crazy fast build times, or when 10 seconds starts to make... by majewsky on Wednesday March 24, 2021 @08:58AM (#26566566)
Even if you have your prod database on RDS, you might be able to spin up a local instance for testing. My Postgres-using applications have a script that sets up and runs a local Postgres instance for the duration of the test. It takes about 2 seconds on first run, and less than noticeable time when the DB has already been initialized.

https://github.com/sapcc/keppel/blob/master/testing/with-pos...

Re:Crazy fast build times, or when 10 seconds starts to make... by bosie on Wednesday March 24, 2021 @09:36AM (#26566985)
Is the RDS Postgres identical to whatever you have installed in a docker? How would you do this with Aurora?
Re:Crazy fast build times, or when 10 seconds starts to make... by smoe on Wednesday March 24, 2021 @11:59AM (#26568921)
We have been using RDS for production and normal Postgres during development for about 5 years and the only thing you have to watch out for we found is that RDS supports only certain extensions and they are fairly slow making new Postgres major versions available. So e.g. if you want to use TimescaleDB you either have to run it yourself or use a proprietary AWS alternative.

It is just a Postgres running, but you have limited control about its configuration.

So as long as you make sure during development that you are not doing something with the database that RDS doesn't support you should be fine.

I don't know about Aurora, but I reckon it is similar. Standard Postgres features are likely going to work fine, but more advanced things are not going to be available on Aurora.

Re:Crazy fast build times, or when 10 seconds starts to make... by pgelephant on Friday March 26, 2021 @07:12AM (#26590712)
Basically Postgres in Docker would be highly flexible in terms of what versions (major or minor), extensions, your own customisations for the configurations in pg.conf you want to go with.

You can upgrade/patch as soon as Postgres community makes these available. With RDS you have to wait and for Aurora surely significant waiting periods! e.g. Aurora Postgres is currently 2 major and 2 minor versions behind - meaning you would be missing the latest and greatest of Postgres!

I would suggest to use Postgres from community on EC2 or Containers or if you want Postgres as a service then use Postgres operator on EKS or any K8S distro available on AWS. You can easily go back and forth between this env and RDS or even any platform making your Postgres databases completely platform agnostic.

Re:Crazy fast build times, or when 10 seconds starts to make... by majewsky on Wednesday March 24, 2021 @11:39AM (#26568610)
> Is the RDS Postgres identical to whatever you have installed in a docker?

I don't use AWS myself, so not sure. But if it's not the same, doesn't that destroy their value proposition?

Re:Crazy fast build times, or when 10 seconds starts to make... by bosie on Saturday March 27, 2021 @01:46PM (#26603977)
not necessarily. If the positives of the RDS environment are more important to me than running my own database on EC2 in a docker with the latest features, i am totally fine with giving up some DB related features.
Re:Crazy fast build times, or when 10 seconds starts to make... by luxuryballs on Wednesday March 24, 2021 @09:10AM (#26566704)
Re:Crazy fast build times, or when 10 seconds starts to make... by railsgirls112 on Wednesday March 24, 2021 @10:25AM (#26567617)
https://github.com/localstack/localstack

Is a pretty good testing framework that we use at my workplace for a dockerized microservice setup. Requires some config but has mocks for most of the big services (specifically RDS looks to be in their paid tier, but we get along w/ the free version just fine.)

Re:Crazy fast build times, or when 10 seconds starts to make... by throwaway894345 on Wednesday March 24, 2021 @09:43AM (#26567066)
Not to mention all of the EKS/GKE integrations that pretty much everyone on the platform uses. Things like EFS backed persistent volumes, ALB backed ingress, ELB backed service load balancers, etc. You need some way to abstract over the different stacks because you can’t just deploy your YAML to any Kubernetes distribution and have it work properly.
Re:Crazy fast build times, or when 10 seconds starts to make... by Aeolun on Wednesday March 24, 2021 @07:16AM (#26565729)
Docker compose and very beefy dev machines.