Skip to content

O(N) Array#delete_if#2932

Draft
rolandpj1968 wants to merge 4 commits into
natalie-lang:masterfrom
rolandpj1968:O-N-delete-if
Draft

O(N) Array#delete_if#2932
rolandpj1968 wants to merge 4 commits into
natalie-lang:masterfrom
rolandpj1968:O-N-delete-if

Conversation

@rolandpj1968
Copy link
Copy Markdown
Contributor

@rolandpj1968 rolandpj1968 commented Feb 17, 2026

Ok, played with this and basically natalie block invocation is too slow to make this useful for sensible array sizes.

This is release build.

rolandpj@rolandpj-NucBox-M6:~/src/ruby-stuff/natalie-fork/natalie$ time bin/natalie test/natalie/array_test.rb 
...............................................................................................................................................................................................................
#delete_if actually starting at Tue Feb 17 22:34:34 2026
...
Starting to remove at Tue Feb 17 22:41:02 2026
...
...finished removing at Tue Feb 17 22:41:02 2026

.

208 spec(s) passed.

real	7m0.724s
user	6m59.598s
sys	0m1.057s

By comparison:

rolandpj@rolandpj-NucBox-M6:~/src/ruby-stuff/natalie-fork/natalie$ time ruby test/natalie/array_test.rb 
................................................................................................................................................................................................................

208 spec(s) passed.

real	0m6.383s
user	0m5.919s
sys	0m0.466s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant