# Single module vs. submodules in a project

**URL:** <https://discourse.julialang.org/t/single-module-vs-submodules-in-a-project/55361>\
**Category:** New to Julia\
**Tags:** performance, modules, code-organization\
**Created:** [February 15, 2021, 11:23pm UTC](https://discourse.julialang.org/t/single-module-vs-submodules-in-a-project/55361 "2021-02-15T23:23:33Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [February 16, 2021, 3:05pm UTC](https://discourse.julialang.org/t/single-module-vs-submodules-in-a-project/55361/2 "2021-02-16T15:05:13Z")

</div>

> [@erans](#):
>
> how to “correctly”, or better yet idiomatically, structure code in Julia

You may not need to worry about this unless your codebase is relatively large. Up to 5–10 kLOC (and that’s a _lot_ of code in Julia), a single module/package often works fine.

> [@erans](#):
>
> wouldn’t breaking code into submodules help in terms of precompilation?

I am not sure if there is anything that should have this effect. If compilation time is a concern, just investigate and fix that directly. These excellent blog posts are a good starting point:

> **[Analyzing sources of compiler latency in Julia: method invalidations](https://julialang.org/blog/2020/08/invalidations/)**
>
> Julia runs fast, but suffers from latency due to compilation. This post analyzes one source of excess compilation, tools for detecting and eliminating its causes, and the impact this effort has had on latency.

> **[Tutorial on precompilation](https://julialang.org/blog/2021/01/precompile_tutorial/)**
>
> Tutorial on precompilation

> **[Profiling type-inference](https://julialang.org/blog/2021/01/snoopi_deep/)**
>
> Profiling type-inference

---

_[View the full topic](https://discourse.julialang.org/t/single-module-vs-submodules-in-a-project/55361)._
