# US 2022/0291907 A1 · Compiling monoglot function compositions into a single entity

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2022/0291907 A1
- Document ID: US20220291907A1
- Status: Published application
- Kind: A1
- Application number: 17/831,281
- Filed: 2022-06-02
- Published: 2022-09-15
- Earliest claimed: 2020-05-28
- Assignees: Red Hat, Inc.
- Applicants: Red Hat, Inc.
- Inventors: Markus Thoemmes
- Web page: https://patentgrep.com/patent/US20220291907A1

## CPC

- G06F 8/433: {Dependency analysis; Data or control flow analysis}
- G06F 8/4443: {Inlining}
- G06F 8/427: {Parsing}
- G06F 9/547: {Remote procedure calls [RPC]; Web services}
- G06Q 10/0631: Resource planning, allocation, distributing or scheduling for enterprises or organisations
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- G06Q: INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR

## Abstract

Systems and methods for compiling functions into a single entity are disclosed. An execution graph representing dependencies between a plurality of functions is analyzed to identify portions of the graph that include two or more of the plurality of functions used as a combined entity and have a single entry point. The plurality of functions corresponds to a decomposed application. The processing device combines the functions of each of the identified one or more portions of the graph into a composition. For each portion of the graph that includes two or more of the plurality of functions used as a combined entity and has multiple entry points, the processing device determines whether to combine each function providing a subsequent entry point to the portion into a composition with other functions of the portion based at least in part on a network latency and a scale efficiency of the application.

## Claims

### Claim 1

A method comprising:
analyzing an execution graph representing dependencies between a plurality of functions to identify one or more portions of the graph that each include two or more of the plurality of functions used as a combined entity and have a single entry point, wherein the plurality of functions corresponds to a decomposed application;
combining the functions of each of the identified one or more portions of the graph into a composition; and
for each portion of the graph that includes two or more of the plurality of functions used as a combined entity and has multiple entry points, determining, by a processing device, whether to combine each function providing a subsequent entry point to the portion into a composition with one or more functions of the portion based at least in part on a network latency and a scale efficiency of the application, wherein each composition is executed by a single runtime.

### Claim 2 (depends on 1)

The method of claim 1, wherein each function providing a subsequent entry point to the portion depends on one or more of the plurality of functions that are outside the portion.

### Claim 3 (depends on 2)

The method of claim 2, wherein determining whether to combine a function providing a subsequent entry point to the portion comprises:
determining a benefit to network latency and a decrease in scale efficiency of the application resulting from combining the function into a separate composition with each function that the function depends on; and
determining whether to combine the function based on the benefit to network latency relative to the decrease in scale efficiency of the application.

### Claim 4 (depends on 3)

The method of claim 3, wherein determining whether to combine the function is further based in part on a user input indicating prioritization of network latency or scale efficiency of the application.

### Claim 5 (depends on 3)

The method of claim 3, wherein determining whether to combine the function is further based in part on a stability of the function.

### Claim 6 (depends on 1)

The method of claim 1, wherein combining two or more functions into a composition comprises:
combining the code of each of the two or more functions so that they are called sequentially; and
including the combined code in a runtime, wherein the runtime is unaware that the two or more functions have been combined.

### Claim 7 (depends on 1)

The method of claim 1, wherein each of the plurality of functions is written in the same language.

### Claim 8

A system comprising:
a memory to store an execution graph representing dependencies between a plurality of functions, wherein the plurality of functions corresponds to a decomposed application; and
a processing device operatively coupled to the memory, the processing device to:
analyze the execution graph to identify one or more sequences, each of the one or more sequences comprising two or more of the plurality of functions that form a dependency chain; and
for each of the identified one or more sequences:
combine each group of functions that is sequentially dependent and has no functions that are reused by other sequences, into a composition; and
for each function that is reused by other sequences, determine whether to combine the function into a composition with one or more functions of the sequence based at least in part on a network latency and a scale efficiency of the application, wherein each composition is executed by a single runtime.

### Claim 9 (depends on 8)

The system of claim 8, wherein the one or more functions of the sequence comprise an existing composition.

### Claim 10 (depends on 8)

The system of claim 8, wherein to determine whether to combine a function that is reused, the processing device is to:
determine a benefit to network latency and a decrease in scale efficiency of the application resulting from combining the function that is reused into a separate composition in each sequence that the function is reused by; and
determine whether to combine the function that is reused based at least in part on the benefit to network latency relative to the decrease in scale efficiency of the application.

### Claim 11 (depends on 10)

The system of claim 10, wherein the processing device determines whether to combine the function that is reused based further in part on a user input indicating prioritization of network latency or scale efficiency of the application.

### Claim 12 (depends on 10)

The system of claim 10, wherein the processing device determines whether to combine the function that is reused based further in part on a stability of the function.

### Claim 13 (depends on 8)

The system of claim 8, wherein to combine two or more functions into a composition, the processing device is to:
combine the code of each of the two or more functions so that they are called sequentially; and
include the combined code in a runtime, wherein the runtime is unaware that the two or more functions have been combined.

### Claim 14 (depends on 8)

The system of claim 8, wherein the plurality of functions are all written in the same language.

### Claim 15

A non-transitory computer readable medium, having instructions stored thereon which, when executed by a processing device, cause the processing device to:
analyze an execution graph representing dependencies between a plurality of functions to identify one or more sequences, each of the one or more sequences comprising two or more of the plurality of functions that form a dependency chain, wherein the plurality of functions corresponds to a decomposed application; and
for each of the identified one or more sequences:
combine each group of functions that is sequentially dependent and has no functions that are reused by other sequences, into a composition; and
for each function that is reused by other sequences, determine, by a processing device, whether to combine the function into a composition with one or more functions of the sequence based at least in part on a network latency and a scale efficiency of the application, wherein each composition is executed by a single runtime.

### Claim 16 (depends on 15)

The non-transitory computer readable medium of claim 15, wherein the one or more functions of the sequence comprise an existing composition.

### Claim 17 (depends on 15)

The non-transitory computer readable medium of claim 15, wherein to determine whether to combine a function that is reused, the processing device is to:
determine a benefit to network latency and a decrease in scale efficiency of the application resulting from combining the function that is reused into a separate composition in each sequence that the function is reused by; and
determine whether to combine the function that is reused based at least in part on the benefit to network latency relative to the decrease in scale efficiency of the application.

### Claim 18 (depends on 17)

The non-transitory computer readable medium of claim 17, wherein the processing device determines whether to combine the function that is reused based further in part on a user input indicating prioritization of network latency or scale efficiency of the application.

### Claim 19 (depends on 17)

The non-transitory computer readable medium of claim 17, wherein the processing device determines whether to combine the function that is reused based further in part on a stability of the function.

### Claim 20 (depends on 15)

The non-transitory computer readable medium of claim 15, wherein to combine two or more functions into a composition, the processing device is to:
combine the code of each of the two or more functions so that they are called sequentially; and
include the combined code in a runtime, wherein the runtime is unaware that the two or more functions have been combined.
