# Compilation time vs. C++

**URL:** <https://fortran-lang.discourse.group/t/compilation-time-vs-c/2430>\
**Category:** Help\
**Created:** [December 21, 2021, 12:35am UTC](https://fortran-lang.discourse.group/t/compilation-time-vs-c/2430 "2021-12-21T00:35:44Z")\
**Posts on this page:** 3\
**Page:** 2

<div class="post-metadata">

**Author:** ![martin](https://avatars.discourse-cdn.com/v4/letter/m/73ab20/32.png) [@martin](https://fortran-lang.discourse.group/u/martin)\
**Post date:** [January 3, 2022, 9:49am UTC](https://fortran-lang.discourse.group/t/compilation-time-vs-c/2430/21 "2022-01-03T09:49:36Z")

</div>

> [@plevold](#):
>
> …  
> Could something like the code below work for you in this case? It’s a bit of ceremony, but this approach completely hides the implementation details from the module with the interface specification. The downside is that you _have_ to rely on polymorphism, but if you’re already using that it might no be such a big deal.  
> …

Thanks for the suggestion, I have thought along these lines as well. That is much boiler plate code and indirections for little gain. With current tooling navigating OOP code is already a challenge sometimes, even if it is kept simple with small and shallow class hierarchies.

On a side node, a few years ago, somebody suggested a two-pass compile step for gfortran. First pass creates mod files and needs to respect dependencies. Second pass really compiles the code and can be done fully parallel. However, with my profiling numbers of gfortran in mind, this might not be that fast, as compiling and code generation was the smaller part in larger projects. Handling the huge symbol tables was what killed the performance, and that would be not much different with such a two-pass approach.

---

<div class="post-metadata">

**Author:** ![certik](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/certik/32/4_2.png) [@certik](https://fortran-lang.discourse.group/u/certik)\
**Post date:** [January 3, 2022, 3:02pm UTC](https://fortran-lang.discourse.group/t/compilation-time-vs-c/2430/22 "2022-01-03T15:02:17Z")

</div>

The speed of compilation is essential in my opinion and I have spent a lot of time designing LFortran to be as fast as possible. Things that LFortran can already compile are very encouraging (from the speed of compilation perspective), but we have to see once we bring it from alpha to beta, then we can try it on real codes.

---

<div class="post-metadata">

**Author:** ![CRquantum](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/crquantum/32/730_2.png) [@CRquantum](https://fortran-lang.discourse.group/u/CRquantum)\
**Post date:** [January 10, 2022, 10:22pm UTC](https://fortran-lang.discourse.group/t/compilation-time-vs-c/2430/23 "2022-01-10T22:22:58Z")

</div>

For Fortran, it seems usually the compilation is fast enough. The slow down stuff is in linking.

[Previous page](https://fortran-lang.discourse.group/t/compilation-time-vs-c/2430.md?page=1)
