Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slowdown with newer GCC versions #2988

Open
AlexDaniel opened this issue Jun 14, 2019 · 2 comments
Open

Slowdown with newer GCC versions #2988

AlexDaniel opened this issue Jun 14, 2019 · 2 comments
Labels

Comments

@AlexDaniel
Copy link
Contributor

Found it when trying to bisect this issue: #2945

This is the code that I used for the benchmark:

(^50_000).grep(*.is-prime).tail.say; say (now - INIT now)

Using bisectable I found this:

¦1cb266b^^^: «49999␤7.3227272␤»
¦1cb266b   : «49999␤9.4255653␤»

So the slowdown was caused by one of these commits:

Which obviously makes no sense at all. So I tested it again and again and again, trying to make sure that it is not some kind of noise. It's not.

On irc @timo jokingly suggested that the compiler itself can be an issue (these rakudo+moar builds were produced long time ago, and it's possible that it was done with different compilers). So I checked with objdump:

objdump --full-contents --section=.comment moar

And indeed:

GCC: (Debian 4.9.2-10) 4.9.2
GCC: (Debian 6.3.0-18) 6.3.0 20170516

That is, rakudo+moar built with newer gcc has worse performance. And not just a little bit worse, it's around 0.78x as fast. Weird, huh?

<timotimo> we should first check to see if the time difference lives inside libtommath or moarvm
<timotimo> probably not in the jit, since that shouldn't be dependent on the compiler
<timotimo> though a difference in compiler could change when jitting happens exactly

Though I'd say that we should simply bisect gcc and see what we get.

@taboege
Copy link
Contributor

taboege commented Jun 14, 2019

FWIW, I tested both revisions compiled with the same compiler gcc (GCC) 8.3.0 and indeed don't notice a difference:

# This is Rakudo version 2017.09-102-g9af5607d5 built on MoarVM version 2017.09.1-46-g27d3d01e5
49999
8.0941886
# This is Rakudo version 2017.09-105-g1cb266b8d built on MoarVM version 2017.09.1-46-g27d3d01e5
49999
8.101132

@AlexDaniel
Copy link
Contributor Author

Oh yes, it is worth noting that both compilers in my tests are relatively old. Maybe we should test against gcc 9.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants