'𝘄𝗼𝗿𝗸𝗲𝗿_𝘁𝗵𝗿𝗲𝗮𝗱𝘀' 𝗱𝗼 𝗻𝗼𝘁 𝗵𝗮𝘃𝗲 𝘁𝗵𝗲 𝘀𝗮𝗺𝗲 𝗝𝗦 𝗵𝗲𝗮𝗽 𝗮𝘀 𝘁𝗵𝗲 𝗺𝗮𝗶𝗻 𝘁𝗵𝗿𝗲𝗮𝗱. As mentioned above, 𝗪𝗼𝗿𝗸𝗲𝗿𝘀 𝗿𝘂𝗻 𝗶𝗻𝘀𝗶𝗱𝗲 𝘁𝗵𝗲𝗶𝗿 𝗼𝘄𝗻 𝗩𝟴 𝗶𝘀𝗼𝗹𝗮𝘁𝗲 which has 𝗮 𝘀𝗲𝗽𝗮𝗿𝗮𝘁𝗲 𝗺𝗲𝗺𝗼𝗿𝘆 𝗹𝗶𝗺𝗶𝘁. Therefore, raising the memory limit for the main process via `--max-old-space-size` does not mean that the 𝗪𝗼𝗿𝗸𝗲𝗿𝘀 𝗴𝗲𝘁 𝗮𝗱𝗱𝗶𝘁𝗶𝗼𝗻𝗮𝗹 𝗺𝗲𝗺𝗼𝗿𝘆 𝘁𝗼𝗼. It makes a difference in case when the application does something heavy - like parsing PDF files. We could 𝗱𝗲𝗳𝗶𝗻𝗲 𝘁𝗵𝗲 𝗵𝗲𝗮𝗽 𝘀𝗶𝘇𝗲 𝘁𝗵𝗮𝘁 𝘁𝗵𝗲 𝗪𝗼𝗿𝗸𝗲𝗿 𝘄𝗼𝘂𝗹𝗱 𝘂𝘀𝗲 import { Worker } from "worker_threads"; new Worker(new URL("./heavy-job-worker.js", import.meta.url), { resourceLimits: { maxOldGenerationSizeMb: 4096, }, }); When working with large PDF files and 𝗽𝗲𝗿𝗳𝗼𝗿𝗺𝗶𝗻𝗴 𝗵𝗲𝗮𝘃𝘆 𝗼𝗽𝗲𝗿𝗮𝘁𝗶𝗼𝗻𝘀 𝗹𝗶𝗸𝗲 𝗱𝗮𝘁𝗮 𝗽𝗿𝗼𝗰𝗲𝘀𝘀𝗶𝗻𝗴, this could be useful. #NodeJS #JavaScript #BackendDevelopment #SoftwareEngineering #WebDevelopment #V8 #Performance #Scalability #Multithreading #WorkerThreads #SystemDesign #Programming #Coding
Worker Threads Memory Limit Impact on Node.js Performance
More Relevant Posts
-
Console.log([1,2,3] + [4,5,6]). What is the output? 🤔 💬 Comment your answer first… then click “more” 👇 Most developers think the result is: [1,2,3,4,5,6] ❌ Nope 😏 In JavaScript the output is: "1,2,34,5,6" 💥 👉 Data type: string 👉 Why? Arrays convert to strings before using +. Then JavaScript concatenates the strings. 🔥 Rule: + with arrays → string concatenation Did you guess the correct output and data type? 😄 #javascript #codingtips #programming #developer #webdev #100daysofcode
To view or add a comment, sign in
-
𝗤𝘂𝗶𝗰𝗸 𝘁𝗶𝗽: 𝗡𝗲𝘃𝗲𝗿 𝗿𝗲𝘁𝘂𝗿𝗻 𝗻𝘂𝗹𝗹. 𝗥𝗲𝘁𝘂𝗿𝗻 𝗲𝗺𝗽𝘁𝘆 𝗮𝗿𝗿𝗮𝘆𝘀. ✅ Stop returning null when a list has no results. Return an empty array instead. 𝗕𝗮𝗱: function getUsers() { return users.length > 0 ? users : null; } 𝗚𝗼𝗼𝗱: function getUsers() { return users || []; } 𝗪𝗵𝘆 𝗶𝘁 𝗺𝗮𝘁𝘁𝗲𝗿𝘀: ❌ Null forces every caller to check before iterating ❌ Leads to "Cannot read property of null" crashes ❌ Creates defensive code everywhere ❌ Makes chaining operations impossible ✅ Empty arrays can be iterated safely (zero loops, no crash) ✅ Works with map, filter, reduce without checks ✅ Cleaner code throughout your application Same applies to objects: return {} instead of null when appropriate. Let your data structures be forgiving. Your team will thank you. 🙏 . . . #JavaScript #BestPractices #CleanCode #WebDevelopment #Programming
To view or add a comment, sign in
-
-
C#/.NET Performance Tip — String Concatenation in Loops Many .NET developers still use += inside loops without realizing how expensive it really is. Using result += "x" inside a 1,000-iteration loop is 100 times slower than using StringBuilder.Append. When += is used on a string, .NET must: - Allocate a brand new string on every single iteration - Copy all existing characters into the new buffer - Discard the old string for the garbage collector In contrast, when StringBuilder is used, .NET: - Maintains one internal, growable buffer - Appends characters in place with zero extra allocations - Converts to a string only once at the end This pattern applies anywhere you build text dynamically: - Logging and reporting - CSV / JSON generation - Query construction - Any loop-based text assembly A small change can lead to a massive impact at scale. Benchmark results show: 4.21 us (StringBuilder) vs 412.50 us (+=), with 2.1 KB vs 2,500 KB allocated. Pre-size your StringBuilder when you know the capacity — even better. #csharp #dotnet #performance #programming #tips #coding #softwaredevelopment #aspnetcore #developer #cleancode
To view or add a comment, sign in
-
-
`$fillable` looks like protection. But it has no idea who is calling your endpoint. I had an Order model with 24 fillable fields. `is_forced_processing` - admin only. `is_from_api` - customer API only. `status_id` - computed internaly, never from user input. But the model doesn't know that. Every field in `$fillable` is equally "allowed" for everyone. So if someone passes `$request->validated()` into `Order::create()` from the wrong endpoint - nothing stops it. The fix that actually works: DTO per context + Action with explicit field mapping. You open the controller and immediatly see what gets written to the database. No guessing, no tracing three files. Small projects - mass assignment is fine. Large teams with complex models - explicit always wins. Full article in the comments 👇 #Laravel #PHP #WebDev #Programming #Backend
To view or add a comment, sign in
-
-
🚀𝐈 𝐛𝐮𝐢𝐥𝐭 𝐦𝐲 𝐨𝐰𝐧 𝐂 𝐂𝐨𝐦𝐩𝐢𝐥𝐞𝐫 — 𝐚𝐧𝐝 𝐢𝐭'𝐬 𝐧𝐨𝐰 𝐋𝐈𝐕𝐄! I'm excited to share my latest project: Mini C Compiler — a complete web-based C compiler with Lexical, Syntax, Semantic Analysis, and Code Generation! 🔥 💡 𝗪𝗵𝗮𝘁 𝗺𝗮𝗸𝗲𝘀 𝘁𝗵𝗶𝘀 𝘀𝗽𝗲𝗰𝗶𝗮𝗹? This compiler processes C code through all 5 major compilation stages: ✅ 𝗟𝗲𝘅𝗶𝗰𝗮𝗹 𝗔𝗻𝗮𝗹𝘆𝘀𝗶𝘀 — Converts code into tokens with line & column tracking ✅ 𝗦𝘆𝗻𝘁𝗮𝘅 𝗔𝗻𝗮𝗹𝘆𝘀𝗶𝘀— Builds an Abstract Syntax Tree (AST) ✅ 𝗦𝗲𝗺𝗮𝗻𝘁𝗶𝗰 𝗔𝗻𝗮𝗹𝘆𝘀𝗶𝘀 — Generates Symbol Table with type checking ✅ 𝗖𝗼𝗱𝗲 𝗚𝗲𝗻𝗲𝗿𝗮𝘁𝗶𝗼𝗻 — Produces optimized output code ✅ 𝗠𝗼𝗱𝗲𝗿𝗻 𝗨𝗜 — Clean interface with 5 structured output tabs 🌐 𝗟𝗶𝘃𝗲 𝗗𝗲𝗺𝗼: 👉 https://lnkd.in/gEHeU8xU ⚙️ 𝗧𝗲𝗰𝗵 𝗦𝘁𝗮𝗰𝗸: 🔹 C++ (Core compiler logic) 🔹 Node.js + Express (Backend API) 🔹 React.js (Frontend UI) 🔹 Render (Hosting) 📂 𝗚𝗶𝘁𝗛𝘂𝗯 𝗥𝗲𝗽𝗼𝘀𝗶𝘁𝗼𝗿𝘆: 👉 https://lnkd.in/gNJqEtcf This project helped me deeply understand how compilers work under the hood — from tokenization to execution. I’d love to hear your feedback and suggestions! 🙌 #CCompiler #WebDevelopment #ReactJS #NodeJS #CPlusPlus #CompilerDesign #SideProject #Programming
To view or add a comment, sign in
-
Everyone jokes that the hardest part of programming is naming things, but honestly... it's just the truth. I can spin up a backend, connect a database, and get API routes working fast. But then I'll sit there for minutes completely paralyzed trying to decide if an array should be users, userList, userData, or userArray. (And let's not even talk about trying to name CSS wrapper divs). What’s the worst or weirdest variable name you’ve ever run into in a codebase? I know you guys have seen some bad ones 😂 #webdev #javascript #programming #developerlife
To view or add a comment, sign in
-
C# 15 is adding something a lot of people have been asking about. It's not a library. It's not a pattern. It's a new feature in the language itself. Union types landed in C# 15 with .NET 11 Preview 2. If you've ever written a wrapper class, a OneOf hack, or an abstract base just to say "this thing is either A, B, or C," you know why this matters. C# has never had a native way to say "this value is exactly one of these specific types." So we improvised. Discriminated union libraries. Object casting with runtime checks. It worked, but it was ceremony hiding intent. C# 15 changes that with a first-class union keyword. public union Result(Success, ValidationError, NotFoundError); That's it. The compiler now knows Result can only ever be one of those three. No inheritance required. No shared base class. No open-ended extension by other code. Here's the part that really matters. Pattern matching, of all cases, is compiler-enforced. If you forget to handle a case in a switch expression, it's a compile error. Not a runtime surprise at 2am. No default. No discard. No swallowing the bad case. F# has had discriminated unions forever. TypeScript uses union types daily. C# is late to the game, but the implementation looks thought out. It's native, it integrates with existing pattern matching, and it doesn't require a runtime library to make it work. This is the feature that makes error-handling and result modeling in C# genuinely expressive without external dependencies. It will put pressure on old patterns such as abstract base classes used as "closed" hierarchies are going to appear messy and cluttered. What patterns have you been using to simulate this in C#? Will this replace it or complement it? #DotNet #CSharp #CSharpMonday #TonyTechTip #DeveloperProductivity
To view or add a comment, sign in
-
This VS Code extension takes JSON visualisation to the next level! 🔥 Turn complex JSON into a clean, interactive graph with a single click, no more digging through raw data! ✨ Hope this helps ✅ Do Like 👍 & Repost 🔄 Follow Ahmed Ali Asif 🌟 for the most amazing content related to Programming & Web Development 💎 #html #css #javascript #100daysofcode #webdevelopment #programming
To view or add a comment, sign in
-
var vs let vs const — The Real Differences If you're still reaching for `var` by default, this one's for you. Three keywords. Three very different behaviors. var • Function-scoped (ignores block scope) • Can be redeclared in the same scope • Hoisted and initialized as undefined • Legacy. Avoid in new code. let • Block-scoped • Can be reassigned, cannot be redeclared • Hoisted but not initialized (Temporal Dead Zone) • Use it when a value needs to change. const • Block-scoped • Cannot be reassigned or redeclared • Same hoisting behavior as let • Use it by default. Your future self will thank you. Rule of thumb: → const by default → let when you must reassign → var — don't Next post: Data Types — all seven, with the typeof null trap. Follow the series. #JavaScript #WebDevelopment #Frontend #CleanCode #NodeJS #SoftwareEngineering #WebDev #CodingTips #ES6 #LearnJavaScript #Programming #Coder #FullStackDeveloper #ReactJS #TypeScript #100DaysOfCode #DeveloperCommunity #TechTips #CodeNewbie #ProgrammingLife
To view or add a comment, sign in
-
-
Architect .NET is open source, and I want your challenges. The platform scores your C# refactoring by structure, not test output powered by the Roslyn compiler API. Submit broken code fixed with SOLID principles or GoF patterns, and a Curveball drops to prove whether your design actually holds. All five challenges live: - Payment Processor — DIP + OCP (Curveball: Add Apple Pay) - Order System Monolith — SRP (Curveball: Add SMS notifications) - Notification Factory — Factory Pattern (Curveball: Add Push notifications) - Report Generator — Strategy Pattern (Curveball: Add XML export) - Email Campaign Builder — Builder Pattern (Curveball: Add A/B subject line testing) Adding a new challenge is one file, one PR: 1. Create `Challenge06_YourScenario.cs` 2. Write the spaghetti `InitialCode` (broken but working C#) 3. Define scoring rules using existing `RuleChecks` helpers 4. Write the Curveball 5. Done! ChallengeRegistry discovers it via reflection. Nothing else to register. If you've ever tried to explain the Strategy Pattern to a junior dev and watched their eyes glaze over, you have a challenge idea. Write it. 🔗 https://lnkd.in/dPrZbvhM #dotnet #csharp #opensource #softwarearchitecture #cleancode #buildinpublic
To view or add a comment, sign in
-
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development