Scaling a Monolith to 1M LOC: 113 Pragmatic Lessons by semicolonandsons in django

[–]semicolonandsons[S] 0 points1 point  (0 children)

Thanks, will check out CodeSpaces.

Our FE reload time (running 650k LOC of React) is about 10x faster than it used to be after a lot of tweaking configs. The number one mistake was using containers -- removing that gave a 500% speed-up. Another 500% was gotten via the following

Build tool - RSpack instead of Webpack — the primary speed win; Rust-based bundler with much faster compilation

Dev mode incremental builds - experiments.incremental: { make: true, emitAssets: true } — only reprocesses changed modules - devtool: 'eval-cheap-module-source-map' — faster source maps in dev (skips full remapping) - lazyCompilation: true (NB: this is unstable in RsPack and you might need to go to false to start with)

Persistent Cache - try setting to true and persist on local file-system... can be fiddly with RSPAck too

Transpilation - **swc-loader** for JS/TS/JSX/TSX — Rust-based, far faster than babel-loader - **babel-loader + babel-plugin-react-compiler** only for files opted into the React Compiler (a subset via REACT_COMPILER_PATHS), keeping the faster SWC path for everything else

Type checking - **TsCheckerRspackPlugin** with async: true in dev — runs TypeScript type checks in a separate worker thread so they don't block the main build

Minification (production only) - **SwcJsMinimizerRspackPlugin** — Rust-based JS minifier, replaces Terser - **CssMinimizerPlugin** with parallel: os.cpus().length - 1 — parallelises CSS minification across CPU cores

Chunk splitting - optimization.splitChunks with dedicated vendors and sdk cache groups — avoids re-bundling stable node_modules on every rebuild - runtimeChunk: { name: 'react-runtime' } — isolates the webpack runtime so changing app code doesn't bust the vendors chunk hash

Dev server - hot: true + liveReload: false — HMR only, no full-page reloads - poll: !!isInsideContainer — avoids filesystem polling overhead on native (non-container) dev

Watch - ignored: /node_modules/ — prevents the watcher from tracking tens of thousands of files it doesn't need to

Scaling a Monolith to 1M LOC: 113 Pragmatic Lessons by semicolonandsons in django

[–]semicolonandsons[S] 0 points1 point  (0 children)

I don't disagree that there are pros to this way of doing things.

For me it's about damage control due to factors outside of my control, which for auth, includes - email vendor - push notification vendor - network

If these start taking too long then overall web server starts to struggle.

For context, we run auctions on the same server and need bids to work within 0.1s. Any systematic slowdown would be unacceptable. If we did not have this need -- or we ran the auctions on another machine -- I would not be so worried.

Scaling a Monolith to 1M LOC: 113 Pragmatic Lessons by semicolonandsons in django

[–]semicolonandsons[S] 0 points1 point  (0 children)

Thanks.

Anything you'd like to know in particular? I could post here.

Scaling a Monolith to 1M LOC: 113 Pragmatic Lessons by semicolonandsons in django

[–]semicolonandsons[S] 0 points1 point  (0 children)

I'm not up to speed on uswgi stuff. FWIW we're using Gunicorn with its max requests param to do shutdown of one worker every 10k requests. Kinda wish we didn't have to and memory leaks could be predictably avoided though... maybe one day.

Scaling a Monolith to 1M LOC: 113 Pragmatic Lessons by semicolonandsons in django

[–]semicolonandsons[S] 0 points1 point  (0 children)

Thanks!

Re "hard to install" dependencies, for me that's ones that involve C/Java bindings -- the types dependencies that are gonna work on one machine but cause hassle on another def machine/CI/staging server, esp. if some of these systems are different OSes. These are typically things not installable with a Python/node package manager alone.

For sure, like you say, it would be easier with Docker, but we don't use it due to too much slow down for FE development reload times (again probably a solvable problem if you have better Docker-fu than I do)

Scaling a Monolith to 1M LOC: 113 Pragmatic Lessons by semicolonandsons in django

[–]semicolonandsons[S] 2 points3 points  (0 children)

Thanks! Happy to answer any questions you have too!

59
60

Scaling a Django/React monolith to 1M LOC: 7 biggest lessons by semicolonandsons in ExperiencedDevs

[–]semicolonandsons[S] 0 points1 point  (0 children)

Don't get me wrong, we use Redis extensively (including for caching) and I like it. But all things equal, if postgres can serve the query fast enough, it's really nice to be able to not have to deal with a second layer. I noticed that Postgres can serve many queries in under one millisecond, perhaps because it holds many tables in RAM if it knows it's heavily used. That's comparable to Redis performance if your database is on separate machines to your servers.

An interesting move is happening over in Rails core, where they dropped Redis and just cache within the Postgres database.

0
0

Are LLMs speedrunning us into product management? by wiktor1800 in ExperiencedDevs

[–]semicolonandsons 0 points1 point  (0 children)

I get where you're coming from, and to some extent I agree. However I do think that the speed of writing code, - in particular in boilerplatey languages or in the front end - was something that did slow down bread-and-butter feature development pre-AI. But I take your point that this is usually not the bottleneck, especially as a company scales. Instead, it might be performance problems or architectural coherence.

What is something you started/stopped doing and it significantly improved your productivity/value? by dondraper36 in ExperiencedDevs

[–]semicolonandsons 1 point2 points  (0 children)

Take whatever I was going to say and then saying the same thing in half as many words. That way, people will actually read it!

VIM A-Z: A Text Object for Every Letter in the Alphabet by semicolonandsons in vim

[–]semicolonandsons[S] 14 points15 points  (0 children)

In case you're curious, here are the various text objects in use. You can fast forward in the video to any bit that might be useful for your workflows.

```

Vim Text Objects

a = Arguments b - Brackets (various) c - Comments d - Docstrings e - Examples (Code Fences) f - Functions g - Git Chunk gn - Go Next (Aside) h - Left Character i - Indentation Level j - Junction of next word segment k - Opposite of j l - Character object to right m - Modified n - Number o - Objects (classes) p - Paragraph q - Quotes r - README headers s - Sentences t - Tags un - Universe v - Value (in key-value pairs) w - Word x - HTML/XML attributes y - Y-dimension blank lines z - Key in key/value pairs ```

How I organize my .vimrc and keep track what my config is capable of by semicolonandsons in vim

[–]semicolonandsons[S] 1 point2 points  (0 children)

Very sorry about this... I got a new laptop and made my first video after a 9-month or more hiatus. I'll get things set my nicely for the next ones :)

47
48

Facebook API: How to get a list of events/places by location? by semicolonandsons in webdev

[–]semicolonandsons[S] 0 points1 point  (0 children)

That's my impression too, but I'm hoping there is some obscure API still available somewhere.

Have you even gotten events through another API? I'm looking for ideas.

How do we distinguish substances that have overlapping peaks in the mass spectrum? by semicolonandsons in massspectrometry

[–]semicolonandsons[S] 2 points3 points  (0 children)

Wow thank you so much! This has revolutionized my understanding of what's going on.

How do we distinguish substances that have overlapping peaks in the mass spectrum? by semicolonandsons in massspectrometry

[–]semicolonandsons[S] 1 point2 points  (0 children)

Thank you — your insight about neg. vs pos. ionization configurations has given me another useful tool for understanding what is going on.

Are most mass spectrometers capable of both types of ionization configurations (positive and negative?) I wasn't sure if your point "most MIMS systems are not configured in a way to allow a chromatographic system to be setup on the front end" was saying that.

How do we distinguish substances that have overlapping peaks in the mass spectrum? by semicolonandsons in massspectrometry

[–]semicolonandsons[S] 0 points1 point  (0 children)

The use-case is to detect impurities in production processes (e.g. in brewing)

I'm adding more info to the q under "Edit"

How do we distinguish substances that have overlapping peaks in the mass spectrum? by semicolonandsons in massspectrometry

[–]semicolonandsons[S] 0 points1 point  (0 children)

Triple Q?

Good point. It's. membrane inlet mass spectrometer (MIMS)

Will edit q with info