DEV Community

Ricardo Saumeth
Ricardo Saumeth

Posted on

โญ ๐—ฃ๐—”๐—ฅ๐—ง ๐Ÿฎ โ€” ๐“๐ฒ๐ฉ๐ž ๐’๐š๐Ÿ๐ž๐ญ๐ฒ, ๐“๐ž๐ฌ๐ญ๐ข๐ง๐  & ๐๐ž๐ซ๐Ÿ๐จ๐ซ๐ฆ๐š๐ง๐œ๐ž ๐Ž๐ฉ๐ญ๐ข๐ฆ๐ข๐ฌ๐š๐ญ๐ข๐จ๐ง (๐ฐ๐ข๐ญ๐ก ๐€๐ˆ ๐š๐ฌ ๐š ๐‰๐ฎ๐ง๐ข๐จ๐ซ ๐๐š๐ซ๐ญ๐ง๐ž๐ซ)

Realโ€‘time systems fall apart without strict typing, solid tests, and predictable performance.
Hereโ€™s how I used AI to accelerate the โ€œboring but criticalโ€ parts of engineering.

  1. Type safety: AI generates TypeScript definitions

WebSocket streams demand strict typing for reliability and safe refactoring.

Prompt:
โ€œCreate TypeScript types for Bitfinex WebSocket API v2:

  • subscription messages
  • channel types
  • trade data
  • candle data
  • order book data.โ€

AI generated clean enums and interfaces for:

  • TRADES, TICKER, CANDLES, BOOK
  • subscription messages
  • raw trade tuples vs normalized objects

I adjusted a few fields to match the real API.

Time saved: ~2โ€“3 hours.

  1. Testing: AI writes unit tests

Memoryโ€‘bounded reducers are easy to get wrong under load.

Prompt:
โ€œWrite Vitest tests for memoryโ€‘bounded trades reducer:

  • enforce MAX_TRADES
  • remove oldest trades
  • keep newest trades.โ€

AI generated a full test suite that:

pushed 1,500 trades

  • asserted only the last 1,000 remained
  • checked first and last IDs

I aligned it with my reducer signature.

Time saved: ~4โ€“5 hours.

  1. Performance โ€” AI Helps Simplify, Not Overโ€‘Engineer

In realโ€‘time UIs, itโ€™s tempting to overโ€‘engineer performance. For CryptoApp, I kept it simple and used AI to validate the approach.

Prompt:
โ€œOrder book UI feels heavy under constant updates. Suggest lightweight performance strategies for React + AG Grid.โ€

AI suggested several options (batching, debouncing, transactional updates), but for this app I went with:

  • a 100ms useThrottle on incoming order updates
  • a memoryโ€‘bounded order book with MAX_BOOK_ORDERS = 100
  • standard rowData updates into AG Grid

That was enough to keep the grid smooth and responsive without adding complexity I didnโ€™t need.

โฑ Time saved: ~1 day of trialโ€‘andโ€‘error and premature optimisation

โญ Real results

CryptoApp:

  • 5,000+ LOC
  • built in ~5 days (vs 3โ€“4 weeks)
  • 60 FPS stable
  • ~60MB memory after 8 hours
  • handlerโ€‘based, memoryโ€‘bounded, monitored, productionโ€‘ready

๐๐จ๐ญ๐ž: These timeโ€‘savings are experienceโ€‘based estimates. AI sped up the repetitive work โ€” the real engineering still came from me.

๐—ช๐—ฟ๐—ถ๐˜๐˜๐—ฒ๐—ป ๐—ฏ๐˜† ๐—ฅ๐—ถ๐—ฐ๐—ฎ๐—ฟ๐—ฑ๐—ผ ๐—ฆ๐—ฎ๐˜‚๐—บ๐—ฒ๐˜๐—ต
๐—ฆ๐—ฒ๐—ป๐—ถ๐—ผ๐—ฟ ๐—™๐—ฟ๐—ผ๐—ป๐˜โ€‘๐—˜๐—ป๐—ฑ ๐—˜๐—ป๐—ด๐—ถ๐—ป๐—ฒ๐—ฒ๐—ฟ | ๐—ฅ๐—ฒ๐—ฎ๐—นโ€‘๐—ง๐—ถ๐—บ๐—ฒ ๐—จ๐—œ ๐—ฆ๐—ฝ๐—ฒ๐—ฐ๐—ถ๐—ฎ๐—น๐—ถ๐˜€๐˜

Top comments (0)