Skip Menu |
Report information
Id: 127973
Status: resolved
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: ddgreen [at] gmail.com
Cc:
AdminCc:

Severity: (no value)
Tag: Bug
Platform: (no value)
Patch Status: (no value)
VM: (no value)



Subject: [BUG] native strings not allowed to be as big as regular strings
From: Daniel Green <ddgreen [...] gmail.com>
To: rakudobug [...] perl.org
Date: Sat, 23 Apr 2016 10:21:51 -0400
Download (untitled) / with headers
text/plain 430b
>./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.
Download (untitled) / with headers
text/plain 315b
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.
Subject: Re: [perl #127973] [BUG] native strings not allowed to be as big as regular strings
From: Daniel Green <ddgreen [...] gmail.com>
To: perl6-bugs-followup [...] perl.org
Date: Sat, 9 Jul 2016 17:02:14 -0400
Download (untitled) / with headers
text/plain 580b
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:
Show quoted text
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.


Download (untitled) / with headers
text/plain 268b
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:~$
Subject: Re: [perl #127973] [BUG] native strings not allowed to be as big as regular strings
From: Daniel Green <ddgreen [...] gmail.com>
To: perl6-bugs-followup [...] perl.org
Date: Sat, 9 Jul 2016 18:26:25 -0400
Download (untitled)
multipart/alternative 1.5k

Message body not shown because it is not plain text.

Download (untitled) / with headers
text/plain 439b
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:
Show quoted text
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:~$


Download (untitled) / with headers
text/plain 339b
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.
Download (untitled) / with headers
text/plain 343b
Fixed in https://github.com/rakudo/rakudo/commit/8878af8 Test added in https://github.com/perl6/roast/commit/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.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org