Large code size caused by vtable initialization in `prepareVTables` function
- 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
Assessment
This issue has not been assessed yet.