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

native strings not allowed to be as big as regular strings #5260

Closed
p6rt opened this issue Apr 23, 2016 · 9 comments
Closed

native strings not allowed to be as big as regular strings #5260

p6rt opened this issue Apr 23, 2016 · 9 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Apr 23, 2016

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

Searchable as RT127973$

@p6rt
Copy link
Author

p6rt commented Apr 23, 2016

From @MasterDuke17

./perl6 -e 'my $a = "a" x 2**30;say $a.chars'
1073741824

./perl6 -e 'my str $a = "a" x 2**30;say $a.chars'
===SORRY!===
String too long for string constants segment

./perl6 -version
This is Rakudo version 2016.04-17-g5a14162 built on MoarVM version 2016.04
implementing Perl 6.c.

There may be some perfectly good reason, but in that case maybe the error
message should reference that this is a limitation of native strings.

@p6rt
Copy link
Author

p6rt commented Jul 9, 2016

From @zoffixznet

This appears to hang now​:

zoffix@​VirtualBox​:~$ perl6 -e 'my $a = "a" x 2**30;say $a.chars'
1073741824
zoffix@​VirtualBox​:~$ perl6 -e 'my str $a = "a" x 2**30;say $a.chars'
^C
zoffix@​VirtualBox​:~$ perl6 -v
This is Rakudo version 2016.06-154-g55c359e built on MoarVM version 2016.06-9-g8fc21d5
implementing Perl 6.c.

@p6rt
Copy link
Author

p6rt commented Jul 9, 2016

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

@p6rt
Copy link
Author

p6rt commented Jul 9, 2016

From @MasterDuke17

I still get the exact same error, it just takes 10+ seconds.

This is Rakudo version 2016.06-204-g959cd3b built on MoarVM version
2016.06-11-gf9dad06

On Sat, Jul 9, 2016 at 4​:55 PM, Zoffix Znet via RT <
perl6-bugs-followup@​perl.org> wrote​:

This appears to hang now​:

zoffix@​VirtualBox​:~$ perl6 -e 'my $a = "a" x 2**30;say $a.chars'
1073741824
zoffix@​VirtualBox​:~$ perl6 -e 'my str $a = "a" x 2**30;say $a.chars'
^C
zoffix@​VirtualBox​:~$ perl6 -v
This is Rakudo version 2016.06-154-g55c359e built on MoarVM version
2016.06-9-g8fc21d5
implementing Perl 6.c.

@p6rt
Copy link
Author

p6rt commented Jul 9, 2016

From @zoffixznet

Oh, my bad. I didn't wait long enough. Takes over a minute​:

zoffix@​VirtualBox​:~$ time perl6 -e 'my str $a = "a" x 2**30;say $a.chars'
===SORRY!===
String too long for string constants segment

real 1m15.794s
user 0m7.408s
sys 0m9.432s
zoffix@​VirtualBox​:~$

@p6rt
Copy link
Author

p6rt commented Jul 28, 2016

From @MasterDuke17

Yeah, I filed the slowness as a bug (127972) a while ago.

On Sat, Jul 9, 2016 at 6​:23 PM, Zoffix Znet via RT <
perl6-bugs-followup@​perl.org> wrote​:

Oh, my bad. I didn't wait long enough. Takes over a minute​:

zoffix@​VirtualBox​:~$ time perl6 -e 'my str $a = "a" x 2**30;say $a.chars'
===SORRY!===
String too long for string constants segment

real 1m15.794s
user 0m7.408s
sys 0m9.432s
zoffix@​VirtualBox​:~$

@p6rt
Copy link
Author

p6rt commented Oct 8, 2017

From @dogbert17

On my 32 bit Linux VM​:

dogbert@​dogbert-VirtualBox ~ $ perl6 -v
This is Rakudo version 2017.09-348-g830084430 built on MoarVM version 2017.09.1-575-gd4e230a69
implementing Perl 6.c.
dogbert@​dogbert-VirtualBox ~ $ time perl6 -e 'my str $a = "a" x 2**30; say $a.chars'
1073741824

real 0m0.173s
user 0m0.176s
sys 0m0.032s

Seems plenty fast.

@p6rt
Copy link
Author

p6rt commented Oct 9, 2017

From @MasterDuke17

Fixed in rakudo/rakudo@8878af8

Test added in Raku/roast@919a2ddde6

This tests by creating a string with strands. If you want to test flat strings, an easy way is `my str $a = "a" x 4294967295; use nqp; my str $b = nqp​::indexingoptimized($a); say $b.chars`; however, this takes 4Gb of ram.

@p6rt
Copy link
Author

p6rt commented Oct 9, 2017

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

@p6rt p6rt closed this as completed Oct 9, 2017
@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