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

Weird optimization in {l,g}e string comparison operators. #5050

Closed
p6rt opened this issue Jan 14, 2016 · 4 comments
Closed

Weird optimization in {l,g}e string comparison operators. #5050

p6rt opened this issue Jan 14, 2016 · 4 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Jan 14, 2016

Migrated from rt.perl.org#127272 (status was 'resolved')

Searchable as RT127272$

@p6rt
Copy link
Author

p6rt commented Jan 14, 2016

From darek.cidlinsky@atlas.cz

In large loops, "le" and "ge" operators eventually start to give False on equality.

MWE​:
  > say ("a" xx 1000).map(+("a" le *)).index(0)
  414

Expected output​:
  Nil

Compiler version (perl6 -v)​:
  This is Rakudo version 2015.12-212-g3259ba3 built on MoarVM version 2015.12-29-g8079ca5
  implementing Perl 6.c.

This means that when I compare "a" le "a" over and over again, it's true the first 414 times I do it, and then false. This happens only on equality, other cases seem to work OK.

It can be worked around by setting the MVM_JIT_DISABLE environment variable to 1.

Regards,
  D.

@p6rt
Copy link
Author

p6rt commented Mar 14, 2016

From @jnthn

On Thu Jan 14 09​:04​:47 2016, darek.cidlinsky@​atlas.cz wrote​:

In large loops, "le" and "ge" operators eventually start to give False
on equality.

MWE​:

say ("a" xx 1000).map(+("a" le *)).index(0)
414

Expected output​:
Nil

Compiler version (perl6 -v)​:
This is Rakudo version 2015.12-212-g3259ba3 built on MoarVM
version 2015.12-29-g8079ca5
implementing Perl 6.c.

This means that when I compare "a" le "a" over and over again, it's
true the first 414 times I do it, and then false. This happens only on
equality, other cases seem to work OK.

It can be worked around by setting the MVM_JIT_DISABLE environment
variable to 1.

Fixed the JIT compiler bug, and added test coverage in S03-operators/relational.t.

/jnthn

@p6rt
Copy link
Author

p6rt commented Mar 14, 2016

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Mar 14, 2016

@jnthn - Status changed from 'open' to 'resolved'

@p6rt p6rt closed this as completed Mar 14, 2016
@p6rt p6rt added the Bug label Jan 5, 2020
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

1 participant