Replies: 2 comments
-
I have a similar use case with
I spoke to someone recently who was using elm-pages v2 to generate around 6k pages. They ran into a similar issue with the routes. So I made a couple of performance tweaks. The first was I made https://github.com/kraklin/elm-docset/tree/spike_elm_pages So that change was the difference between about 30 minutes vs. 30 seconds for a full build! Hopefully you'll see a similar benefit, but given it's a pretty large site you may encounter other bottlenecks. Either way, I'd love to hear how it goes. I haven't published those performance improvements yet because it is a non-breaking change, but it requires a major version bump, so I wanted to clean some things up before publishing it to prevent unnecessary major version bumps in the future. You can try out the latest code on the master branch. If you're up for that, I'd love to hear the results and see the numbers before and after. You can change out the npm i -g elm-json
elm-json install avh4/[email protected] danyx23/[email protected] dillonkearns/[email protected] elm/[email protected] elm/[email protected] elm/[email protected] elm/[email protected] elm/[email protected] elm/[email protected] elm/[email protected] elm-community/[email protected] elm-community/[email protected] miniBill/[email protected] noahzgordon/[email protected] tripokey/[email protected] zwilias/[email protected] MartinSStewart/elm-serialize Skinney/murmur3 vito/elm-ansi jfmengels/elm-review elm-community/result-extra (If there are any complaints about other missing dependencies, you can install them with You can add
Then add |
Beta Was this translation helpful? Give feedback.
-
If there are any other bottlenecks you run into, let me know, I would love to experiment based on your feedback if anything else comes up. And feel free to ping me with questions in the |
Beta Was this translation helpful? Give feedback.
-
I am very excited about the
elm-pages
project and am experimenting with it to see how it might work for a larger marketing site.I ran into 2 issues when creating a test spike and am hoping to report + maybe get some advice.
Decoder Mapping
The first issue is in my API's decoders. I have an API which for testing purposes I am the sole creator/consumer. This API has only one endpoint which returns all data for my site. I am using elm-protobuf to generate ELM code. This project produces
Json.Decode
and notOptimizedDecoder
decoders.The
OptimizedDecoder.Decoder
sounds amazing when working with a public API but in this case, no extraneous data is ever expected to be returned. It would be convenient to convert between aJson.Decode.Decoder
and anOptimizedDecoder.Decoder
in this instance.Is that possible?
Performance Bottleneck
The second issue I have is related to performance. As I said, my
DataSource
pulls in JSON for generating 10,000 pages. With that much data, every page takes 2 seconds to generate. The full site would take several hours to build if I let it run. For comparison, when I limit to only 100 results in the JSON the build takes about 10ms per page. I experimented with moving the data toShared.elm
but found I still need to parse all the data forroutes
anyway.Is this a known issue for larger sites?
Is there any way to avoid parsing the data for every page generated? Without 10,000 separate network requests of course.
Here is the page module I am working on for reference.
npx elm-pages add EmployeePay/PublicID_
Beta Was this translation helpful? Give feedback.
All reactions