Skip to Content
0 likes
Python Generators: Handle Big Files Without Running Out of Memory Level: Advanced

Reading a big file into a list can kill your program. A generator handles one line at a time. See the memory difference measured on a real file, learn what yield does, and chain small generators into a pipeline.

0 likes
Running Many Requests at Once With asyncio.gather Level: Advanced

asyncio.gather runs many waiting tasks at once in one thread and returns results in order. Avoid await in a loop and blocking calls, keep failures with return_exceptions=True, and limit concurrency with a Semaphore.

0 likes
Finding the Slow Part of Your Python Code With cProfile Level: Advanced

Don't guess which part is slow. Run cProfile, read cumtime and tottime the right way, fix the one line that matters, and measure again. In the example, the obvious suspect isn't the problem.

0 likes
Speeding Up Many Downloads in Python With ThreadPoolExecutor Level: Advanced

Downloads spend most of their time waiting. ThreadPoolExecutor lets many waits overlap: 20 half-second downloads in 2 seconds instead of 10. Handle failures with as_completed, pick a sensible worker count and respect the server.

0 likes
Predict the Output: Event Loop Order in 6 Snippets Level: Advanced

Six short snippets with setTimeout, promises, await and queueMicrotask. Predict the order, run it, then read why. The one rule: sync code first, then all microtasks, then the next task.

0 likes
Batch API Calls With Promise.allSettled Level: Advanced

Send many requests, keep the successes, and report the failures instead of losing everything to one rejected promise. Plus limiting how many run at once.

0 likes
Add a Timeout to fetch With AbortController Level: Advanced

fetch has no timeout option and can wait a very long time. AbortSignal.timeout(ms) fixes that in one line, and AbortSignal.any combines it with a cancel button.

0 likes
Process a Large CSV in Node.js With Streams Level: Advanced

Read a CSV too big for memory line by line with readline, total a column, and write a filtered copy with pipeline. Memory stays flat no matter how big the file is.

0 likes
Find a Retained Detached DOM Node With Heap Snapshots Level: Advanced

Trace a detached preview from its DOM node to an application Map, repair cleanup, and verify repeated open-and-close cycles with heap snapshots.

0 likes
Find the Slow Function With Chrome's Performance Profiler Level: Advanced

Record one slow click in Chrome's Performance panel, read the Bottom-up tab by self time, fix the function it points at, and record again to prove the fix worked.

0 likes
Stop Layout Shift From Web Fonts Level: Advanced

Compute size-adjust and the vertical overrides from the font files, build the fallback face, and measure the layout shift before and after.

0 likes
srcset and sizes for Product Images That Don't Waste Bandwidth Level: Advanced

Measure the real slot width at each breakpoint, write sizes from it, and check which file loads at each screen density.