Build-tool benchmarks published by vendors use repositories chosen to show a difference. Yours is the only one that matters, and both a cold and a warm measurement are needed because CI mostly runs cold.
Terminal
# cold: no cache, the CI condition
rm -rf node_modules/.cache dist && time <tool> build
# warm: the local development condition
time <tool> build
# and the one people forget: incremental after a one-line change
echo "// touch" >> src/index.ts && time <tool> build
esbuild (Go) is a low-level bundler/transpiler prized for speed. Vite is a higher-level build tool and dev server that uses esbuild for dev transforms and Rollup for production builds, adding HMR, plugins, and framework integration.
In CI?
Most apps want Vite: it gives a complete pipeline (dev server, HMR, plugins, framework presets) and produces optimized Rollup builds while still using esbuild for speed. Reach for esbuild directly when you need a minimal, ultra-fast bundling/transpiling step in a script or tool and do not need a framework-aware build.
Speed it up?
Cache dependencies and the build cache keyed on your lockfile to avoid cold rebuilds. Both run the same on CI runners; faster managed runners shorten the build step on large apps.
Which should I choose?
Building an app or framework project: Vite for the full, optimized pipeline. Need a minimal ultra-fast bundler in a script: esbuild directly. They are different layers - Vite already uses esbuild for you.