niklas-heer / speed-comparison

A repo which compares the speed of different programming languages.
https://niklas-heer.github.io/speed-comparison
MIT License
475 stars 76 forks source link

Make swift compile instead of just running #42

Closed gbaraldi closed 1 year ago

gbaraldi commented 1 year ago

I'm not sure if this will work, but I thought the execution time was a bit odd. I'm really bad at swift 😄

Moelf commented 1 year ago

fix #37 ?

niklas-heer commented 1 year ago

@gbaraldi first, thank you for your pull request. Unfortunately, the CI run failed. From the output, it seems that the program doesn't output Pi anymore. Do you maybe know why?

              +swift | --> RUN --no-cache ./scbench "./leibniz" -i $iterations -l "swift --version" --export json --lang "Swift"
              +swift | speed-comparison benchmark (scbench) 1.0.0

              +swift | ***********
              +swift | Running iteration 1
              +swift | ***********
              +swift | ***********
              +swift | Running iteration 2
              +swift | ***********
              +swift | ***********
              +swift | Running iteration 3
              +swift | ***********

              +swift | Benchmarking Summary 
              +swift | -------------------- 

              +swift | Started:            
              +swift | Started:            17-10-2022 07:01:33 
              +swift | Ended:              17-10-2022 07:01:33 
              +swift | Language:           Swift 
              +swift | Version:            5.7 
              +swift | Executed Command:   ./leibniz 
              +swift | Accuracy:           NaN 
              +swift | Calculated Pi:       
              +swift | Total iterations:   3 
              +swift | Average time taken: 214.183556ms 
              +swift | Failed to export the results to json.
gbaraldi commented 1 year ago

That's odd, it does run locally for me, on both macos and linux.

giordano commented 1 year ago

What if you keep print(pi) as it was before?

niklas-heer commented 1 year ago

That's odd, it does run locally for me, on both macos and linux.

Also, if you run it with earthly --config earthly-config.yml +swift or do you just run the program?

gbaraldi commented 1 year ago

https://stackoverflow.com/questions/57095407/swift-print-doesnt-appear-in-stdout-but-3rd-party-c-library-logs-do-when-runn this is what I'm suspicious of. I ran it at my terminal.

niklas-heer commented 1 year ago

@gbaraldi I tried it out in Codespaces, and it seems to still fail. image

gbaraldi commented 1 year ago

This runs locally with earthly for me. My rounds.txt didn't have a new line :laughing:

niklas-heer commented 1 year ago

Yes, now it seems to work. I'll let the CI run in full then. image

niklas-heer commented 1 year ago

Thank you very much for your contribution @gbaraldi :+1: