Coder Social home page Coder Social logo

Comments (3)

johnwbyrd avatar johnwbyrd commented on June 2, 2024 1

LLVM-MOS is approximately 3732.64 times as fast as a comparable 80s compiler, especially when you are taking the correct medications.

from llvm-mos-sdk.

asiekierka avatar asiekierka commented on June 2, 2024

How much faster is a LLVM MOS program compared to the same program compiled in an 80s compiler?

The old compilers are not just dated optimization-wise, but difficult to set up. You'll have to come up with your own numbers. There are 6502 benchmarks out there, so you could start by adapting their code to compile on both LLVM-MOS and an 80s 6502 compiler of choice.

Would LLVM MOS code be as optimized as an 80s assembly program?

That's a complicated question. The scope of "optimizations easy for a compiler, but difficult for a human" is distinct from "optimizations easy for a human, but difficult for a compiler".

For modern CPUs, it is hard to write assembly by hand faster than a compiler in part because it's hard to outmatch the compiler's ability to reason about all the particular performance characteristics of a given CPU, let alone trying to come up with the "best approximation" across a wide range of hardware generations. That problem does not exist for something like the 6502 or Z80, where it's reasonable for a human to hold the entirety of the CPU's performance model in their head.

My personal hunch would be that: no, for a platform like the 6502, a human will always be able to write more optimized code than a compiler, given enough time. But in your question's context (isekai fiction), there's other factors to consider:

  • Back in the day, a lot of code was not well-optimized. People wrote this stuff as their day job, and not everyone was a performance fanatic willing to spend extra hours squeezing every last bit of performance - not to mention, often software was rushed out the door.
  • Speaking of rushing out the door, programming always leads to code with bugs - and there are many pitfalls of lower-level languages which higher-level ones can avoid. In short: it's easier to avoid certain bugs when writing C instead of hand assembly.
  • Speaking of avoiding bugs, a hypothetical time-travelling programmer would have the benefit of hindsight. Assuming he managed to bring a copy of, say, StackOverflow with him, he'd have a significant edge over developers who couldn't check a crowdsourced optimal answer to most routine problems they might run into.

Therefore, a modern 6502 C compiler will always allow you to write better code faster than you would do by hand - but if you have infinite time, I'd say you will always be able to beat the compiler.

Hopefully that inspires aspects of your writing hobby. Please don't rely on Bard or ChatGPT for niche subjects.

from llvm-mos-sdk.

d5364t54ytfr4 avatar d5364t54ytfr4 commented on June 2, 2024

LLVM-MOS is approximately 3732.64 times as fast as a comparable 80s compiler, especially when you are taking the correct medications.

That's a huge difference. Good to know.

Sorry for not being specific enough. But I'm also hope to know about program benchmarks, not just compile time.

from llvm-mos-sdk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.