Hello World taking 30 seconds + to run
Honestly baffled as to how this is possible. I'm running an ubuntu docker container locally on my m1 mac. I am installing dotnet in my dockerfile with the dotnet-install script like so:
When I go to run hello world, I copy the hello world c# file into the project and run it like so:
It may be worth noting that because I'm using jupyterhub to spin up docker containers on demand, the first time I try to run the hello world I get a whole "welcome to C#" spiel and it takes over a minute. However, on all subsequent runs (with the docker container ready) it doesn't do that but it still takes usually around 30-40 seconds at least.
Am I missing something? How on earth could it be this slow?
29 Replies
dotnet run
doesn't just execute your programis there a better way to just execute it? i saw script but that seems to be for single files only
./MyProgram 🤔
that's only if it's already built, no? i need to build it on demand each time
what are you trying to do exactly ?
and besides, when googling for stuff like this i saw people complaining about slow load speeds - and they were talking like 3 seconds (for run) specifically. this seems like something is really messed up
to be exact on what im trying to do:
an ide that runs c# programs in the browser
using websockets to communicate with the docker container running on server that can run the code on demand
the infrastructure is there for other languages so its just a question of getting the c# to be performant
im not sure if its a local thing due to some weird interaction with m1 chips or something because it was hard enough even getting c# to install without segfaulting
thats why i had to use version 6.0
getting c# without segfault ? O_o
.net*
what ever wtf ?
the .net install script segfaults when trying to install
btw just use a dotnet sdk image
its a known issue
GitHub
Segmentation fault building project on dotnet/sdk:7.0 image with Ap...
Describe the Bug Running into a problem where creating a docker image from mcr.microsoft.com/dotnet/sdk:7.0 on an M1 Apple MacBook Pro throws a segmentation fault from package qemu during publish. ...
it's not installing .NET
right yeah mb not the install script the setup of the project afterwards
they say publish 🤔
you don't have to publish anything
i mean i didnt publish anything and it still segfaulted lol
im not making this up?
clearly theres an issue with dotnet and m1s regardless of whether my issue is EXACTLY the same as theirs
at the end they say that it's a QEMU error
and give this link to read more on how to use without QEMU
https://devblogs.microsoft.com/dotnet/improving-multiplatform-container-support/
well like i said i avoided the segfault by setting the version back - unless you think this might also be causing the slow performance?
docker is running through as linux VM
I don't think that's the best way to have performance has no native support for docker (cause it's an Unix OS )
i wonder if i just need to test it on our actual live servers because it seems like it might just be an environment issue
install dotnet on your mac and test it ? 🤔
well then id lose the whole point of the test which is making sure it works on our docker containers which run the servers
install virtualbox and setup everything in a whatever distrib you will use ?
Is this to run adhoc code from a website?
Mayor McCheese
REPL Result: Success
Console Output
Compile: 503.617ms | Execution: 72.247ms | React with ❌ to remove this embed.
Iirc we're doing that with this bot
@Cisien I think you wrote the eval code doesn't it run in a container?
yes
GitHub
GitHub - discord-csharp/CSharpRepl: CSharpRepl is a web api for C# ...
CSharpRepl is a web api for C# REPL using the Roslyn Scripting APIs - GitHub - discord-csharp/CSharpRepl: CSharpRepl is a web api for C# REPL using the Roslyn Scripting APIs