Skip to content

Freeze (memory/CPU chewed up) when trying to spell long string #18

@dylan-chong

Description

@dylan-chong
spell('ç§�ã�Ÿã�¡ã�¯ãƒ‰ãƒ¼ãƒ“ルã�«2009å¹´7月ã�«4泊ã�—ã�¾ã�—ã�Ÿã€‚ 地下鉄ã�‹ã‚‰2分ã€�ブãƒ\xadードウェイã�¾ã�§æ\xad©ã�„ã�¦ã‚‚ã€�ã��ã‚“ã�ªã�«æ°—ã�«ã�ªã‚Šã�¾ã�›ã‚“ã�§ã�—ã�Ÿã�‹ã‚‰ã€�立地ã�§ã‚‚ã�™ã�¦ã��ã�ªãƒ›ãƒ†ãƒ«ã�§ã�™ã€‚経営者ã�‹ã�¨æ€�ã‚�れるè€�夫婦ã�¨å¨˜ã�•ã‚“ã€�ã�‚ã�¨2人ã�®ã‚¹ã‚¿ãƒƒãƒ•ã�«å‡ºä¼šã�„ã�¾ã�—ã�Ÿã€‚ ゴスペルã�®æ‰€åœ¨åœ°ã‚’å°‹ã�\xadã�Ÿã‚‰ã€�ãƒ�ットã�§åœ°å›³ã‚’プリントã�—ã�¦ã��れã�¦ã€�親切ã�«èª¬æ˜Žã�—ã�¦ã��れã�¾ã�—ã�Ÿã€‚ æ\xad´å�²ã‚’ä¿�ã�¨ã�†ã�¨ã�¨ã�—ã�¦ã�„るニューヨークをæ\xad©ã��æ‹\xa0点ã�¨ã�—ã�¦ã€�最é�©ã�ªãƒ›ãƒ†ãƒ«ã�§ã�™ã€‚ スターãƒ�ックスã€�マクドナルドã€�ã‚\xadングãƒ�ーガも近ã��ã�«ã�‚りã€�エンパイアステートビル迄10分弱ã�§ã�™ã�Œã€�コリアã�®çµŒå–¶ã�™ã‚‹ã‚³ãƒ³ãƒ“ニ兼飲食店も数軒有りã€�ホテルã�®è£�手ã�®é€šã‚Šã�«ã�¯æ¶ˆè²»ç¨Žç„¡æ–™ã�®ã‚³ãƒ³ãƒ“ニもã�‚ã�£ã�¦ä¾¿åˆ©ã�§ã�—ã�Ÿã€‚ 100å¹´ã�®æ\xad´å�²ã�¨ã�„ã�£ã�¦ã‚‚改装ã�•れã�¦ã�„ã�¦æ¸…æ½”ã�ªãƒ›ãƒ†ãƒ«ã�§ã�™ã€‚手動ã�®ã‚¨ãƒ¬ãƒ™ãƒ¼ã‚¿ã‚‚å�°è±¡ã�«æ®‹ã‚Šã�¾ã�—ã�Ÿã€‚ 冷蔵庫ã�Œã�ªã�„点ã�¨ã€�ウインドウタイプã�®ã‚¨ã‚¢ã‚³ãƒ³ã�Œã�¡ã‚‡ã�£ã�¨ä¸�便ã�ªç‚¹ä»¥å¤–ã�Šå‹§ã‚�ã�§ã�™ã€‚')

This causes memory to chew up to 6GB+ in a matter of seconds.

Took me all day to figure this out!

Would be good to include some sort of blacklist of weird characters and prevent the mysterious memory hog, eg throw an error (and provide some api to check if a string is spellable)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions