Code review comment: > we had to patch Arc in the past to remove some of these as they had a signifcant impact on benchmarks  I do remember quite a few optimizations I'm not exactly proud of :shrug:.  > you won't notice on micro benchmarks unless you're using all CPUs So I'd personally avoid them  All benchmarks are tricky because they run in a specific system configuration. But I strongly disagree that we should avoid microbenchmarks . In an ideal world, we would start with a microbenchmark and continue with benchmarking several quarkus app configurations (small app, big app, etc.)..  > you know better how much of an "hot path" this is..  I'm pretty sure here.

Code under review:
public ArcContainerImpl(CurrentContextFactory currentContextFactory, boolean strictMode) {
        this.strictMode = strictMode;
        id = String.valueOf(ID_GENERATOR.incrementAndGet());
        running = new AtomicBoolean(true);
        List<InjectableBean<?>> beans = new ArrayList<>();
        Map<String, List<InjectableBean<?>>> beansByRawType = new HashMap<>();
        List<Supplier<Collection<RemovedBean>>> removedBeans = new ArrayList<>();
        List<InjectableInterceptor<?>> interceptors = new ArrayList<>();
        List<InjectableDecorator<?>> decorators = new ArrayList<>();
        List<InjectableObserverMethod<?>> observers = new ArrayList<>();
        Set<String> interceptorBindings = new HashSet<>();
        Map<Class<? extends Annotation>, Set<Annotation>> transitiveInterceptorBindings = new HashMap<>();
        Map<String, Set<String>> qualifierNonbindingMembers = new HashMap<>();
        Set<String> qualifiers = new HashSet<>();
        this.currentContextFactory = currentContextFactory == null ? new ThreadLocalCurrentContextFactory()
                : currentContextFactory;

        List<Components> components = new ArrayList<>();
        for (ComponentsProvider componentsProvider : ServiceLoader.load(ComponentsProvider.class)) {
            components.add(componentsProvider.getComponents());
        }

        for (Components c : components) {
            for (InjectableBean<?> bean : c.getBeans()) {
                if (bean instanceof InjectableInterceptor) {
                    interceptors.add((InjectableInterceptor<?>) bean);
                } else if (bean instanceof InjectableDecorator) {
                    decorators.add((InjectableDecorator<?>) bean);
                } else {
                    beans.add(bean);
                    precomputeBeanRawTypes(beansByRawType, bean);
                }
            }
            removedBeans.add(c.getRemovedBeans());
            observers.addAll(c.getObservers());
            interceptorBindings.addAll(c.getInterceptorBindings());
            transitiveInterceptorBindings.putAll(c.getTransitiveInterceptorBindings());
            qualifierNonbindingMembers.putAll(c.getQualifierNonbindingMembers());
            qualifiers.addAll(c.getQualifiers());
        }

        
        addBuiltInBeans(beans, beansByRawType);

        interceptors.sort(Comparator.comparingInt(InjectableInterceptor::getPriority));
        decorators.sort(Comparator.comparingInt(InjectableDecorator::getPriority));

        resolved = new ComputingCache<>(this::resolve);
        beansById = new ComputingCache<>(this::findById);
        beansByName = new ComputingCache<>(this::resolve);
        resourceProviders = new ArrayList<>();
        for (ResourceReferenceProvider resourceProvider : ServiceLoader.load(ResourceReferenceProvider.class)) {
            resourceProviders.add(resourceProvider);
        }
        resourceProviders.trimToSize();

        instance = InstanceImpl.forGlobalEntrypoint(Object.class, Collections.emptySet());

        this.beans = List.copyOf(beans);
        this.beansByRawType = Map.copyOf(beansByRawType);
        
        this.beansByRawType.forEach(new BiConsumer<String, List<InjectableBean<?>>>() {
            @Override
            public void accept(String key, List<InjectableBean<?>> val) {
                if (val.size() > 1) {
                    ((ArrayList<InjectableBean<?>>) val).trimToSize();
                }
            }
        });

        this.interceptors = List.copyOf(interceptors);
        this.decorators = List.copyOf(decorators);
        this.observers = List.copyOf(observers);
        this.removedBeans = new LazyValue<>(new Supplier<List<RemovedBean>>() {
            @Override
            public List<RemovedBean> get() {
                List<RemovedBean> removed = new ArrayList<>();
                for (Supplier<Collection<RemovedBean>> supplier : removedBeans) {
                    removed.addAll(supplier.get());
                }
                LOGGER.debugf("Loaded %s removed beans lazily", removed.size());
                return List.copyOf(removed);
            }
        });
        this.registeredQualifiers = new Qualifiers(qualifiers, qualifierNonbindingMembers);
        this.registeredInterceptorBindings = new InterceptorBindings(interceptorBindings, transitiveInterceptorBindings);

        Contexts.Builder contextsBuilder = new Contexts.Builder(
                new RequestContext(this.currentContextFactory.create(RequestScoped.class),
                        notifierOrNull(Set.of(Initialized.Literal.REQUEST, Any.Literal.INSTANCE)),
                        notifierOrNull(Set.of(BeforeDestroyed.Literal.REQUEST, Any.Literal.INSTANCE)),
                        notifierOrNull(Set.of(Destroyed.Literal.REQUEST, Any.Literal.INSTANCE))),
                new ApplicationContext(),
                new SingletonContext(),
                new DependentContext());

        
        for (Components c : components) {
            for (InjectableContext context : c.getContexts()) {
                if (ApplicationScoped.class.equals(context.getScope())) {
                    throw new IllegalStateException(
                            "Failed to register a context - built-in application context is always active: " + context);
                }
                if (Singleton.class.equals(context.getScope())) {
                    throw new IllegalStateException(
                            "Failed to register a context - built-in singleton context is always active: " + context);
                }
                contextsBuilder.putContext(context);
            }
        }

        this.contexts = contextsBuilder.build();
    }

Line commented on: this.beansByRawType = Map.copyOf(beansByRawType);

Revised code:
public ArcContainerImpl(CurrentContextFactory currentContextFactory, boolean strictMode) {
        this.strictMode = strictMode;
        id = String.valueOf(ID_GENERATOR.incrementAndGet());
        running = new AtomicBoolean(true);
        List<InjectableBean<?>> beans = new ArrayList<>();
        Map<String, List<InjectableBean<?>>> beansByRawType = new HashMap<>();
        List<Supplier<Collection<RemovedBean>>> removedBeans = new ArrayList<>();
        List<InjectableInterceptor<?>> interceptors = new ArrayList<>();
        List<InjectableDecorator<?>> decorators = new ArrayList<>();
        List<InjectableObserverMethod<?>> observers = new ArrayList<>();
        Set<String> interceptorBindings = new HashSet<>();
        Map<Class<? extends Annotation>, Set<Annotation>> transitiveInterceptorBindings = new HashMap<>();
        Map<String, Set<String>> qualifierNonbindingMembers = new HashMap<>();
        Set<String> qualifiers = new HashSet<>();
        this.currentContextFactory = currentContextFactory == null ? new ThreadLocalCurrentContextFactory()
                : currentContextFactory;

        List<Components> components = new ArrayList<>();
        for (ComponentsProvider componentsProvider : ServiceLoader.load(ComponentsProvider.class)) {
            components.add(componentsProvider.getComponents());
        }

        for (Components c : components) {
            for (InjectableBean<?> bean : c.getBeans()) {
                if (bean instanceof InjectableInterceptor) {
                    interceptors.add((InjectableInterceptor<?>) bean);
                } else if (bean instanceof InjectableDecorator) {
                    decorators.add((InjectableDecorator<?>) bean);
                } else {
                    beans.add(bean);
                    precomputeBeanRawTypes(beansByRawType, bean);
                }
            }
            removedBeans.add(c.getRemovedBeans());
            observers.addAll(c.getObservers());
            interceptorBindings.addAll(c.getInterceptorBindings());
            transitiveInterceptorBindings.putAll(c.getTransitiveInterceptorBindings());
            qualifierNonbindingMembers.putAll(c.getQualifierNonbindingMembers());
            qualifiers.addAll(c.getQualifiers());
        }

        
        addBuiltInBeans(beans, beansByRawType);

        interceptors.sort(Comparator.comparingInt(InjectableInterceptor::getPriority));
        decorators.sort(Comparator.comparingInt(InjectableDecorator::getPriority));

        resolved = new ComputingCache<>(this::resolve);
        beansById = new ComputingCache<>(this::findById);
        beansByName = new ComputingCache<>(this::resolve);
        resourceProviders = new ArrayList<>();
        for (ResourceReferenceProvider resourceProvider : ServiceLoader.load(ResourceReferenceProvider.class)) {
            resourceProviders.add(resourceProvider);
        }
        resourceProviders.trimToSize();

        instance = InstanceImpl.forGlobalEntrypoint(Object.class, Collections.emptySet());

        this.beans = List.copyOf(beans);
        this.beansByRawType = Map.copyOf(beansByRawType);
        
        this.beansByRawType.forEach(new BiConsumer<String, List<InjectableBean<?>>>() {
            @Override
            public void accept(String key, List<InjectableBean<?>> val) {
                if (val.size() > 1) {
                    ((ArrayList<InjectableBean<?>>) val).trimToSize();
                }
            }
        });

        this.interceptors = List.copyOf(interceptors);
        this.decorators = List.copyOf(decorators);
        this.observers = List.copyOf(observers);
        this.removedBeans = new LazyValue<>(new Supplier<List<RemovedBean>>() {
            @Override
            public List<RemovedBean> get() {
                List<RemovedBean> removed = new ArrayList<>();
                for (Supplier<Collection<RemovedBean>> supplier : removedBeans) {
                    removed.addAll(supplier.get());
                }
                LOGGER.debugf("Loaded %s removed beans lazily", removed.size());
                return List.copyOf(removed);
            }
        });
        this.registeredQualifiers = new Qualifiers(qualifiers, qualifierNonbindingMembers);
        this.registeredInterceptorBindings = new InterceptorBindings(interceptorBindings, transitiveInterceptorBindings);

        Contexts.Builder contextsBuilder = new Contexts.Builder(
                new RequestContext(this.currentContextFactory.create(RequestScoped.class),
                        notifierOrNull(Set.of(Initialized.Literal.REQUEST, Any.Literal.INSTANCE)),
                        notifierOrNull(Set.of(BeforeDestroyed.Literal.REQUEST, Any.Literal.INSTANCE)),
                        notifierOrNull(Set.of(Destroyed.Literal.REQUEST, Any.Literal.INSTANCE))),
                new ApplicationContext(),
                new SingletonContext(),
                new DependentContext());

        
        for (Components c : components) {
            for (InjectableContext context : c.getContexts()) {
                if (ApplicationScoped.class.equals(context.getScope())) {
                    throw new IllegalStateException(
                            "Failed to register a context - built-in application context is always active: " + context);
                }
                if (Singleton.class.equals(context.getScope())) {
                    throw new IllegalStateException(
                            "Failed to register a context - built-in singleton context is always active: " + context);
                }
                contextsBuilder.putContext(context);
            }
        }

        this.contexts = contextsBuilder.build();
    }