{
  "code": null,
  "collection": "architecture",
  "href": "https://banes-lab.com/ontology#architecture-algorithmic-efficiency",
  "id": "algorithmic-efficiency",
  "kind": "principle",
  "layer": {
    "href": "https://banes-lab.com/ontology/schema#layer-performance-core",
    "json": "https://banes-lab.com/json/records/layer/performance-core",
    "label": "Performance Core",
    "markdown": "https://banes-lab.com/records/layer/performance-core.md",
    "ref": "layer:performance-core"
  },
  "name": "Algorithmic Efficiency",
  "ref": "architecture:algorithmic-efficiency",
  "relations": [
    {
      "links": [
        {
          "href": "https://banes-lab.com/ontology/lexicon#lexicon-complexity-awareness",
          "json": "https://banes-lab.com/json/records/lexicon/complexity-awareness",
          "label": "Complexity Awareness",
          "markdown": "https://banes-lab.com/records/lexicon/complexity-awareness.md",
          "ref": "lexicon:complexity-awareness"
        }
      ],
      "relation": "requires"
    },
    {
      "links": [
        {
          "href": "https://banes-lab.com/ontology#architecture-scalability",
          "json": "https://banes-lab.com/json/records/architecture/scalability",
          "label": "Scalability",
          "markdown": "https://banes-lab.com/records/architecture/scalability.md",
          "ref": "architecture:scalability"
        }
      ],
      "relation": "reinforces"
    },
    {
      "links": [
        {
          "href": "https://banes-lab.com/ontology/lexicon#lexicon-efficient-processing",
          "json": "https://banes-lab.com/json/records/lexicon/efficient-processing",
          "label": "Efficient Processing",
          "markdown": "https://banes-lab.com/records/lexicon/efficient-processing.md",
          "ref": "lexicon:efficient-processing"
        }
      ],
      "relation": "enables"
    },
    {
      "links": [
        {
          "href": "https://banes-lab.com/ontology/lexicon#lexicon-inefficient-algorithm-choice",
          "json": "https://banes-lab.com/json/records/lexicon/inefficient-algorithm-choice",
          "label": "Inefficient Algorithm Choice",
          "markdown": "https://banes-lab.com/records/lexicon/inefficient-algorithm-choice.md",
          "ref": "lexicon:inefficient-algorithm-choice"
        },
        {
          "href": "https://banes-lab.com/ontology#architecture-n-plus-one-query",
          "json": "https://banes-lab.com/json/records/architecture/n-plus-one-query",
          "label": "N Plus One Query",
          "markdown": "https://banes-lab.com/records/architecture/n-plus-one-query.md",
          "ref": "architecture:n-plus-one-query"
        }
      ],
      "relation": "conflicts-with"
    },
    {
      "links": [
        {
          "href": "https://banes-lab.com/ontology/lexicon#lexicon-implementation-simplicity",
          "json": "https://banes-lab.com/json/records/lexicon/implementation-simplicity",
          "label": "Implementation Simplicity",
          "markdown": "https://banes-lab.com/records/lexicon/implementation-simplicity.md",
          "ref": "lexicon:implementation-simplicity"
        }
      ],
      "relation": "tensions-with"
    },
    {
      "links": [
        {
          "href": "https://banes-lab.com/ontology/schema#tension-algorithmic-efficiency-implementation-simplicity",
          "json": "https://banes-lab.com/json/records/tension/algorithmic-efficiency-implementation-simplicity",
          "label": "Algorithmic Efficiency / Implementation Simplicity",
          "markdown": "https://banes-lab.com/records/tension/algorithmic-efficiency-implementation-simplicity.md",
          "ref": "tension:algorithmic-efficiency-implementation-simplicity"
        }
      ],
      "relation": "tensions"
    },
    {
      "links": [
        {
          "href": "https://banes-lab.com/ontology/lexicon#lexicon-inefficient-algorithm-choice",
          "json": "https://banes-lab.com/json/records/lexicon/inefficient-algorithm-choice",
          "label": "Inefficient Algorithm Choice",
          "markdown": "https://banes-lab.com/records/lexicon/inefficient-algorithm-choice.md",
          "ref": "lexicon:inefficient-algorithm-choice"
        }
      ],
      "relation": "violated-by"
    },
    {
      "links": [
        {
          "href": "https://banes-lab.com/ontology/lexicon#lexicon-replace-algorithm",
          "json": "https://banes-lab.com/json/records/lexicon/replace-algorithm",
          "label": "Replace Algorithm",
          "markdown": "https://banes-lab.com/records/lexicon/replace-algorithm.md",
          "ref": "lexicon:replace-algorithm"
        },
        {
          "href": "https://banes-lab.com/ontology/lexicon#lexicon-add-index",
          "json": "https://banes-lab.com/json/records/lexicon/add-index",
          "label": "Add Index",
          "markdown": "https://banes-lab.com/records/lexicon/add-index.md",
          "ref": "lexicon:add-index"
        }
      ],
      "relation": "refactored-by"
    },
    {
      "links": [
        {
          "href": "https://banes-lab.com/ontology/schema#vocabulary-severity-contextual",
          "json": "https://banes-lab.com/json/records/vocabulary/severity-contextual",
          "label": "contextual",
          "markdown": "https://banes-lab.com/records/vocabulary/severity-contextual.md",
          "ref": "vocabulary:severity-contextual"
        }
      ],
      "relation": "severity"
    },
    {
      "links": [
        {
          "href": "https://banes-lab.com/ontology#architecture-category-scalability-performance-optimization",
          "json": "https://banes-lab.com/json/records/architecture-category/scalability-performance-optimization",
          "label": "Scalability / Performance / Optimization",
          "markdown": "https://banes-lab.com/records/architecture-category/scalability-performance-optimization.md",
          "ref": "architecture-category:scalability-performance-optimization"
        }
      ],
      "relation": "category"
    },
    {
      "links": [
        {
          "href": "https://banes-lab.com/anatomy/governance#file-governance-rules-eslint-no-linear-scan-lookup-eslint-rule-ts",
          "json": "https://banes-lab.com/json/source/governance/rules/eslint/no-linear-scan-lookup.eslint.rule.ts",
          "label": "rules/eslint/no-linear-scan-lookup.eslint.rule.ts",
          "markdown": "https://banes-lab.com/source/governance/rules/eslint/no-linear-scan-lookup.eslint.rule.ts.md",
          "ref": "anatomy:file-governance-rules-eslint-no-linear-scan-lookup-eslint-rule-ts"
        }
      ],
      "relation": "enforced-by"
    },
    {
      "links": [
        {
          "href": "https://banes-lab.com/ontology#architecture-time-complexity",
          "json": "https://banes-lab.com/json/records/architecture/time-complexity",
          "label": "Time Complexity",
          "markdown": "https://banes-lab.com/records/architecture/time-complexity.md",
          "ref": "architecture:time-complexity"
        },
        {
          "href": "https://banes-lab.com/ontology#architecture-big-o-notation",
          "json": "https://banes-lab.com/json/records/architecture/big-o-notation",
          "label": "Big O Notation",
          "markdown": "https://banes-lab.com/records/architecture/big-o-notation.md",
          "ref": "architecture:big-o-notation"
        }
      ],
      "relation": "reinforced-by"
    },
    {
      "links": [
        {
          "href": "https://banes-lab.com/ontology#architecture-category-anti-patterns",
          "json": "https://banes-lab.com/json/ontology/principles/architecture-category-anti-patterns",
          "label": "Anti-patterns",
          "markdown": "https://banes-lab.com/ontology/principles/architecture-category-anti-patterns.md",
          "ref": "chapter:/ontology#architecture-category-anti-patterns"
        },
        {
          "href": "https://banes-lab.com/ontology#architecture-category-scalability-performance-optimization",
          "json": "https://banes-lab.com/json/ontology/principles/architecture-category-scalability-performance-optimization",
          "label": "Scalability / Performance / Optimization",
          "markdown": "https://banes-lab.com/ontology/principles/architecture-category-scalability-performance-optimization.md",
          "ref": "chapter:/ontology#architecture-category-scalability-performance-optimization"
        },
        {
          "href": "https://banes-lab.com/ontology/lexicon#lexicon-category-scalability-performance-optimization",
          "json": "https://banes-lab.com/json/ontology/lexicon/lexicon-category-scalability-performance-optimization",
          "label": "Scalability / Performance / Optimization",
          "markdown": "https://banes-lab.com/ontology/lexicon/lexicon-category-scalability-performance-optimization.md",
          "ref": "chapter:/ontology/lexicon#lexicon-category-scalability-performance-optimization"
        },
        {
          "href": "https://banes-lab.com/ontology/schema#the-vocabulary-severity",
          "json": "https://banes-lab.com/json/ontology/schema/the-vocabulary-severity",
          "label": "Severity levels",
          "markdown": "https://banes-lab.com/ontology/schema/the-vocabulary-severity.md",
          "ref": "chapter:/ontology/schema#the-vocabulary-severity"
        },
        {
          "href": "https://banes-lab.com/ontology/schema#the-resolutions",
          "json": "https://banes-lab.com/json/ontology/schema/the-resolutions",
          "label": "The resolutions",
          "markdown": "https://banes-lab.com/ontology/schema/the-resolutions.md",
          "ref": "chapter:/ontology/schema#the-resolutions"
        }
      ],
      "relation": "linked-from"
    }
  ],
  "summary": "A design rule that an algorithm and its data structures are chosen for how their cost grows with input size.",
  "siblings": {
    "next": {
      "href": "https://banes-lab.com/ontology#architecture-time-complexity",
      "json": "https://banes-lab.com/json/records/architecture/time-complexity",
      "label": "Time Complexity",
      "markdown": "https://banes-lab.com/records/architecture/time-complexity.md",
      "ref": "architecture:time-complexity"
    },
    "previous": {
      "href": "https://banes-lab.com/ontology#architecture-performance-engineering",
      "json": "https://banes-lab.com/json/records/architecture/performance-engineering",
      "label": "Performance Engineering",
      "markdown": "https://banes-lab.com/records/architecture/performance-engineering.md",
      "ref": "architecture:performance-engineering"
    }
  },
  "up": {
    "href": null,
    "json": "https://banes-lab.com/json/api/records/architecture",
    "label": "Architecture principles",
    "markdown": "https://banes-lab.com/api/records/architecture.md",
    "ref": "api:records/architecture"
  },
  "aliases": [],
  "exemplar": {
    "after": "function indexFoos(foos: readonly Foo[]) {\n  return new Map(foos.map(foo => [foo.id, foo]));\n}\nconst hasFoo = (index: ReadonlyMap<FooId, Foo>, id: FooId) => index.has(id);",
    "before": "function hasFoo(foos: Foo[], id: FooId) {\n  return foos.some(foo => foo.id === id);\n}",
    "lang": "ts",
    "medium": "code"
  },
  "formedBy": null,
  "scope": [
    "algorithm",
    "data structure"
  ],
  "severity": "contextual"
}
