Replies: 2 comments
-
Thank you for the test. I'll investigate it when I start work on improving MIR-generated code. There are a lot of areas when MIR-generator can be improved. Currently I was mostly focused on making MIR-generator to produce code for different architectures. My next big milestone will be making a first release of MIR. And after that I have plans to work on MIR-generated code improvements. As for tcc, I can say current MIR-generator pipeline has more potential than tcc. As for this particular test, I have suspicion that it might be call overhead. As JIT compiler MIR has ability to rewrite existing function and all calls to it will be directed to the new code. Therefore all calls in MIR are indirected and done through small thunks and this results in additional 2 insns for a call and a bit worse code locality. But I may be wrong with my suspicion. May be I doing something stupid which I can easily fix. In any case, I'll definitely investigate this benchmark. It is interesting as it is not big or small. |
Beta Was this translation helpful? Give feedback.
-
Hi @vnmakarov I recently ran a test comparing JIT vs AOT for Ravi.
I am attaching the results I found AOT was about 2.5 faster than MIR for same C input. |
Beta Was this translation helpful? Give feedback.
-
Usually in my experiments the MIR performance is good and better than TCC/GCC/Clang with -O0, but I was testing MIR with a float intensive sample that I've made of a ray traced blue planet and I've noticed that in this sample MIR is slower than TCC and slower than
gcc -O0
at runtime (not counting compilation time). I just want to know if someone have ideias on why this happens, and if it's something I could generate better C code so I could get better performance from MIR.These are the results:
The sample code is available at https://gist.github.com/edubart/92c13dd4d5caa996cd30a9d627205ef6#file-blueplanet-c , this code does a lot of linear algebra operations to ray trace a blue planet with some procedural generated clouds and renders in real-time the following:
To output more FPS I've decreased the resolution in the code and these were the results when running on my x86_64 Linux.
So ir MIR not that good yet in optimizing applications with heavy use of floats?
Beta Was this translation helpful? Give feedback.
All reactions