exaloop / exaloop/codon

Large code size caused by vtable initialization in `prepareVTables` function

Open
#202 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
16.8k
Forks
603
Avg merge
4d 23h
Merged PRs (30d)
6

Description

The generated `vtable` initialization code in the [prepareVTables](https://github.com/exaloop/codon/blob/ab7387b66a7be8b1cedafc6aec10b0b402d769ff/codon/parser/visitors/typecheck/infer.cpp#L380) function is quite significant and result in increased code size and increased initialization time.

By performing a simple test, the value of `classRealizationCnt` can be increased to 1487, resulting in a significant increase in the time required for `vtable` initialization and leading to a considerable increase in code size.

Moreover, the `vtable` initialization code could prevent the optimization of some `thunk` functions that are not being used, further exacerbating the issue.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.