D
Deno

help

Slow loading time on localhost

OOoker1/8/2024
As discussed in https://discord.com/channels/684898665143206084/991511118524715139/1193585623710310473, my simple app is loading slow, even at localhost. Here the page takes a whole minute to finish. What make an app load slow? How can I identify which process consume how much time?
Discord
Discord - A New Way to Chat with Friends & Communities
Discord is the easiest way to communicate over voice, video, and text. Chat, hang out, and stay close with your friends and communities.
No description
DAHDeno AI Helper1/8/2024
I wasn't able to find the answer to your question in the official Deno documentation. However, based on your message, there are a few general tips I can provide that might help you identify the cause of the slow loading time. 1. Check for Network Issues: Even though you're running on localhost, network configuration or firewall software could potentially cause delays. 2. Inspect Your Code for Performance Bottlenecks: Look for any loops or recursive functions that could be running more times than necessary, or any heavy computations that could be optimized. 3. Use Profiling Tools: Deno has built-in tooling for profiling, such as deno profile, which can help you identify which parts of your code are consuming the most time. 4. Check for External Resource Loading: If your app is loading external resources, such as databases, APIs, or large files, these could be the source of the delay. 5. Console Timing Functions: You can use console.time() and console.timeEnd() to measure the time it takes for certain parts of your code to execute. 6. Review Middleware or Frameworks: If you're using any middleware or frameworks with Deno, ensure they are not causing the slowdown. Please note that this advice is not based on the Deno documentation, and I would advise you to double-check the accuracy of the advice given. If you continue to experience issues, you might want to consider reaching out to the Deno community for more specific guidance.
Mmarvinh.1/8/2024
That seems unreasonably slow. If you open the task manager and check the overall memory and cpu usage of your system. Could it be that another process unrelated to deno/fresh is consuming all system resources? If that's not the case, another thing to try is to profile the server code to see where CPU time is spent. This can be done by running a modified version of the start task: 1. Run deno run --inspect-brk -A --watch=static/,routes/ dev.ts 2. Open Chrome 3. Go to chrome://inspect (it's an internal chrome website) 4. Wait until an entry with "Deno" in the name appears, should happen after a few seconds and click "inspect". This opens an instance of Chrome Devtools attached to the deno process 5. In the Devtools go to the performance tab and press the record button 6. Go to your site as usual and refresh it 7. Stop the performance recording and check where time is spent
OOoker1/8/2024
I use firefox. In my understanding Firefox's about:debugging is equivalent to Chrome's chrome://inspect. I run the command but don't see any entry named Deno appears
No description
OOoker1/8/2024
is it that it should be in the service workers category? the problem doesn't happen in my phone. I restart Firefox in troubleshoot mode to disable all plugins and scripts and the loading is normal again. So I get that I can disable them one-by-one until the troublesome plugin is isolated however, just for the sake of broaden my knowledge, do you know why the Firefox debugger is unable to detect Deno?
Mmarvinh.1/8/2024
No that's incorrect. Deno is built around v8 the JS engine used in Chrome. Firefox uses a different JS engine called gecko and thus has a different debug API. They are not equivalent. Only Chrome can attach a debugger to a v8 and by extension a deno process.
OOoker1/8/2024
that's what I have known but now it's more interesting than when I first knew it. Is there any article on why Ryan chose V8 and not Gecko? Node's legacy?
Mmarvinh.1/8/2024
at the time and to this day v8 is the most advanced and feature packed JS engine out there. It also works on all major OSes the question is rather why wouldn't you pick v8?
OOoker1/8/2024
support Firefox as it seems to be the last representation for browser diversity, and the inertia for migration. The browser war is not effecting me much
Mmarvinh.1/8/2024
As much as I love firefox (use it as my main driver myself at home) I think it's easy to underestimate the effort required to go down that route. It's easy to say "just do XY", but we're talking about a significant amount of money here. Picking a JS engine that you're not familiar with, has way less backing then the one you are already familiar with, is a super risky bet when your building a company around it.
OOoker1/8/2024
I'm not sure what you are referring at when you say "just do XY" and the engine that I'm not familiar with. Are both referring to firefox?
Mmarvinh.1/8/2024
you suggested that picking Firefox's engine for Deno would be a viable option my message refers to that
OOoker1/8/2024
ah I see you mean Ryan also was not familiar with gecko?
Mmarvinh.1/8/2024
well Ryan created node, so he obviously was way more familiar with v8 compared to gecko
OOoker1/8/2024
I see. Thanks for your time

Looking for more? Join the community!

Recommended Posts
How to set env variable for preview branch?I'm getting just errors that they are missingPrisma error when trying to push/migrate db```bash PS C:\Users\adubo\Desktop\freshchat> deno task push Task push deno run -A npm:prisma@latest Does the deno-astro-adapter will be updated to use astro 4? https://github.com/denoland/deno-astro-aDoes the deno-astro-adapter will be updated to use astro 4? https://github.com/denoland/deno-astro-a(In IntelliJ) Deno: Failed to load the import map at <absolute_path> (...)I just started working with Deno today, and I'm liking it quite a bit so far 🙂 rn I'm running into serde_v8::from_v8 for BigInts unsupported through `deserialize_any`Deserializing BigInts is currently not supported unless a specific type is requested (e.g. it's unsuimport plotly.js : invalid or unexpected token ?`import Plotly from "npm:plotly.js-dist";` yields Stack trace: SyntaxError: Invalid or unexpected tDeno deploy: "Error The deployment failed: ISOLATE_INTERNAL_FAILURE"what's this error? ```js Cloning repository (100%) Project linked successfully. Building first deploModule documentation preview in developmentI am trying to improve development experience when documenting Deno modules. What I would like to acFresh project creation hangingUpgraded deno to 1.39.2 this morning and tried to create a new fresh project. CLI just hangs after eRedirect which deno deploy instance is used?My scenario is that I have one websocket connection on east4 and one on east5 and they need to be abstd/http/setCookie doesn't work?It seems to only support single cookies: ```ts import * as cookies from "https://deno.land/std@0.21Abort signals and node compatibilityDeno and Node's `AbortSignal` types are not compatible. I have verified that I can use a deno Abortdeployctl error: TypeError: request or response body errorHey, I'm getting an error when trying to deploy to a project error: TypeError: request or response bdrizzle orm for deno and sqlite?does drizzle orm work with sqlite and deno?deno queues on deployDoes anyone have a simple example if deno queues + routing that works on demo deploycompile to target, 'unzip' not found.I am on linux ubuntu 22 I downloaded, uninstalled reinstalled, written to path unzip. however no matRecommendations for interacting with Excel sheets (.xlsx) and GraphQL?I want to use Deno in production. Specifically, I'm looking into building a script that reads a `.xlTrouble with Deno importsWhat's wrong with my import? The link is valid and I cached it. (https://deno.land/x/deno_dom@v0.1.How to format on save with devcontainerI'd like to automatically format my code when saving, but it's not working. devcontainer.json ```jsHow does form submission work?I'm following the tutorial: https://fresh.deno.dev/docs/getting-started/form-submissions It says: >