DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run Scan×
Skip to content
World desk4 min

Does `httpResource` Cost Bundle Size? Angular API Generator Benchmark

A single Angular 22 production-build benchmark found +6.1 kB gzip for bare httpResource over HttpClient, with generator and import choices also affecting growth.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

In one Angular 22 production-build benchmark, a bare httpResource call added 6.1 kB of gzipped main.js over a plain HttpClient baseline. That is a result from one configuration, not a fixed cost for every Angular app. The same test found that generator choice and import style could change bundle growth substantially.

What the benchmark measured

Konstantin’s comparison used the YouTube Data API v3 OpenAPI specification, described as containing 76 endpoints. The test generated clients for a minimal Angular 22 app, built with Angular’s production esbuild application builder, and measured gzipped production main.js size. It compared builds exercising either one or eight endpoints. The plain HttpClient control was 38.4 kB gzip; each number below is additional gzip size over that baseline, not the total bundle size.

The author reports the benchmark command as npm run bench. See the benchmark article for the setup and reported results.

Variant One endpoint: growth over baseline Eight endpoints: growth over baseline
Bare httpResource, no generator +6.1 kB gzip +6.1 kB gzip
openapi-resource-gen, httpResource +7.1 kB gzip +7.2 kB gzip
openapi-resource-gen, HttpClient +0.9 kB gzip +1.0 kB gzip
Orval 8, Angular client, tags-split services +0.3 kB gzip +1.2 kB gzip
ng-openapi-gen 1.1, deep imports +1.9 kB gzip +2.3 kB gzip
ng-openapi-gen 1.1, functions barrel +7.0 kB gzip +7.0 kB gzip
Hey API client-angular +3.5 kB gzip +3.5 kB gzip

These are the author’s measurements for that app, builder, generated code, and gzip output. They are not runtime measurements, nor do they establish the size of every emitted asset. The comparison did not test Orval’s httpResource mode.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What the results say about httpResource

The measured increment was in the bare API control

The benchmark’s bare httpResource build was 6.1 kB gzip larger than its plain HttpClient control, whether one or eight endpoints were exercised. In the author’s own generator, the httpResource variant added 7.1–7.2 kB, while its HttpClient variant added 0.9–1.0 kB. The first pair is consistent with the bare API result plus roughly 1 kB of generated-code growth in this setup; it does not show that every generator or app will have that relationship.

Generated output and imports can matter as much as the API choice

Endpoint count alone did not predict the measured result. The author reports that the ng-openapi-gen functions barrel retained considerably more code than deep imports. Their explanation is that a side-effecting assignment, fn.PATH = '…', prevented unused functions from being removed when imported through the barrel in this test. Orval’s tags-split services were especially small for one exercised endpoint, while the eight-endpoint case had greater growth; service granularity can make the retained amount track touched tags rather than individual operations.

These are explanations of the benchmark’s observed output, not universal guarantees about tree shaking. Generated code, import paths, bundler behavior, and what the application actually references all affect what remains in a production bundle.

Why Angular offers httpResource

Angular documents httpResource as a reactive wrapper around HttpClient, exposing request status and response through signals. Unlike a standard HttpClient Observable request, which starts when subscribed to, httpResource initiates its request eagerly. If a signal used to form the request changes, it issues another request and cancels a still-pending previous one. It also supports HttpClient features such as interceptors and testing. See Angular’s reactive data fetching guide and API reference.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The default response parsing is JSON. Angular documents .text(), .blob(), and .arrayBuffer() subconstructors, as well as a parse callback for validating or transforming a response. Options include defaultValue, injector, equal, and debugName; their meanings are specified in the HttpResourceOptions API. Angular advises using HttpClient APIs for mutations such as POST or PUT rather than httpResource. The API reference labels httpResource stable since Angular v22.0, so confirm the API status for the Angular version in your project.

How to use the result for your application

Treat the table as a reason to measure, not as a size forecast. The article describes one OpenAPI specification and minimal app, a single production builder, and gzip-only bundle growth. A different Angular or generator version, import pattern, set of used operations, builder, or compression method can produce a different result. The figures do not establish request latency, memory use, build speed, or runtime performance.

  1. Set the comparison target. Use your project’s Angular version, production builder, generated client version, and the operations your app actually imports and uses. Compare the same application with a plain HttpClient control and with the httpResource or generator variant you are considering.
  2. Hold the build and metric constant. Build each variant under the same production configuration and compare the same output measure, such as gzipped main.js. Do not compare one build’s gzip size with another build’s uncompressed total or all-assets size.
  3. Check the imports and generated output. If a generator offers deep imports and barrel imports, measure the form your code uses. Look for side effects or service organization that may retain code beyond the operations you intended to include.
  4. Repeat for realistic usage. Compare both a small and representative set of used endpoints or services. A single-operation result can miss growth caused by service or tag boundaries.
  5. Record versions and configuration with the result. Bundle output can change as Angular, generators, or build tooling change. The benchmark article identifies npm run bench as its reproduction command; verify its current script and dependencies before using it as a direct comparison for another project.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Choosing between HttpClient and httpResource

If the principal decision is bundle size, the benchmark favors its plain HttpClient control over its bare httpResource control for this particular production build. That does not settle the broader API choice: httpResource supplies signal-oriented reactive reads and eager request behavior, while HttpClient provides the underlying Observable API Angular recommends for mutations. Choose based on the application’s data-flow needs, then measure the production bundle with the exact generated code and imports the app will ship.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Leave a Reply

Your email address will not be published. Required fields are marked *

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. Shenzhen desk3 min
    HONOR Expands Beyond Smartphones With Humanoid Robot RevealHONOR said it unveiled its first humanoid robot at MWC 2026 and named shopping assistance, workplace inspections, and supportive companionship as intended uses. Later Robotics D1 claims and a reported…
  2. Cupertino desk5 min
    Apple Unveils AirPods Max 2: The Upgrade That Should Have Happened Years AgoAirPods Max 2 adds H2-powered audio features and Apple claims up to 1.5× more effective ANC, but its design, Smart Case, and 20-hour battery rating are unchanged. Wired lossless audio…
  3. Cupertino desk4 min
    Apple’s OLED Touch MacBooks Are Coming—but the Dynamic Island Is the Real GambleApple has not announced an OLED touchscreen MacBook, but reports point to high-end models arriving in late 2026 or early 2027. The reported Mac Dynamic Island could be useful, but…
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.