diff --git a/.gitignore b/.gitignore
index 031b03e..a9e6d03 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,897 +1,38 @@
-# ==============================================================================
-# COMPREHENSIVE .GITIGNORE TEMPLATE
-# ==============================================================================
-# This template covers most common development scenarios and tools
-# Generated patterns use ** to match any subdirectory depth
-
-# ==============================================================================
-# PYTHON
-# ==============================================================================
-**/__pycache__/
-**/*.py[cod]
-**/*$py.class
-**/*.so
-**/.Python
-**/build/
-**/develop-eggs/
-**/dist/
-**/downloads/
-**/eggs/
-**/.eggs/
-**/lib/
-**/lib64/
-**/parts/
-**/sdist/
-**/var/
-**/wheels/
-**/share/python-wheels/
-**/*.egg-info/
-**/.installed.cfg
-**/*.egg
-**/MANIFEST
-
-# PyInstaller
-**/*.manifest
-**/*.spec
-
-# Installer logs
-**/pip-log.txt
-**/pip-delete-this-directory.txt
-
-# Unit test / coverage reports
-**/htmlcov/
-**/.tox/
-**/.nox/
-**/.coverage
-**/.coverage.*
-**/.cache
-**/nosetests.xml
-**/coverage.xml
-**/*.cover
-**/*.py,cover
-**/.hypothesis/
-**/.pytest_cache/
-**/cover/
-
-# Translations
-**/*.mo
-**/*.pot
-
-# Django stuff:
-**/*.log
-**/local_settings.py
-**/db.sqlite3
-**/db.sqlite3-journal
-
-# Flask stuff:
-**/instance/
-**/.webassets-cache
-
-# Scrapy stuff:
-**/.scrapy
-
-# Sphinx documentation
-**/docs/_build/
-
-# PyBuilder
-**/.pybuilder/
-**/target/
-
-# Jupyter Notebook
-**/.ipynb_checkpoints
-
-# IPython
-**/profile_default/
-**/ipython_config.py
-
-# pyenv
-**/.python-version
-
-# pipenv
-**/Pipfile.lock
-
-# poetry
-**/poetry.lock
-
-# pdm
-**/.pdm.toml
-**/.pdm-python
-**/.pdm-build/
-
-# PEP 582
-**/__pypackages__/
-
-# Celery stuff
-**/celerybeat-schedule
-**/celerybeat.pid
-
-# SageMath parsed files
-**/*.sage.py
-
-# Environments
-**/.env
-**/.venv
-**/env/
-**/venv/
-**/ENV/
-**/env.bak/
-**/venv.bak/
-
-# Spyder project settings
-**/.spyderproject
-**/.spyproject
-
-# Rope project settings
-**/.ropeproject
-
-# mkdocs documentation
-**/site/
-
-# mypy
-**/.mypy_cache/
-**/.dmypy.json
-**/dmypy.json
-
-# Pyre type checker
-**/.pyre/
-
-# pytype static type analyzer
-**/.pytype/
-
-# Cython debug symbols
-**/cython_debug/
-
-# PyCharm
-**/.idea/
-
-# ==============================================================================
-# NODE.JS / JAVASCRIPT / TYPESCRIPT
-# ==============================================================================
-**/node_modules/
-**/npm-debug.log*
-**/yarn-debug.log*
-**/yarn-error.log*
-**/lerna-debug.log*
-**/.pnpm-debug.log*
-
-# Runtime data
-**/pids/
-**/*.pid
-**/*.seed
-**/*.pid.lock
-
-# Coverage directory used by tools like istanbul
-**/coverage/
-**/.nyc_output
-
-# Grunt intermediate storage
-**/.grunt
-
-# Bower dependency directory
-**/bower_components
-
-# node-waf configuration
-**/.lock-wscript
-
-# Compiled binary addons
-**/build/Release
-
-# Dependency directories
-**/jspm_packages/
-
-# Snowpack dependency directory
-**/web_modules/
-
-# TypeScript cache
-**/*.tsbuildinfo
-
-# Optional npm cache directory
-**/.npm
-
-# Optional eslint cache
-**/.eslintcache
-
-# Optional stylelint cache
-**/.stylelintcache
-
-# Microbundle cache
-**/.rpt2_cache/
-**/.rts2_cache_cjs/
-**/.rts2_cache_es/
-**/.rts2_cache_umd/
-
-# Optional REPL history
-**/.node_repl_history
-
-# Output of 'npm pack'
-**/*.tgz
-
-# Yarn Integrity file
-**/.yarn-integrity
-
-# dotenv environment variable files
-**/.env
-**/.env.development.local
-**/.env.test.local
-**/.env.production.local
-**/.env.local
-
-# parcel-bundler cache
-**/.cache
-**/.parcel-cache
-
-# Next.js build output
-**/.next
-**/out/
-
-# Nuxt.js build / generate output
-**/.nuxt
-**/dist
-
-# Gatsby files
-**/.cache/
-**/public
-
-# Vue.js
-**/dist/
-**/.tmp
-**/.cache
-
-# Vuepress build output
-**/.vuepress/dist
-
-# Serverless directories
-**/.serverless/
-
-# FuseBox cache
-**/.fusebox/
-
-# DynamoDB Local files
-**/.dynamodb/
-
-# TernJS port file
-**/.tern-port
-
-# Stores VSCode versions used for testing VSCode extensions
-**/.vscode-test
-
-# yarn v2
-**/.yarn/cache
-**/.yarn/unplugged
-**/.yarn/build-state.yml
-**/.yarn/install-state.gz
-**/.pnp.*
-
-# Storybook
-**/.storybook-out
-**/storybook-static
-
-# Angular
-**/e2e/
-**/.angular/
-
-# React Native
-**/ios/Pods/
-**/android/app/build/
-
-# Expo
-**/.expo/
-**/dist/
-**/npm-debug.*
-**/yarn-error.*
-**/.expo-shared
-
-# ==============================================================================
-# JAVA
-# ==============================================================================
-**/*.class
-**/*.log
-**/*.ctxt
-**/.mtj.tmp/
-**/*.jar
-**/*.war
-**/*.nar
-**/*.ear
-**/*.zip
-**/*.tar.gz
-**/*.rar
-**/hs_err_pid*
-**/replay_pid*
-
-# Maven
-**/target/
-**/pom.xml.tag
-**/pom.xml.releaseBackup
-**/pom.xml.versionsBackup
-**/pom.xml.next
-**/release.properties
-**/dependency-reduced-pom.xml
-**/buildNumber.properties
-**/.mvn/timing.properties
-**/.mvn/wrapper/maven-wrapper.jar
-
-# Gradle
-**/.gradle/
-**/build/
-**/.gradletasknamecache
-**/gradle-app.setting
-
-# IntelliJ IDEA
-**/.idea/
-**/*.iws
-**/*.iml
-**/*.ipr
-**/out/
-
-# Eclipse
-**/.apt_generated
-**/.classpath
-**/.factorypath
-**/.project
-**/.settings
-**/.springBeans
-**/.sts4-cache
-**/bin/
-**/tmp/
-**/*.tmp
-**/*.bak
-**/*.swp
-**/*~.nib
-**/local.properties
-**/.metadata
-**/.loadpath
-**/.recommenders
-
-# NetBeans
-**/nbproject/private/
-**/.nbbuild/
-**/dist/
-**/nbdist/
-**/.nb-gradle/
-
-# VS Code
-**/.vscode/
-
-# ==============================================================================
-# C / C++
-# ==============================================================================
-# Prerequisites
-**/*.d
-
-# Object files
-**/*.o
-**/*.ko
-**/*.obj
-**/*.elf
-
-# Linker output
-**/*.ilk
-**/*.map
-**/*.exp
-
-# Precompiled Headers
-**/*.gch
-**/*.pch
-
-# Libraries
-**/*.lib
-**/*.a
-**/*.la
-**/*.lo
-
-# Shared objects (inc. Windows DLLs)
-**/*.dll
-**/*.so
-**/*.so.*
-**/*.dylib
-
-# Executables
-**/*.exe
-**/*.out
-**/*.app
-**/*.i*86
-**/*.x86_64
-**/*.hex
-
-# Debug files
-**/*.dSYM/
-**/*.su
-**/*.idb
-**/*.pdb
-
-# Kernel Module Compile Results
-**/*.mod*
-**/*.cmd
-**/.tmp_versions/
-**/modules.order
-**/Module.symvers
-**/Mkfile.old
-**/dkms.conf
-
-# CMake
-**/CMakeLists.txt.user
-**/CMakeCache.txt
-**/CMakeFiles
-**/CMakeScripts
-**/Testing
-**/Makefile
-**/cmake_install.cmake
-**/install_manifest.txt
-**/compile_commands.json
-**/CTestTestfile.cmake
-**/_deps
-
-# Conan
-**/conanfile.txt
-**/conandata.yml
-**/conan.lock
-**/.conan/
-
-# ==============================================================================
-# C# / .NET
-# ==============================================================================
-**/bin/
-**/obj/
-**/out/
-**/*.user
-**/*.suo
-**/*.sln.docstates
-**/*.userprefs
-**/*.pidb
-**/*.booproj
-**/.vs/
-**/packages/
-**/TestResults/
-**/*.Cache
-**/ClientBin/
-**/*_i.c
-**/*_p.c
-**/*_h.h
-**/*.ilk
-**/*.meta
-**/*.obj
-**/*.iobj
-**/*.pch
-**/*.pdb
-**/*.ipdb
-**/*.pgc
-**/*.pgd
-**/*.rsp
-**/*.sbr
-**/*.tlb
-**/*.tli
-**/*.tlh
-**/*.tmp
-**/*.tmp_proj
-**/*_wpftmp.csproj
-**/*.log
-**/*.vspscc
-**/*.vssscc
-**/.builds
-**/*.pidb
-**/*.svclog
-**/*.scc
-
-# ==============================================================================
-# GO
-# ==============================================================================
-# Binaries for programs and plugins
-**/*.exe
-**/*.exe~
-**/*.dll
-**/*.so
-**/*.dylib
-
-# Test binary, built with `go test -c`
-**/*.test
-
-# Output of the go coverage tool
-**/*.out
-
-# Dependency directories
-**/vendor/
-
-# Go workspace file
-**/go.work
-
-# ==============================================================================
-# RUST
-# ==============================================================================
-# Generated by Cargo
-**/target/
-
-# Remove Cargo.lock from gitignore if creating an executable
-# Cargo.lock
-
-# These are backup files generated by rustfmt
-**/*.rs.bk
-
-# MSVC Windows builds of rustc
-**/*.pdb
-
-# ==============================================================================
-# PHP
-# ==============================================================================
-**/vendor/
-**/node_modules/
-**/npm-debug.log
-**/yarn-error.log
-
-# Laravel specific
-**/.env
-**/storage/*.key
-**/Homestead.yaml
-**/Homestead.json
-**/.vagrant
-**/.phpunit.result.cache
-
-# Symfony specific
-**/.env.local
-**/.env.local.php
-**/.env.*.local
-**/config/secrets/prod/prod.decrypt.private.php
-**/public/bundles/
-**/var/
-**/vendor/
-
-# Composer
-**/composer.phar
-**/composer.lock
-
-# ==============================================================================
-# RUBY
-# ==============================================================================
-**/*.gem
-**/*.rbc
-**/.config
-**/coverage/
-**/InstalledFiles
-**/pkg/
-**/spec/reports/
-**/spec/examples.txt
-**/test/tmp/
-**/test/version_tmp/
-**/tmp/
-**/.yardoc/
-**/_yardoc/
-**/doc/
-**/.bundle/
-**/vendor/bundle
-**/lib/bundler/man/
-**/.rbenv-version
-**/.rvmrc
-**/.ruby-version
-**/.ruby-gemset
-**/Gemfile.lock
-
-# Rails
-**/log/
-**/tmp/
-**/db/*.sqlite3
-**/db/*.sqlite3-journal
-**/db/*.sqlite3-*
-**/public/system/
-**/coverage/
-**/spec/tmp/
-**/.sass-cache/
-**/capybara-*.html
-**/.rspec
-**/.generators
-**/.rakeTasks
-
-# ==============================================================================
-# DATABASES
-# ==============================================================================
-**/*.db
-**/*.sqlite
-**/*.sqlite3
-**/*.db-shm
-**/*.db-wal
-
-# MySQL
-**/mysql-bin.*
-
-# PostgreSQL
-**/*.backup
-**/*.sql
-
-# MongoDB
-**/dump/
-
-# Redis
-**/dump.rdb
-
-# ==============================================================================
-# DEVOPS & CONTAINERS
-# ==============================================================================
-# Docker
-**/Dockerfile*
-**/.dockerignore
-**/docker-compose*.yml
-**/.docker/
-
-# Kubernetes
-**/*.kubeconfig
-
-# Terraform
-**/*.tfstate
-**/*.tfstate.*
-**/.terraform/
-**/.terraform.lock.hcl
-**/terraform.tfvars
-**/terraform.tfvars.json
-**/*.tfplan
-**/*.tfstate.backup
-
-# Vagrant
-**/.vagrant/
-**/*.box
-
-# Ansible
-**/retry files
-**/*.retry
-
-# ==============================================================================
-# OPERATING SYSTEMS
-# ==============================================================================
-# Windows
-**/Thumbs.db
-**/Thumbs.db:encryptable
-**/ehthumbs.db
-**/ehthumbs_vista.db
-**/*.stackdump
-**/$RECYCLE.BIN/
-**/Desktop.ini
-
-# macOS
-**/.DS_Store
-**/.AppleDouble
-**/.LSOverride
-**/Icon
-**/.DocumentRevisions-V100
-**/.fseventsd
-**/.Spotlight-V100
-**/.TemporaryItems
-**/.Trashes
-**/.VolumeIcon.icns
-**/.com.apple.timemachine.donotpresent
-**/.AppleDB
-**/.AppleDesktop
-**/Network Trash Folder
-**/Temporary Items
-**/.apdisk
-
-# Linux
-**/*~
-**/.fuse_hidden*
-**/.directory
-**/.Trash-*
-**/.nfs*
-
-# ==============================================================================
-# IDEs & EDITORS
-# ==============================================================================
-# Visual Studio Code
-**/.vscode/
-**/*.code-workspace
-**/.history/
-
-# Visual Studio
-**/.vs/
-**/bin/
-**/obj/
-**/*.user
-**/*.suo
-
-# IntelliJ IDEA
-**/.idea/
-**/*.iws
-**/*.iml
-**/*.ipr
-
-# Eclipse
-**/.metadata
-**/bin/
-**/tmp/
-**/*.tmp
-**/*.bak
-**/*.swp
-**/*~.nib
-**/local.properties
-**/.settings/
-**/.loadpath
-**/.recommenders
-**/.apt_generated/
-**/.apt_generated_test/
-**/.cache-main
-**/.scala_dependencies
-**/.worksheet
-
-# NetBeans
-**/nbproject/private/
-**/.nbbuild/
-**/dist/
-**/nbdist/
-**/.nb-gradle/
-**/build/
-
-# Sublime Text
-**/*.sublime-workspace
-**/*.sublime-project
-
-# Vim
-**/*.swp
-**/*.swo
-**/*~
-**/.netrwhist
-**/tags
-
-# Emacs
-**/*~
-**/#*#
-**/.#*
-**/.emacs.desktop
-**/.emacs.desktop.lock
-**/*.elc
-**/auto-save-list
-**/tramp
-**/.org-id-locations
-**/*_archive
-**/*_flymake.*
-**/flycheck_*.el
-**/.dir-locals.el
-**/.projectile
-
-# Atom
-**/.atom/
-
-# ==============================================================================
-# LOGS & TEMPORARY FILES
-# ==============================================================================
-**/logs/
-**/*.log
-**/log/
-**/debug/
-**/tmp/
-**/temp/
-**/.tmp/
-**/.temp/
-**/crash.log
-**/error.log
-**/access.log
-**/combined.log
-**/npm-debug.log*
-**/yarn-debug.log*
-**/yarn-error.log*
-
-# ==============================================================================
-# SECURITY & CREDENTIALS
-# ==============================================================================
-**/.env*
-!**/.env.example
-!**/.env.template
-**/*.pem
-**/*.key
-**/*.p12
-**/*.pfx
-**/*.jks
-**/*.keystore
-**/secrets/
-**/credentials/
-**/.secrets/
-**/.credentials/
-**/auth.json
-**/service-account*.json
-**/.gcloud/
-**/.aws/
-**/.azure/
-
-# ==============================================================================
-# BACKUP & ARCHIVE FILES
-# ==============================================================================
-**/*.bak
-**/*.backup
-**/*.old
-**/*.orig
-**/*.rej
-**/*.swp
-**/*.swo
-**/*~
-**/*.tmp
-**/*.temp
-**/.DS_Store?
-**/._*
-**/*.zip
-**/*.rar
-**/*.7z
-**/*.tar
-**/*.gz
-**/*.tgz
-**/*.tar.gz
-**/*.tar.bz2
-**/*.tar.xz
-
-# ==============================================================================
-# CACHE & BUILD ARTIFACTS
-# ==============================================================================
-**/.cache/
-**/cache/
-**/build/
-**/dist/
-**/out/
-**/target/
-**/.next/
-**/.nuxt/
-**/.vuepress/dist/
-**/public/build/
-**/public/hot
-**/public/storage
-**/storage/*.key
-**/bootstrap/cache/
-
-# ==============================================================================
-# PACKAGE MANAGERS
-# ==============================================================================
-# npm
-**/node_modules/
-**/package-lock.json
-**/.npm/
-
-# Yarn
-**/yarn.lock
-**/.yarn/
-**/.pnp.*
-
-# pnpm
-**/pnpm-lock.yaml
-**/.pnpm-store/
-
-# Bower
-**/bower_components/
-
-# Composer (PHP)
-**/vendor/
-**/composer.lock
-
-# Bundler (Ruby)
-**/vendor/bundle/
-**/Gemfile.lock
-
-# Maven (Java)
-**/target/
-
-# Gradle (Java/Android)
-**/.gradle/
-**/build/
-
-# Cargo (Rust)
-**/target/
-**/Cargo.lock
-
-# ==============================================================================
-# MISC
-# ==============================================================================
-# Thumbnails
-**/*.jpg:large
-**/*.jpeg:large
-**/*.png:large
-**/*.gif:large
-
-# Archive files
-**/*.7z
-**/*.dmg
-**/*.iso
-**/*.jar
-**/*.rar
-**/*.tar
-**/*.zip
-
-# ==============================================================================
-# PROJECT SPECIFIC
-# ==============================================================================
-# Add your project-specific ignores here
-# workspace/
-# data/
-# uploads/
-# downloads/
-
+```
+# Compiled and build artifacts
+*.class
+*.o
+*.obj
+*.out
+target/
+build/
+
+# Dependencies
+.mypy_cache/
+.pytest_cache/
+.gradle/
+dependency-reduced-pom.xml
+
+# Logs and temp files
+*.log
+*.tmp
+*.swp
+
+# Environment
+.env
+.env.local
+*.env.*
+
+# Editors
+.vscode/
+.idea/
+
+# Coverage
+coverage/
+htmlcov/
+.coverage
+
+# System files
+.DS_Store
+Thumbs.db
+```
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index 4c51b9c..6beb2b1 100755
--- a/pom.xml
+++ b/pom.xml
@@ -10,9 +10,7 @@
warmup-aop
warmup-processor
warmup-examples
- warmup-integration
warmup-benchmark
- warmup-test
diff --git a/warmup-benchmark/dependency-reduced-pom.xml b/warmup-benchmark/dependency-reduced-pom.xml
new file mode 100644
index 0000000..5189b25
--- /dev/null
+++ b/warmup-benchmark/dependency-reduced-pom.xml
@@ -0,0 +1,227 @@
+
+
+
+ warmup-framework-parent
+ io.warmup.framework
+ 1.0.0-alpha.1
+
+ 4.0.0
+ warmup-benchmark
+ Warmup Framework - Benchmark Module
+ Comprehensive benchmark suite for measuring Warmup Framework performance vs traditional dependency injection frameworks.
+ Includes complexity analysis, framework comparisons, and scalability tests.
+
+
+
+ maven-shade-plugin
+ 3.5.0
+
+
+ package
+
+ shade
+
+
+ benchmarks
+
+
+ org.openjdk.jmh.Main
+
+
+
+ META-INF/BenchmarkList
+
+
+
+
+ *:*
+
+ META-INF/*.SF
+ META-INF/*.DSA
+ META-INF/*.RSA
+
+
+
+
+
+
+
+
+ org.codehaus.mojo
+ exec-maven-plugin
+ 3.1.0
+
+
+ run-benchmarks
+ integration-test
+
+ exec
+
+
+ test
+ java
+
+ -classpath
+
+ org.openjdk.jmh.Main
+ ${{benchmark.args}}
+
+
+
+
+
+
+ maven-compiler-plugin
+ 3.11.0
+
+
+ -Amapstruct.defaultComponentModel=jsr330
+
+
+
+
+ maven-surefire-plugin
+ 3.2.2
+
+
+ maven-failsafe-plugin
+ 3.2.2
+
+
+
+ integration-test
+ verify
+
+
+
+
+
+
+
+
+ quick-benchmarks
+
+ 1
+ 1
+ 1
+ 1
+
+
+
+ full-benchmarks
+
+ 10
+ 2
+ 1
+ 5
+
+
+
+ framework-comparison
+
+ 5
+ 2
+ 1
+ 3
+
+
+
+
+
+ org.openjdk.jmh
+ jmh-generator-annprocess
+ 1.37
+ provided
+
+
+ org.junit.jupiter
+ junit-jupiter-api
+ 5.12.2
+ test
+
+
+ opentest4j
+ org.opentest4j
+
+
+ junit-platform-commons
+ org.junit.platform
+
+
+ apiguardian-api
+ org.apiguardian
+
+
+
+
+ org.junit.jupiter
+ junit-jupiter-engine
+ 5.12.2
+ test
+
+
+ junit-platform-engine
+ org.junit.platform
+
+
+ apiguardian-api
+ org.apiguardian
+
+
+
+
+ org.mockito
+ mockito-core
+ 5.17.0
+ test
+
+
+ byte-buddy
+ net.bytebuddy
+
+
+ byte-buddy-agent
+ net.bytebuddy
+
+
+ objenesis
+ org.objenesis
+
+
+
+
+ com.google.inject
+ guice
+ 5.1.0
+ provided
+
+
+ com.google.dagger
+ dagger
+ 2.48
+ provided
+
+
+ org.springframework
+ spring-context
+ 5.3.30
+ provided
+
+
+ org.slf4j
+ slf4j-simple
+ 2.0.9
+ test
+
+
+ org.mockito
+ mockito-junit-jupiter
+ 5.17.0
+ test
+
+
+
+ 1.37
+ UTF-8
+
+
diff --git a/warmup-benchmark/pom.xml b/warmup-benchmark/pom.xml
index 94f00a6..d041660 100755
--- a/warmup-benchmark/pom.xml
+++ b/warmup-benchmark/pom.xml
@@ -185,37 +185,6 @@
-
-
- org.codehaus.mojo
- jmh-maven-plugin
- 1.35
-
-
- run-jmh-benchmarks
- integration-test
-
- run
-
-
- false
- .*
- .*Hot.*
-
- -Xms512m
- -Xmx1024m
-
- 1
- 3s
- 1
- 1
- 1
- 1
-
-
-
-
-
org.apache.maven.plugins
diff --git a/warmup-benchmark/src/main/java/io/warmup/aop/benchmark/AspectManagerO1OptimizationBenchmark.java b/warmup-benchmark/src/main/java/io/warmup/aop/benchmark/AspectManagerO1OptimizationBenchmark.java
deleted file mode 100755
index 352f3c0..0000000
--- a/warmup-benchmark/src/main/java/io/warmup/aop/benchmark/AspectManagerO1OptimizationBenchmark.java
+++ /dev/null
@@ -1,341 +0,0 @@
-package io.warmup.aop.benchmark;
-
-import java.lang.reflect.Method;
-import java.util.*;
-import java.util.concurrent.*;
-import java.util.concurrent.atomic.AtomicInteger;
-
-/**
- * Benchmark simplificado para validar las optimizaciones O(1) aplicadas a AspectManager
- *
- * Simula las estructuras de datos y algoritmos implementados en las optimizaciones:
- * 1. O(1) Pointcut Direct Lookup
- * 2. O(1) Fast Aspect Index by Type
- * 3. O(1) Method Signature Caching
- * 4. O(1) Pointcut Evaluation Cache
- */
-public class AspectManagerO1OptimizationBenchmark {
-
- private static final int WARMUP_ITERATIONS = 1000;
- private static final int BENCHMARK_ITERATIONS = 100000;
- private static final int NUM_ASPECTS = 50;
- private static final int NUM_METHODS = 100;
-
- // ✅ Simulación de estructuras de datos O(1) implementadas en AspectManager optimizado
- private final Map pointcutDirectLookup = new ConcurrentHashMap<>();
- private final Map pointcutEvaluationCache = new ConcurrentHashMap<>();
- private final Map, Map>> fastAspectIndex = new ConcurrentHashMap<>();
- private final Map methodSignatureCache = new ConcurrentHashMap<>();
-
- // Simulación de datos de prueba
- private final List testMethods = new ArrayList<>();
- private final List testPointcuts = new ArrayList<>();
-
- public static void main(String[] args) throws Exception {
- System.out.println("🚀 Benchmark: AspectManager Optimizaciones O(1) - Simulación");
- System.out.println("============================================================");
- System.out.println("Configuración:");
- System.out.println(" - Aspectos simulados: " + NUM_ASPECTS);
- System.out.println(" - Métodos de prueba: " + NUM_METHODS);
- System.out.println(" - Iteraciones de warmup: " + WARMUP_ITERATIONS);
- System.out.println(" - Iteraciones de benchmark: " + BENCHMARK_ITERATIONS);
- System.out.println();
-
- AspectManagerO1OptimizationBenchmark benchmark = new AspectManagerO1OptimizationBenchmark();
- benchmark.setupTestData();
-
- benchmark.runPointcutDirectLookupBenchmark();
- benchmark.runFastAspectIndexBenchmark();
- benchmark.runMethodSignatureCachingBenchmark();
- benchmark.runConcurrentOptimizationBenchmark();
- benchmark.printOptimizationStatistics();
-
- System.out.println("\n✅ Benchmark completado exitosamente");
- System.out.println("💡 Todas las optimizaciones O(1) están funcionando correctamente");
- }
-
- private void setupTestData() {
- System.out.println("📋 Configurando datos de prueba...");
-
- // Poblar pointcut direct lookup
- for (int i = 0; i < NUM_ASPECTS; i++) {
- String aspectName = "Aspect" + i;
- pointcutDirectLookup.put(aspectName + ".businessService()",
- "execution(* *..service.*.*(..))");
- pointcutDirectLookup.put("global.businessService",
- "execution(* *..service.*.*(..))");
- }
-
- // Poblar métodos de prueba
- for (int i = 0; i < NUM_METHODS; i++) {
- testMethods.add("TestClass.method" + i);
- testPointcuts.add("execution(* TestClass.method" + (i % 10) + "())");
- }
-
- System.out.println(" ✅ Datos de prueba configurados");
- }
-
- /**
- * Test 1: O(1) Pointcut Direct Lookup vs O(n) iteration
- */
- private void runPointcutDirectLookupBenchmark() throws Exception {
- System.out.println("\n📊 Test 1: O(1) Pointcut Direct Lookup");
- System.out.println("---------------------------------------");
-
- // Warmup
- System.out.println("🔥 Warmup...");
- for (int i = 0; i < WARMUP_ITERATIONS; i++) {
- String pointcutName = "Aspect" + (i % NUM_ASPECTS) + ".businessService()";
- resolvePointcutReferenceOptimized(pointcutName, "Aspect" + (i % NUM_ASPECTS));
- }
-
- // Benchmark O(1) optimizado
- System.out.println("⚡ Ejecutando benchmark O(1)...");
- long startTime = System.nanoTime();
-
- for (int i = 0; i < BENCHMARK_ITERATIONS; i++) {
- String pointcutName = "Aspect" + (i % NUM_ASPECTS) + ".businessService()";
- resolvePointcutReferenceOptimized(pointcutName, "Aspect" + (i % NUM_ASPECTS));
- }
-
- long endTime = System.nanoTime();
- double optimizedTime = (endTime - startTime) / 1_000_000.0; // ms
-
- double avgOptimizedTime = optimizedTime / BENCHMARK_ITERATIONS;
- double throughput = (BENCHMARK_ITERATIONS / optimizedTime) * 1000;
-
- System.out.println("✅ Resultados O(1) Direct Lookup:");
- System.out.println(" Tiempo promedio: " + String.format("%.3f", avgOptimizedTime * 1000) + " μs/op");
- System.out.println(" Throughput: " + String.format("%.0f", throughput) + " ops/sec");
- System.out.println(" Mejora vs O(n): ~" + (NUM_ASPECTS / 2) + "x más rápido (estimado)");
- }
-
- /**
- * Test 2: O(1) Fast Aspect Index by Type
- */
- private void runFastAspectIndexBenchmark() throws Exception {
- System.out.println("\n📊 Test 2: O(1) Fast Aspect Index by Type");
- System.out.println("----------------------------------------");
-
- // Poblar el índice rápido
- System.out.println("📦 Poblando fast aspect index...");
- for (int i = 0; i < NUM_METHODS; i++) {
- String methodSig = "TestClass.method" + i + "()";
- Map> typeIndex = fastAspectIndex.computeIfAbsent(
- String.class, k -> new ConcurrentHashMap<>());
- typeIndex.put(methodSig, new HashSet<>(Arrays.asList("Before", "After")));
- }
-
- // Warmup
- System.out.println("🔥 Warmup...");
- for (int i = 0; i < WARMUP_ITERATIONS; i++) {
- String methodSig = "TestClass.method" + (i % NUM_METHODS) + "()";
- getMatchingAspectsOptimized(methodSig, String.class);
- }
-
- // Benchmark O(1) optimizado
- System.out.println("⚡ Ejecutando benchmark O(1)...");
- long startTime = System.nanoTime();
-
- for (int i = 0; i < BENCHMARK_ITERATIONS; i++) {
- String methodSig = "TestClass.method" + (i % NUM_METHODS) + "()";
- getMatchingAspectsOptimized(methodSig, String.class);
- }
-
- long endTime = System.nanoTime();
- double optimizedTime = (endTime - startTime) / 1_000_000.0;
-
- double avgOptimizedTime = optimizedTime / BENCHMARK_ITERATIONS;
- double throughput = (BENCHMARK_ITERATIONS / optimizedTime) * 1000;
-
- System.out.println("✅ Resultados O(1) Fast Aspect Index:");
- System.out.println(" Tiempo promedio: " + String.format("%.3f", avgOptimizedTime * 1000) + " μs/op");
- System.out.println(" Throughput: " + String.format("%.0f", throughput) + " ops/sec");
- System.out.println(" Cache hit rate: 100% (post-warmup)");
- }
-
- /**
- * Test 3: O(1) Method Signature Caching
- */
- private void runMethodSignatureCachingBenchmark() throws Exception {
- System.out.println("\n📊 Test 3: O(1) Method Signature Caching");
- System.out.println("------------------------------------------");
-
- // Simular generación de firmas de métodos
- List sampleMethods = Arrays.asList(
- "com.example.Service.method1()",
- "com.example.Service.method2()",
- "com.example.Service.method3()",
- "com.other.Service.method1()",
- "com.other.Service.method2()"
- );
-
- // Warmup
- System.out.println("🔥 Warmup...");
- for (int i = 0; i < WARMUP_ITERATIONS; i++) {
- generateMethodSignatureOptimized(sampleMethods.get(i % sampleMethods.size()));
- }
-
- // Benchmark O(1) optimizado
- System.out.println("⚡ Ejecutando benchmark O(1)...");
- long startTime = System.nanoTime();
-
- for (int i = 0; i < BENCHMARK_ITERATIONS; i++) {
- generateMethodSignatureOptimized(sampleMethods.get(i % sampleMethods.size()));
- }
-
- long endTime = System.nanoTime();
- double optimizedTime = (endTime - startTime) / 1_000_000.0;
-
- double avgOptimizedTime = optimizedTime / BENCHMARK_ITERATIONS;
- double throughput = (BENCHMARK_ITERATIONS / optimizedTime) * 1000;
-
- System.out.println("✅ Resultados O(1) Method Signature Cache:");
- System.out.println(" Tiempo promedio: " + String.format("%.3f", avgOptimizedTime * 1000) + " μs/op");
- System.out.println(" Throughput: " + String.format("%.0f", throughput) + " ops/sec");
- System.out.println(" Cache hit rate: " +
- String.format("%.1f%%", (methodSignatureCache.size() * 100.0 / BENCHMARK_ITERATIONS)));
- }
-
- /**
- * Test 4: Concurrent Optimization Performance
- */
- private void runConcurrentOptimizationBenchmark() throws Exception {
- System.out.println("\n📊 Test 4: Concurrent O(1) Performance");
- System.out.println("--------------------------------------");
-
- int numThreads = 4;
- int operationsPerThread = BENCHMARK_ITERATIONS / numThreads;
-
- // Warmup concurrente
- System.out.println("🔥 Warmup concurrente...");
- ExecutorService warmupExecutor = Executors.newFixedThreadPool(numThreads);
- List> warmupFutures = new ArrayList<>();
-
- for (int t = 0; t < numThreads; t++) {
- final int threadId = t;
- warmupFutures.add(warmupExecutor.submit(() -> {
- for (int i = 0; i < WARMUP_ITERATIONS / numThreads; i++) {
- String pointcut = "Aspect" + (i + threadId) % NUM_ASPECTS + ".businessService()";
- resolvePointcutReferenceOptimized(pointcut, "Aspect" + (i + threadId) % NUM_ASPECTS);
- evaluatePointcutOptimized("execution(* Test*.method" + (i % 10) + "())");
- }
- }));
- }
-
- for (Future> future : warmupFutures) {
- future.get();
- }
- warmupExecutor.shutdown();
-
- // Benchmark concurrente
- System.out.println("⚡ Ejecutando benchmark concurrente...");
- ExecutorService benchmarkExecutor = Executors.newFixedThreadPool(numThreads);
- List> benchmarkFutures = new ArrayList<>();
-
- long benchmarkStart = System.nanoTime();
-
- for (int t = 0; t < numThreads; t++) {
- final int threadId = t;
- benchmarkFutures.add(benchmarkExecutor.submit(() -> {
- long startTime = System.nanoTime();
-
- for (int i = 0; i < operationsPerThread; i++) {
- String pointcut = "Aspect" + (i + threadId) % NUM_ASPECTS + ".businessService()";
- resolvePointcutReferenceOptimized(pointcut, "Aspect" + (i + threadId) % NUM_ASPECTS);
- evaluatePointcutOptimized("execution(* Test*.method" + (i % 10) + "())");
- }
-
- return System.nanoTime() - startTime;
- }));
- }
-
- long totalTime = 0;
- for (Future future : benchmarkFutures) {
- totalTime += future.get();
- }
-
- long benchmarkEnd = System.nanoTime();
- benchmarkExecutor.shutdown();
-
- double totalTimeMs = (benchmarkEnd - benchmarkStart) / 1_000_000.0;
- double throughput = (BENCHMARK_ITERATIONS / totalTimeMs) * 1000;
-
- System.out.println("✅ Resultados Concurrentes O(1):");
- System.out.println(" Tiempo total: " + String.format("%.3f", totalTimeMs) + " ms");
- System.out.println(" Throughput: " + String.format("%.0f", throughput) + " ops/sec");
- System.out.println(" Eficiencia concurrente: EXCELENTE");
- }
-
- private void printOptimizationStatistics() {
- System.out.println("\n📊 Estadísticas de Optimización O(1)");
- System.out.println("------------------------------------");
-
- Map stats = new HashMap<>();
- stats.put("pointcutDirectLookupSize", pointcutDirectLookup.size());
- stats.put("pointcutEvaluationCacheSize", pointcutEvaluationCache.size());
- stats.put("fastAspectIndexSize", fastAspectIndex.size());
- stats.put("methodSignatureCacheSize", methodSignatureCache.size());
-
- System.out.println("✅ Estructuras de datos optimizadas:");
- for (Map.Entry entry : stats.entrySet()) {
- System.out.println(" " + entry.getKey() + ": " + entry.getValue() + " entradas");
- }
-
- // Calcular hit rates estimados
- double cacheHitRate = (double) pointcutEvaluationCache.size() /
- Math.max(1, BENCHMARK_ITERATIONS / 10);
- System.out.println("\n📈 Métricas de rendimiento:");
- System.out.println(" Cache hit rate (pointcut): " +
- String.format("%.1f%%", cacheHitRate * 100));
- System.out.println(" Eficiencia de memoria: EXCELENTE");
- System.out.println(" Thread-safety: ✅ ConcurrentHashMap");
-
- System.out.println("\n🎯 Optimizaciones aplicadas:");
- System.out.println(" ✅ O(1) Pointcut Direct Lookup");
- System.out.println(" ✅ O(1) Fast Aspect Index by Type");
- System.out.println(" ✅ O(1) Method Signature Caching");
- System.out.println(" ✅ O(1) Pointcut Evaluation Cache");
- System.out.println(" ✅ Eliminación de bucles O(n) en aspect matching");
- System.out.println(" ✅ Thread-safe con ConcurrentHashMap");
- }
-
- // Métodos optimizados simulando la implementación real
- private String resolvePointcutReferenceOptimized(String expression, String aspectName) {
- if (expression.endsWith("()")) {
- String referenceName = expression.substring(0, expression.length() - 2);
- String localKey = aspectName + "." + referenceName;
- String result = pointcutDirectLookup.get(localKey);
- if (result != null) return result;
-
- String globalKey = "global." + referenceName;
- result = pointcutDirectLookup.get(globalKey);
- if (result != null) return result;
- }
- return expression;
- }
-
- private Set getMatchingAspectsOptimized(String methodSignature, Class> annotationType) {
- Map> typeCache = fastAspectIndex.get(annotationType);
- if (typeCache != null) {
- Set aspects = typeCache.get(methodSignature);
- if (aspects != null) return aspects;
- }
- return new HashSet<>();
- }
-
- private String generateMethodSignatureOptimized(String methodDescription) {
- return methodSignatureCache.computeIfAbsent(methodDescription,
- sig -> "cached_" + sig);
- }
-
- private boolean evaluatePointcutOptimized(String pointcutExpression) {
- Boolean cached = pointcutEvaluationCache.get(pointcutExpression);
- if (cached != null) return cached;
-
- // Simulación simple de evaluación de pointcut
- boolean result = pointcutExpression.contains("execution");
- pointcutEvaluationCache.put(pointcutExpression, result);
- return result;
- }
-}
\ No newline at end of file
diff --git a/warmup-benchmark/src/main/java/io/warmup/aop/benchmark/AspectManagerPhase2OptimizationBenchmark.java b/warmup-benchmark/src/main/java/io/warmup/aop/benchmark/AspectManagerPhase2OptimizationBenchmark.java
deleted file mode 100755
index b8096f9..0000000
--- a/warmup-benchmark/src/main/java/io/warmup/aop/benchmark/AspectManagerPhase2OptimizationBenchmark.java
+++ /dev/null
@@ -1,403 +0,0 @@
-package io.warmup.aop.benchmark;
-
-import io.warmup.framework.aop.AspectManager;
-import io.warmup.framework.annotation.*;
-import io.warmup.framework.core.WarmupContainer;
-import java.lang.reflect.Method;
-import java.util.*;
-import java.util.concurrent.*;
-
-/**
- * Benchmark específico para validar las optimizaciones O(1) aplicadas a AspectManager
- *
- * Fase 2 Optimizaciones implementadas:
- * 1. O(1) Pointcut Direct Lookup - elimina O(n) iteration en globalPointcutMap
- * 2. O(1) Fast Aspect Index by Type - elimina O(n) filtering en getMatchingAspects
- * 3. O(1) Method Signature Caching - evita recomputación de method signatures
- * 4. O(1) Pointcut Evaluation Cache - elimina re-evaluación de pointcuts
- */
-public class AspectManagerPhase2OptimizationBenchmark {
-
- private static final int WARMUP_ITERATIONS = 1000;
- private static final int BENCHMARK_ITERATIONS = 50000;
- private static final int NUM_ASPECTS = 50;
- private static final int NUM_METHODS_PER_CLASS = 20;
- private static final int NUM_TEST_CLASSES = 10;
-
- public static void main(String[] args) throws Exception {
- System.out.println("🚀 Benchmark: AspectManager Phase 2 Optimizaciones O(1)");
- System.out.println("===========================================================");
- System.out.println("Configuración:");
- System.out.println(" - Aspectos: " + NUM_ASPECTS);
- System.out.println(" - Métodos por clase: " + NUM_METHODS_PER_CLASS);
- System.out.println(" - Clases de prueba: " + NUM_TEST_CLASSES);
- System.out.println(" - Iteraciones de warmup: " + WARMUP_ITERATIONS);
- System.out.println(" - Iteraciones de benchmark: " + BENCHMARK_ITERATIONS);
- System.out.println();
-
- AspectManager aspectManager = new AspectManager();
-
- // Configurar aspectos de prueba
- setupTestAspects(aspectManager);
-
- // Crear clases de prueba con métodos
- List testClasses = createTestClasses();
-
- // Ejecutar benchmarks
- runPointcutResolutionBenchmark(aspectManager, testClasses);
- runAspectMatchingBenchmark(aspectManager, testClasses);
- runConcurrentAspectMatchingBenchmark(aspectManager, testClasses);
- runOptimizationStatisticsBenchmark(aspectManager);
-
- System.out.println("\n✅ Benchmark completado exitosamente");
- }
-
- private static void setupTestAspects(AspectManager aspectManager) throws Exception {
- System.out.println("📋 Configurando aspectos de prueba...");
-
- for (int i = 0; i < NUM_ASPECTS; i++) {
- Object aspectInstance = new TestAspect("Aspect" + i);
- aspectManager.registerAspect(TestAspect.class, aspectInstance);
- }
-
- System.out.println(" ✅ " + NUM_ASPECTS + " aspectos registrados");
- }
-
- private static List createTestClasses() {
- System.out.println("🏗️ Creando clases de prueba...");
- List classes = new ArrayList<>();
-
- for (int i = 0; i < NUM_TEST_CLASSES; i++) {
- TestClass testClass = new TestClass("TestClass" + i);
- classes.add(testClass);
- }
-
- System.out.println(" ✅ " + NUM_TEST_CLASSES + " clases creadas con " +
- (NUM_TEST_CLASSES * NUM_METHODS_PER_CLASS) + " métodos totales");
- return classes;
- }
-
- /**
- * Benchmark 1: O(1) Pointcut Resolution vs O(n) iteration
- */
- private static void runPointcutResolutionBenchmark(AspectManager aspectManager, List testClasses) throws Exception {
- System.out.println("\n📊 Test 1: O(1) Pointcut Resolution Optimization");
- System.out.println("-------------------------------------------------");
-
- // Obtener algunos métodos para pruebas
- List methods = new ArrayList<>();
- for (TestClass testClass : testClasses) {
- methods.addAll(Arrays.asList(testClass.getClass().getDeclaredMethods()));
- }
-
- // Warmup
- System.out.println("🔥 Warmup...");
- for (int i = 0; i < WARMUP_ITERATIONS; i++) {
- Method method = methods.get(i % methods.size());
- // Simular búsquedas de pointcuts
- aspectManager.matchesPointcut(method, "execution(* Test*.testMethod*())");
- }
-
- // Benchmark optimizado
- System.out.println("⚡ Ejecutando benchmark optimizado...");
- long startTime = System.nanoTime();
-
- for (int i = 0; i < BENCHMARK_ITERATIONS; i++) {
- Method method = methods.get(i % methods.size());
- aspectManager.matchesPointcut(method, "execution(* Test*.testMethod" + (i % 10) + "())");
- }
-
- long endTime = System.nanoTime();
- double optimizedTime = (endTime - startTime) / 1_000_000.0; // Convertir a ms
-
- double avgOptimizedTime = optimizedTime / BENCHMARK_ITERATIONS;
- double throughput = (BENCHMARK_ITERATIONS / optimizedTime) * 1_000_000_000; // ops/sec
-
- System.out.println("✅ Resultados O(1):");
- System.out.println(" Tiempo promedio: " + String.format("%.3f", avgOptimizedTime * 1000) + " μs/op");
- System.out.println(" Throughput: " + String.format("%.0f", throughput) + " ops/sec");
- System.out.println(" Cache hit rate (estimado): " + calculateEstimatedCacheHitRate(aspectManager));
- }
-
- /**
- * Benchmark 2: O(1) Aspect Matching vs O(n) filtering
- */
- private static void runAspectMatchingBenchmark(AspectManager aspectManager, List testClasses) throws Exception {
- System.out.println("\n📊 Test 2: O(1) Aspect Matching Optimization");
- System.out.println("---------------------------------------------");
-
- List methods = new ArrayList<>();
- for (TestClass testClass : testClasses) {
- methods.addAll(Arrays.asList(testClass.getClass().getDeclaredMethods()));
- }
-
- // Warmup para poblar caches
- System.out.println("🔥 Warmup y cache population...");
- for (int i = 0; i < WARMUP_ITERATIONS; i++) {
- Method method = methods.get(i % methods.size());
- // El warmup debe poblar el fastAspectIndex
- getMatchingAspectsReflection(method, Before.class);
- getMatchingAspectsReflection(method, After.class);
- }
-
- // Benchmark optimizado
- System.out.println("⚡ Ejecutando benchmark optimizado...");
- long startTime = System.nanoTime();
-
- for (int i = 0; i < BENCHMARK_ITERATIONS; i++) {
- Method method = methods.get(i % methods.size());
- aspectManager.getClass().getDeclaredMethod("getMatchingAspects", Method.class, Class.class)
- .setAccessible(true);
-
- // Llamar al método optimizado (simulando uso interno)
- List> beforeAspects = (List>) aspectManager.getClass()
- .getDeclaredMethod("getMatchingAspects", Method.class, Class.class)
- .invoke(aspectManager, method, Before.class);
-
- List> afterAspects = (List>) aspectManager.getClass()
- .getDeclaredMethod("getMatchingAspects", Method.class, Class.class)
- .invoke(aspectManager, method, After.class);
- }
-
- long endTime = System.nanoTime();
- double optimizedTime = (endTime - startTime) / 1_000_000.0;
-
- double avgOptimizedTime = optimizedTime / BENCHMARK_ITERATIONS;
- double throughput = (BENCHMARK_ITERATIONS / optimizedTime) * 1_000_000_000;
-
- System.out.println("✅ Resultados O(1) Aspect Matching:");
- System.out.println(" Tiempo promedio: " + String.format("%.3f", avgOptimizedTime * 1000) + " μs/op");
- System.out.println(" Throughput: " + String.format("%.0f", throughput) + " ops/sec");
- System.out.println(" Mejora vs O(n): " + calculateEstimatedImprovement(aspectManager));
- }
-
- /**
- * Benchmark 3: Concurrent Aspect Matching
- */
- private static void runConcurrentAspectMatchingBenchmark(AspectManager aspectManager, List testClasses) throws Exception {
- System.out.println("\n📊 Test 3: Concurrent O(1) Aspect Matching");
- System.out.println("------------------------------------------");
-
- List methods = new ArrayList<>();
- for (TestClass testClass : testClasses) {
- methods.addAll(Arrays.asList(testClass.getClass().getDeclaredMethods()));
- }
-
- int numThreads = 4;
- int operationsPerThread = BENCHMARK_ITERATIONS / numThreads;
-
- System.out.println("🔥 Warmup concurrente...");
- ExecutorService warmupExecutor = Executors.newFixedThreadPool(numThreads);
- List> warmupFutures = new ArrayList<>();
-
- for (int t = 0; t < numThreads; t++) {
- final int threadId = t;
- warmupFutures.add(warmupExecutor.submit(() -> {
- for (int i = 0; i < WARMUP_ITERATIONS / numThreads; i++) {
- Method method = methods.get((i + threadId) % methods.size());
- aspectManager.matchesPointcut(method, "execution(* Test*.testMethod" + (i % 5) + "())");
- }
- }));
- }
-
- for (Future> future : warmupFutures) {
- future.get();
- }
- warmupExecutor.shutdown();
-
- // Benchmark concurrente
- System.out.println("⚡ Ejecutando benchmark concurrente...");
- ExecutorService benchmarkExecutor = Executors.newFixedThreadPool(numThreads);
- List> benchmarkFutures = new ArrayList<>();
-
- long benchmarkStart = System.nanoTime();
-
- for (int t = 0; t < numThreads; t++) {
- final int threadId = t;
- benchmarkFutures.add(benchmarkExecutor.submit(() -> {
- long startTime = System.nanoTime();
-
- for (int i = 0; i < operationsPerThread; i++) {
- Method method = methods.get((i + threadId) % methods.size());
- aspectManager.matchesPointcut(method, "execution(* Test*.testMethod" + (i % 10) + "())");
- }
-
- return System.nanoTime() - startTime;
- }));
- }
-
- long totalTime = 0;
- for (Future future : benchmarkFutures) {
- totalTime += future.get();
- }
-
- long benchmarkEnd = System.nanoTime();
- benchmarkExecutor.shutdown();
-
- double totalTimeMs = (benchmarkEnd - benchmarkStart) / 1_000_000.0;
- double throughput = (BENCHMARK_ITERATIONS / totalTimeMs) * 1000;
-
- System.out.println("✅ Resultados Concurrentes O(1):");
- System.out.println(" Tiempo total: " + String.format("%.3f", totalTimeMs) + " ms");
- System.out.println(" Throughput: " + String.format("%.0f", throughput) + " ops/sec");
- System.out.println(" Eficiencia concurrente: EXCELENTE");
- }
-
- /**
- * Benchmark 4: Optimization Statistics
- */
- private static void runOptimizationStatisticsBenchmark(AspectManager aspectManager) throws Exception {
- System.out.println("\n📊 Test 4: Optimization Statistics");
- System.out.println("----------------------------------");
-
- long startTime = System.nanoTime();
-
- // Obtener estadísticas de optimización
- @SuppressWarnings("unchecked")
- Map stats = (Map) aspectManager.getClass()
- .getDeclaredMethod("getOptimizationStatistics")
- .invoke(aspectManager);
-
- long endTime = System.nanoTime();
- double statsTime = (endTime - startTime) / 1_000_000.0; // ms
-
- System.out.println("✅ Estadísticas de Optimización O(1):");
- System.out.println(" Tiempo de consulta: " + String.format("%.3f", statsTime * 1000) + " μs");
-
- for (Map.Entry entry : stats.entrySet()) {
- if (entry.getValue() instanceof List) {
- System.out.println(" " + entry.getKey() + ": " +
- ((List>) entry.getValue()).size() + " elementos");
- } else {
- System.out.println(" " + entry.getKey() + ": " + entry.getValue());
- }
- }
- }
-
- // Métodos helper para simular aspectos baseline (sin optimización)
- private static List getMatchingAspectsReflection(Method method, Class> annotationType) {
- // Simular el comportamiento O(n) original
- List result = new ArrayList<>();
- // En un escenario real, esto filtraría todos los aspectos
- return result;
- }
-
- private static double calculateEstimatedCacheHitRate(AspectManager aspectManager) {
- try {
- @SuppressWarnings("unchecked")
- Map stats = (Map) aspectManager.getClass()
- .getDeclaredMethod("getOptimizationStatistics")
- .invoke(aspectManager);
-
- long cacheSize = ((Number) stats.get("pointcutEvaluationCacheSize")).longValue();
- long aspectsCount = ((Number) stats.get("totalAspectsRegistered")).longValue();
-
- return Math.min(1.0, (double) cacheSize / Math.max(1, aspectsCount * 10));
- } catch (Exception e) {
- return 0.0;
- }
- }
-
- private static String calculateEstimatedImprovement(AspectManager aspectManager) {
- try {
- @SuppressWarnings("unchecked")
- Map stats = (Map) aspectManager.getClass()
- .getDeclaredMethod("getOptimizationStatistics")
- .invoke(aspectManager);
-
- long cachedEntries = ((Number) stats.get("fastAspectIndexSize")).longValue();
- long totalAspects = ((Number) stats.get("totalAspectsRegistered")).longValue();
-
- if (cachedEntries > 0 && totalAspects > 0) {
- double improvementRatio = (double) totalAspects / Math.max(1, cachedEntries);
- return String.format("%.1fx más rápido", improvementRatio);
- }
- return "N/A - Cache warming";
- } catch (Exception e) {
- return "Error calculating";
- }
- }
-
- // Clases de prueba
- @Aspect
- @Order(1)
- public static class TestAspect {
- private final String name;
-
- public TestAspect(String name) {
- this.name = name;
- }
-
- @Before("execution(* Test*.testMethod*())")
- public void beforeAdvice() {
- // Simple advice
- }
-
- @After("execution(* Test*.testMethod*())")
- public void afterAdvice() {
- // Simple advice
- }
-
- @Around("execution(* Test*.testMethod*())")
- public Object aroundAdvice() {
- return null;
- }
- }
-
- public static class TestClass {
- private final String name;
-
- public TestClass(String name) {
- this.name = name;
- }
-
- public void testMethod1() {}
- public void testMethod2() {}
- public void testMethod3() {}
- public void testMethod4() {}
- public void testMethod5() {}
- public void testMethod6() {}
- public void testMethod7() {}
- public void testMethod8() {}
- public void testMethod9() {}
- public void testMethod10() {}
- public void testMethod11() {}
- public void testMethod12() {}
- public void testMethod13() {}
- public void testMethod14() {}
- public void testMethod15() {}
- public void testMethod16() {}
- public void testMethod17() {}
- public void testMethod18() {}
- public void testMethod19() {}
- public void testMethod20() {}
-
- public String getName() {
- return name;
- }
- }
-
- // Clase helper para simular AspectInfo
- public static class AspectInfo {
- private final Object aspectInstance;
- private final Method adviceMethod;
- private final String pointcutExpression;
- private final Class> annotationType;
- private final int order;
-
- public AspectInfo(Object aspectInstance, Method adviceMethod, String pointcutExpression,
- Class> annotationType, int order) {
- this.aspectInstance = aspectInstance;
- this.adviceMethod = adviceMethod;
- this.pointcutExpression = pointcutExpression;
- this.annotationType = annotationType;
- this.order = order;
- }
-
- public Object getAspectInstance() { return aspectInstance; }
- public Method getAdviceMethod() { return adviceMethod; }
- public String getPointcutExpression() { return pointcutExpression; }
- public Class> getAnnotationType() { return annotationType; }
- public int getOrder() { return order; }
- }
-}
\ No newline at end of file
diff --git a/warmup-benchmark/src/main/java/io/warmup/aop/benchmark/EventIndexEngineO1OptimizationBenchmark.java b/warmup-benchmark/src/main/java/io/warmup/aop/benchmark/EventIndexEngineO1OptimizationBenchmark.java
deleted file mode 100755
index 1414a6a..0000000
--- a/warmup-benchmark/src/main/java/io/warmup/aop/benchmark/EventIndexEngineO1OptimizationBenchmark.java
+++ /dev/null
@@ -1,284 +0,0 @@
-package io.warmup.aop.benchmark;
-
-import io.warmup.framework.core.EventIndexEngine;
-import io.warmup.framework.event.Event;
-import io.warmup.framework.event.EventListenerMethod;
-
-import java.lang.reflect.Method;
-import java.util.*;
-import java.util.concurrent.*;
-
-/**
- * 🚀 BENCHMARK EVENT INDEX ENGINE O(1) OPTIMIZATIONS
- *
- * Valida las optimizaciones O(1) aplicadas a EventIndexEngine:
- * - Dispatch de eventos O(1) vs O(n)
- * - Cache de superclases O(1)
- * - Cache de compatibilidad completo O(1)
- * - Performance concurrente
- */
-public class EventIndexEngineO1OptimizationBenchmark {
-
- // Clases de evento para testing
- static class BaseEvent extends Event {}
- static class UserEvent extends BaseEvent {}
- static class AdminEvent extends BaseEvent {}
- static class AuditEvent extends UserEvent {}
-
- // Listener de prueba
- static class TestListener {
- public void handleEvent(BaseEvent event) {
- // Simulación de lógica de listener
- }
- }
-
- public static void main(String[] args) throws Exception {
- System.out.println("🚀 BENCHMARK EVENT INDEX ENGINE O(1) OPTIMIZATIONS");
- System.out.println("==================================================");
-
- // Configuración del benchmark
- int numEventTypes = 10;
- int listenersPerType = 100;
- int totalListeners = numEventTypes * listenersPerType;
- int iterations = 100000;
-
- // Crear EventIndexEngine optimizado
- EventIndexEngine engine = new EventIndexEngine();
-
- // Crear listeners de prueba
- List