Deliver web apps with confidence 🚀
Find a file
Kristiyan Kostadinov fb65ad157c perf(platform-server): speed up resolution of base (#61392)
The `getBaseHref` method is called several times per request and currently queries through the entire document. We can speed it up by taking advantage of the fact that the `<base>` can only be a direct child of the `<head>` and is usually defined towards the beginning. Below are some benchmarks for a "Hello world" app before and after this change.

### Before:
```
Running 60s test @ http://localhost:4202
100 connections with 10 pipelining factor

┌─────────┬────────┬────────┬────────┬────────┬───────────┬──────────┬─────────┐
│ Stat    │ 2.5%   │ 50%    │ 97.5%  │ 99%    │ Avg       │ Stdev    │ Max     │
├─────────┼────────┼────────┼────────┼────────┼───────────┼──────────┼─────────┤
│ Latency │ 568 ms │ 853 ms │ 901 ms │ 904 ms │ 866.58 ms │ 437.6 ms │ 9915 ms │
└─────────┴────────┴────────┴────────┴────────┴───────────┴──────────┴─────────┘
┌───────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┐
│ Stat      │ 1%      │ 2.5%    │ 50%     │ 97.5%   │ Avg     │ Stdev   │ Min     │
├───────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┤
│ Req/Sec   │ 490     │ 826     │ 1,006   │ 1,643   │ 1,129.3 │ 234.69  │ 490     │
├───────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┤
│ Bytes/Sec │ 10.4 MB │ 17.4 MB │ 21.3 MB │ 34.7 MB │ 23.9 MB │ 4.96 MB │ 10.3 MB │
└───────────┴─────────┴─────────┴─────────┴─────────┴─────────┴─────────┴─────────┘

Req/Bytes counts sampled once per second.
# of samples: 60

69k requests in 60.04s, 1.43 GB read
90 errors (90 timeouts)
```

### After

```
Running 60s test @ http://localhost:4202
100 connections with 10 pipelining factor

┌─────────┬────────┬────────┬────────┬─────────┬───────────┬───────────┬─────────┐
│ Stat    │ 2.5%   │ 50%    │ 97.5%  │ 99%     │ Avg       │ Stdev     │ Max     │
├─────────┼────────┼────────┼────────┼─────────┼───────────┼───────────┼─────────┤
│ Latency │ 471 ms │ 831 ms │ 889 ms │ 1668 ms │ 835.91 ms │ 467.89 ms │ 9720 ms │
└─────────┴────────┴────────┴────────┴─────────┴───────────┴───────────┴─────────┘
┌───────────┬─────────┬─────────┬─────────┬─────────┬──────────┬────────┬─────────┐
│ Stat      │ 1%      │ 2.5%    │ 50%     │ 97.5%   │ Avg      │ Stdev  │ Min     │
├───────────┼─────────┼─────────┼─────────┼─────────┼──────────┼────────┼─────────┤
│ Req/Sec   │ 390     │ 860     │ 1,145   │ 1,572   │ 1,156.77 │ 222.65 │ 390     │
├───────────┼─────────┼─────────┼─────────┼─────────┼──────────┼────────┼─────────┤
│ Bytes/Sec │ 8.24 MB │ 18.2 MB │ 24.2 MB │ 33.2 MB │ 24.4 MB  │ 4.7 MB │ 8.24 MB │
└───────────┴─────────┴─────────┴─────────┴─────────┴──────────┴────────┴─────────┘

Req/Bytes counts sampled once per second.
# of samples: 60

71k requests in 60.03s, 1.47 GB read
140 errors (140 timeouts)
```

PR Close #61392
2025-05-16 09:03:38 +00:00
.aspect/rules/external_repository_action_cache build: update cross-repo angular dependencies (#61339) 2025-05-16 08:45:13 +00:00
.devcontainer ci: remove circleci as we no longer rely on it (#58615) 2024-11-12 18:39:25 +00:00
.github build: update cross-repo angular dependencies (#61339) 2025-05-16 08:45:13 +00:00
.husky build: simplify husky setup (#54315) 2024-02-07 16:34:13 +00:00
.ng-dev build: migrate adev shared-docs package to use ts_project (#61193) 2025-05-09 16:30:05 +00:00
.vscode build: add ignore revs file for git blame (#60117) 2025-02-26 16:19:25 -05:00
.yarn build: update yarn to 1.22.22 (#58448) 2024-10-31 19:06:16 +01:00
adev docs: update Angular CDK apis (#61395) 2025-05-16 08:30:14 +00:00
contributing-docs docs: mention that log format makes it analyzable for changelog generation. (#58786) 2025-03-04 19:35:54 +00:00
devtools refactor(devtools): fix profiler tree map viz background color (#61330) 2025-05-16 07:43:51 +00:00
goldens refactor(platform-browser): Deprecate the platform-browser-dynamic package (#61043) 2025-05-15 09:48:15 -07:00
integration refactor: replace port 4206 usage with 4209 (#61362) 2025-05-15 10:12:44 -07:00
modules refactor: add explicit types for exports relying on inferred call return type (#61312) 2025-05-13 22:45:18 +00:00
packages perf(platform-server): speed up resolution of base (#61392) 2025-05-16 09:03:38 +00:00
scripts build: add script to diff packages and ensure no unexpected changes (#61275) 2025-05-14 12:01:52 +00:00
third_party build: create NodeJS ESM loader for supporting Bazel setup (#48521) 2022-12-19 19:50:40 +00:00
tools docs: call out the available variables in track expressions (#61252) 2025-05-16 07:51:09 +00:00
.bazelignore build: support new ng_project rule (#61275) 2025-05-14 12:01:51 +00:00
.bazelrc build: setup rules_ts for compiling TypeScript sources (#61087) 2025-05-02 09:12:23 -07:00
.bazelversion build: update to bazel 6 (#61087) 2025-05-02 09:12:23 -07:00
.clang-format feat(tooling): Add a .clang-format for automated JavaScript formatting. 2015-04-02 08:44:34 -07:00
.editorconfig build: use https link to editorconfig.org in .editorconfig (#27664) 2018-12-18 09:30:09 -08:00
.git-blame-ignore-revs build: exclude relative imports commits via .git-blame-ignore-revs (#60680) 2025-04-01 20:18:36 +00:00
.gitattributes build: cleanup .gitattributes file and remove outdated CRLF attribute (#46513) 2022-06-28 13:38:27 -07:00
.gitignore build: correct ignore nested node_modules (#58821) 2024-11-22 14:56:23 +00:00
.gitmessage docs: move commit message guidelies to a separate file (#58786) 2025-03-04 19:35:54 +00:00
.mailmap build: add a Git .mailmap with my new name (#19550) 2017-10-09 14:35:30 -07:00
.npmrc build: do not auto install peer dependencies (#61294) 2025-05-13 08:55:42 +00:00
.nvmrc build: update dependency node to v22.15.1 (#61357) 2025-05-15 10:17:46 -07:00
.prettierignore build: add .prettierignore configuration file (#61087) 2025-05-02 09:12:23 -07:00
.prettierrc build: Update prettierrc to always use trailing commas (#58266) 2024-11-04 18:14:05 +01:00
.pullapprove.yml build: remove irrelevant madge circular deps tests (#61156) 2025-05-07 11:28:59 -07:00
.yarnrc build: update yarn to 1.22.22 (#58448) 2024-10-31 19:06:16 +01:00
browser-providers.conf.d.ts build: share Saucelabs browsers between karma test targets using background Saucelabs daemon and custom karma launcher (#49200) 2023-05-15 09:21:46 -07:00
browser-providers.conf.js refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
BUILD.bazel build: setup rules_js and link dependencies (#61087) 2025-05-02 09:12:23 -07:00
CHANGELOG.md docs: release notes for the v20.0.0-rc.1 release 2025-05-15 09:42:01 -07:00
CHANGELOG_ARCHIVE.md docs: fix typos 2023-06-22 12:56:49 +02:00
CODE_OF_CONDUCT.md build: update CODE_OF_CONDUCT.md to match the content of angular/.github 2023-03-13 21:07:51 +00:00
CONTRIBUTING.md docs: fix commit message guideline link (#60296) 2025-03-11 11:08:23 -07:00
gulpfile.js refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
karma-js.conf.js ci: remove circleci as we no longer rely on it (#58615) 2024-11-12 18:39:25 +00:00
LICENSE docs: update copyright year (#59359) 2025-01-06 19:58:30 +00:00
package.json build: update cross-repo angular dependencies (#61339) 2025-05-16 08:45:13 +00:00
packages.bzl refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
pnpm-lock.yaml build: update cross-repo angular dependencies (#61339) 2025-05-16 08:45:13 +00:00
pnpm-workspace.yaml build: support new ng_project rule (#61275) 2025-05-14 12:01:51 +00:00
README.md docs: delete discord badge from README file (#61308) 2025-05-14 09:24:38 -07:00
renovate.json ci: disable updates for @angular/build-tooling (#61294) 2025-05-13 08:55:42 +00:00
SECURITY.md docs: update security guide link to adev (#56469) 2024-06-17 08:54:08 -07:00
tsconfig-tslint.json build: update tslint configuration (#61146) 2025-05-06 13:35:24 -07:00
tslint.json refactor: add explicit types for exports relying on inferred call return type (#61312) 2025-05-13 22:45:18 +00:00
WORKSPACE build: update cross-repo angular dependencies (#61339) 2025-05-16 08:45:13 +00:00
yarn.bzl build: update yarn to 1.22.22 (#58448) 2024-10-31 19:06:16 +01:00
yarn.lock build: update cross-repo angular dependencies (#61339) 2025-05-16 08:45:13 +00:00

Angular - The modern web developer's platform

angular-logo
Angular is a development platform for building mobile and desktop web applications
using TypeScript/JavaScript and other languages.

angular.dev

Contributing Guidelines · Submit an Issue · Blog

Angular on npm


Documentation

Get started with Angular, learn the fundamentals and explore advanced topics on our documentation website.

Advanced

Local Development

To contribute to the Angular Docs, check out the Angular.dev README

Development Setup

Prerequisites

Setting Up a Project

Install the Angular CLI globally:

npm install -g @angular/cli

Create workspace:

ng new [PROJECT NAME]

Run the application:

cd [PROJECT NAME]
ng serve

Angular is cross-platform, fast, scalable, has incredible tooling, and is loved by millions.

Quickstart

Get started in 5 minutes.

Ecosystem

angular ecosystem logos

Changelog

Learn about the latest improvements.

Upgrading

Check out our upgrade guide to find out the best way to upgrade your project.

Contributing

Contributing Guidelines

Read through our contributing guidelines to learn about our submission process, coding rules, and more.

Want to Help?

Want to report a bug, contribute some code, or improve the documentation? Excellent! Read up on our guidelines for contributing and then check out one of our issues labeled as help wanted or good first issue.

Code of Conduct

Help us keep Angular open and inclusive. Please read and follow our Code of Conduct.

Community

Join the conversation and help the community.

Love Angular badge

Love Angular? Give our repo a star ⬆️.