<commit_before>
USING: arrays assocs kernel math.ranges random sequences sets
sorting trees.splay ;

IN: splay

: initial-alist ( n -- alist )
    iota >array randomize dup zip ;

: change-random ( newkeys splay keys -- splay' )
    swapd [ first pick delete-at first2 pick set-at ] 2each ;

: run-splay ( -- )
    100,000 initial-alist 10,000 cut
    [ >splay ] [ randomize 10,000 head ] bi
    change-random keys dup natural-sort assert= ;

MAIN: run-splay
<commit_msg>benchmark.splay: fix IN:.<commit_after>! Copyright (C) 2011 <NAME>
! See http://factorcode.org/license.txt for BSD license

USING: arrays assocs kernel math.ranges random sequences sets
sorting trees.splay ;

IN: benchmark.splay

: initial-alist ( n -- alist )
    iota >array randomize dup zip ;

: change-random ( newkeys splay keys -- splay' )
    swapd [ first pick delete-at first2 pick set-at ] 2each ;

: run-splay ( -- )
    100,000 initial-alist 10,000 cut
    [ >splay ] [ randomize 10,000 head ] bi
    change-random keys dup natural-sort assert= ;

MAIN: run-splay

{'fraction_non_alphanumeric': 0.10973282442748092, 'fraction_numerical': 0.03816793893129771, 'mean_word_length': 3.1626984126984126, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6699739', 'n_tokens_mistral': 388, 'n_tokens_neox': 352, 'n_words': 113}