cjk

cjk

Hi there,

I am currently working on a Forum/community system in Elixir using Phoenix. First everything was nice, but slowly the compile times increased. It got so bad that now small changes can take up to 30 seconds.

I already read about compile dependencies and stuff, but I can’t really make sense of tools like mix xref. The generated graphic is unusable (image viewers seem not to be able to show the image) and the tree/stats views are confusing to me.

I already tried to fight this problem by stripping out imports and requires, and it made things better – but by far not good.

Can somebody point me to resources explaining how to use tools like mix xref or explain me what I am doing wrong?

My project is a FLOSS and hosted on Github: https://github.com/ckruse/cforum_ex/

Edit: also please don’t mince matters. If you think I am using anti patterns and thus causing this problem myself, tell me. I can handle that and love to learn.

Thanks in advance,
CK

Showing Posts 1 to 10

hlx

hlx

Did you try deleting the _build folder? Whenever I have the slightest problem I always first delete _build, deps and .elixir_ls

cjk

cjk OP

Yes, did that. Doesn’t change anything.

kwando

kwando

I get this while trying to run build it:

➜  cforum_ex git:(master) mix deps.get
** (Code.LoadError) could not load /Users/kwando/projects/cforum_ex/config/appsignal.exs
    (elixir) lib/code.ex:1192: Code.find_file/2
    (elixir) lib/code.ex:758: Code.eval_file/2
    (mix) lib/mix/config.ex:158: anonymous fn/2 in Mix.Config.__import__!/2
    (elixir) lib/enum.ex:1948: Enum."-reduce/3-lists^foldl/2-0-"/3
    (mix) lib/mix/config.ex:157: Mix.Config.__import__!/2
    (stdlib) erl_eval.erl:680: :erl_eval.do_apply/6
    (elixir) lib/code.ex:240: Code.eval_string/3
hlx

hlx

Just run touch config/appsignal.exs

cjk

cjk OP

Ah, right - you have to create a appsignal.exs, this file contains secrets and thus is not in the repo. A simple use Mix.Config in this file should be enough.

hlx

hlx

I’ve cloned your app and it seems to compile at the same speed as my own projects

https://asciinema.org/a/2N1DeYHwWBbrXbJxlM9hJRTca

cjk

cjk OP

And now change e.g. lib/cforum_web/layout/app.html.eex and watch getting a whole bunch of files recompiled :slight_smile:

hlx

hlx

Elixir files or assets? I can’t seem to run the migrations and therefor not the app so I can’t really check.

cjk

cjk OP

No, assets are in the webpack domain. Elixir files (.ex or .eex).

You can check w/o running the migrations by using mix compile without calling mix clean before.

hlx

hlx

➜  cforum_ex git:(master) ✗ mix ecto.create
The database for Cforum.Repo has already been created
➜  cforum_ex git:(master) ✗ mix ecto.migrate

21:31:50.913 [info]  == Running 20181023062557 Cforum.Repo.Migrations.MakeTagsGlobal.change/0 forward

21:31:50.915 [info]  alter table tags
** (Postgrex.Error) ERROR 42P01 (undefined_table) relation "tags" does not exist

EDIT: didn’t read the previous message correctly, will check now with mix compile

Where Next? Top

Trending in Questions Top

RSP87
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
nseaSeb
Hello, I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
RemyXRenard
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
velrest
So my question is quite simple and i have found no conclusive answer on forum, google or AI. Should we use :erlang.float for Integer to ...
New
samoloth
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
FlyingNoodle
If a change or preparation module uses Ash.Changeset.get_argument/2 or Ash.Query.get_argument/2 (or any of the other get_argument functio...
New
brecabral
Documentation While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New

Other Trending Topics Top

mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Dmk
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
webofbits
Aludel - LLM Evaluation Workbench Aludel is an embeddable Phoenix LiveView dashboard for evaluating and comparing LLM prompts across mult...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews