How Java dynamic proxy works internally
Here’s a practical example of a Java dynamic proxy used to log method calls on a real object — a common pattern in frameworks like Spring AOP. 🎯 Scenario You have a service: public...
Here’s a practical example of a Java dynamic proxy used to log method calls on a real object — a common pattern in frameworks like Spring AOP. 🎯 Scenario You have a service: public...
🧠 1. What is Escape Analysis? Escape Analysis asks a simple question: ❓ Does this object “escape” the method? (i.e., is it used outside the current method?) 🧪 Example: No Escape public int compute()...
let’s now look at how Graal JIT’s optimizations are better than the traditional HotSpot C2 JIT, and why it matters in real-world performance. 🧠 Background 🔥 Graal JIT vs C2 JIT: What Graal Does...
JIT compilation takes time JVM goal: Fast startup + optimize only when needed. Most code is cold Studies (including JVM benchmarks) show that 90%+ of methods are cold in many real-world applications. Compiling everything...
At runtime, for the same class, the JVM can execute some methods as machine code and others as bytecode. 🧠 How it works: The JVM (including GraalVM) treats each method independently: 💡 So yes...
Let’s break down how a model like BERT or OpenAI produces different embeddings for the word “bank” in different contexts. 🎯 The Goal: We want: 🧠 Step-by-Step: How Different Embeddings Are Calculated 1. Tokenization...
Here’s a layman-friendly example of representing a word as a 2D vector (just two numbers) — even though real embeddings are often 384, 768, or 1536 dimensions. 🔤 Let’s take the word: “king” We...
Let’s take the stream pipeline: List<String> result = names.stream() .filter(name -> name.length() > 3) .map(String::toUpperCase) .limit(2) .collect(Collectors.toList()); and write it using a classic for loop — then compare readability, performance, and flexibility. 🔁 Equivalent...
Understand how limit() short-circuits and how a stream pipeline executes lazily and element-by-element. 🔄 Example Code List<String> names = Arrays.asList(“Alice”, “Bob”, “Charlie”, “David”, “Eve”);List<String> result = names.stream() .filter(name -> { System.out.println(“Filtering: ” + name);...
What Is a Fully Qualified Name (FQN)? In Java, a class’s fully qualified name is its package name + class name. For example: package com.example;public class MyService {} FQN = com.example.MyService But What Really...
RAG Pinecone MCP Server This server implements the Model Context Protocol (MCP) for RAG (Retrieval-Augmented Generation) using Pinecone as the vector database. Environment Variables Required environment variables in your .env file: PINECONE_API_KEY= # Your Pinecone API...