Signal-Android icon indicating copy to clipboard operation
Signal-Android copied to clipboard

Pasting many emojis makes TextSecure freeze for a long time

Open ComeGitSome opened this issue 11 years ago โ€ข 3 comments

There's also lag when scrolling through messages and getting to the message containing emojis. Only happens in TextSecure, no other apps.

Version 2.22.0

Reproduce by pasting this:

๐Ÿ˜ฎ๐Ÿ˜ฃ๐Ÿ˜ค๐Ÿ˜ฅ๐Ÿ˜ฆ๐Ÿ˜ง๐Ÿ˜จ๐Ÿ˜ฉ๐Ÿ˜ฐ๐Ÿ˜Ÿ๐Ÿ˜ฑ๐Ÿ˜ฒ๐Ÿ˜ณ๐Ÿ˜ต๐Ÿ˜ถ๐Ÿ˜ท๐Ÿ˜ž๐Ÿ˜’๐Ÿ˜๐Ÿ˜›๐Ÿ˜œ๐Ÿ˜๐Ÿ˜‹๐Ÿ˜—๐Ÿ˜™๐Ÿ˜˜๐Ÿ˜š๐Ÿ˜Ž๐Ÿ˜ญ๐Ÿ˜Œ๐Ÿ˜–๐Ÿ˜”๐Ÿ˜ช๐Ÿ˜๐Ÿ˜“๐Ÿ˜ซ๐Ÿ™‹๐Ÿ™Œ๐Ÿ™๐Ÿ™…๐Ÿ™†๐Ÿ™‡๐Ÿ™Ž๐Ÿ™๐Ÿ˜บ๐Ÿ˜ผ๐Ÿ˜ธ๐Ÿ˜น๐Ÿ˜ป๐Ÿ˜ฝ๐Ÿ˜ฟ๐Ÿ˜พ๐Ÿ™€๐Ÿ™ˆ๐Ÿ™‰๐Ÿ™Š๐Ÿ’ฉ๐Ÿ‘ถ๐Ÿ‘ฆ๐Ÿ‘ง๐Ÿ‘จ๐Ÿ‘ฉ๐Ÿ‘ด๐Ÿ‘ต๐Ÿ’๐Ÿ’‘๐Ÿ‘ช๐Ÿ‘ซ๐Ÿ‘ฌ๐Ÿ‘ญ๐Ÿ‘ค๐Ÿ‘ฅ๐Ÿ‘ฎ๐Ÿ‘ท๐Ÿ’๐Ÿ’‚๐Ÿ‘ฏ๐Ÿ‘ฐ๐Ÿ‘ธ๐ŸŽ…๐Ÿ‘ผ๐Ÿ‘ฑ๐Ÿ‘ฒ๐Ÿ‘ณ๐Ÿ’ƒ๐Ÿ’†๐Ÿ’‡๐Ÿ’…๐Ÿ‘ป๐Ÿ‘น๐Ÿ‘บ๐Ÿ‘ฝ๐Ÿ‘พ๐Ÿ‘ฟ๐Ÿ’€๐Ÿ’ช๐Ÿ‘€๐Ÿ‘‚๐Ÿ‘ƒ๐Ÿ‘ฃ๐Ÿ‘„๐Ÿ‘…๐Ÿ’‹โค๐Ÿ’™๐Ÿ’š๐Ÿ’›๐Ÿ’œ๐Ÿ’“๐Ÿ’”๐Ÿ’•๐Ÿ’–๐Ÿ’—๐Ÿ’˜๐Ÿ’๐Ÿ’ž๐Ÿ’Ÿ๐Ÿ‘๐Ÿ‘Ž๐Ÿ‘ŒโœŠโœŒโœ‹๐Ÿ‘Šโ˜๐Ÿ‘†๐Ÿ‘‡๐Ÿ‘ˆ๐Ÿ‘‰๐Ÿ‘‹๐Ÿ‘๐Ÿ‘๐Ÿ”ฐ๐Ÿ’„๐Ÿ‘ž๐Ÿ‘Ÿ๐Ÿ‘‘๐Ÿ‘’๐ŸŽฉ๐ŸŽ“๐Ÿ‘“โŒš๐Ÿ‘”๐Ÿ‘•๐Ÿ‘–๐Ÿ‘—๐Ÿ‘˜๐Ÿ‘™๐Ÿ‘ ๐Ÿ‘ก๐Ÿ‘ข๐Ÿ‘š๐Ÿ‘œ๐Ÿ’ผ๐ŸŽ’๐Ÿ‘๐Ÿ‘›๐Ÿ’ฐ๐Ÿ’ณ๐Ÿ’ฒ๐Ÿ’ต๐Ÿ’ด๐Ÿ’ถ๐Ÿ’ท๐Ÿ’ธ๐Ÿ’ฑ๐Ÿ’น๐Ÿ”ซ๐Ÿ”ช๐Ÿ’ฃ๐Ÿ’‰๐Ÿ’Š๐Ÿšฌ๐Ÿ””๐Ÿ”•๐Ÿšช๐Ÿ”ฌ๐Ÿ”ญ๐Ÿ”ฎ๐Ÿ”ฆ๐Ÿ”‹๐Ÿ”Œ๐Ÿ“œ๐Ÿ“—๐Ÿ“˜๐Ÿ“™๐Ÿ“š๐Ÿ“”๐Ÿ“’๐Ÿ“‘๐Ÿ““๐Ÿ“•๐Ÿ“–๐Ÿ“ฐ๐Ÿ“›๐ŸŽƒ๐ŸŽ„๐ŸŽ€๐ŸŽ๐ŸŽ‚๐ŸŽˆ๐ŸŽ†๐ŸŽ‡๐ŸŽ‰๐ŸŽŠ๐ŸŽ๐ŸŽ๐ŸŽŒ๐ŸŽ๐ŸŽ‹๐ŸŽŽ๐Ÿ“ฑ๐Ÿ“ฒ๐Ÿ“Ÿโ˜Ž๐Ÿ“ž๐Ÿ“ ๐Ÿ“ฆโœ‰๐Ÿ“จ๐Ÿ“ฉ๐Ÿ“ช๐Ÿ“ซ๐Ÿ“ญ๐Ÿ“ฌ๐Ÿ“ฎ๐Ÿ“ค๐Ÿ“ฅ๐Ÿ“ฏ๐Ÿ“ข๐Ÿ“ฃ๐Ÿ“ก๐Ÿ’ฌ๐Ÿ’ญโœ’โœ๐Ÿ“๐Ÿ“๐Ÿ“๐Ÿ“๐Ÿ“Œ๐Ÿ“Žโœ‚๐Ÿ’บ๐Ÿ’ป๐Ÿ’ฝ๐Ÿ’พ๐Ÿ’ฟ๐Ÿ“†๐Ÿ“…๐Ÿ“‡๐Ÿ“‹๐Ÿ“๐Ÿ“‚๐Ÿ“ƒ๐Ÿ“„๐Ÿ“Š๐Ÿ“ˆ๐Ÿ“‰โ›บ๐ŸŽก๐ŸŽข๐ŸŽ ๐ŸŽช๐ŸŽจ๐ŸŽฌ๐ŸŽฅ๐Ÿ“ท๐Ÿ“น๐ŸŽฆ๐ŸŽญ๐ŸŽซ๐ŸŽฎ๐ŸŽฒ๐ŸŽฐ๐Ÿƒ๐ŸŽด๐Ÿ€„๐ŸŽฏ๐Ÿ“บ๐Ÿ“ป๐Ÿ“€๐Ÿ“ผ๐ŸŽง๐ŸŽค๐ŸŽต๐ŸŽถ๐ŸŽผ๐ŸŽป๐ŸŽน๐ŸŽท๐ŸŽบ๐ŸŽธใ€ฝ๐Ÿ•๐Ÿถ๐Ÿฉ๐Ÿˆ๐Ÿฑ๐Ÿ€๐Ÿ๐Ÿญ๐Ÿน๐Ÿข๐Ÿ‡๐Ÿฐ๐Ÿ“๐Ÿ”๐Ÿฃ๐Ÿค๐Ÿฅ๐Ÿฆ๐Ÿ๐Ÿ‘๐Ÿ๐Ÿบ๐Ÿƒ๐Ÿ‚๐Ÿ„๐Ÿฎ๐Ÿด๐Ÿ—๐Ÿ–๐Ÿท๐Ÿฝ๐Ÿธ๐Ÿ๐Ÿผ๐Ÿง๐Ÿ˜๐Ÿจ๐Ÿ’๐Ÿต๐Ÿ†๐Ÿฏ๐Ÿป๐Ÿซ๐Ÿช๐ŸŠ๐Ÿณ๐Ÿ‹๐ŸŸ๐Ÿ ๐Ÿก๐Ÿ™๐Ÿš๐Ÿฌ๐ŸŒ๐Ÿ›๐Ÿœ๐Ÿ๐Ÿž๐Ÿฒ๐Ÿ‰๐Ÿพ๐Ÿธ๐Ÿบ๐Ÿป๐Ÿท๐Ÿน๐Ÿถโ˜•๐Ÿต๐Ÿผ๐Ÿด๐Ÿจ๐Ÿง๐Ÿฆ๐Ÿฉ๐Ÿฐ๐Ÿช๐Ÿซ๐Ÿฌ๐Ÿญ๐Ÿฎ๐Ÿฏ๐Ÿณ๐Ÿ”๐ŸŸ๐Ÿ๐Ÿ•๐Ÿ–๐Ÿ—๐Ÿค๐Ÿฃ๐Ÿฑ๐Ÿž๐Ÿœ๐Ÿ™๐Ÿš๐Ÿ›๐Ÿฒ๐Ÿฅ๐Ÿข๐Ÿก๐Ÿ˜๐Ÿ ๐ŸŒ๐ŸŽ๐Ÿ๐ŸŠ๐Ÿ‹๐Ÿ„๐Ÿ…๐Ÿ†๐Ÿ‡๐Ÿˆ๐Ÿ‰๐Ÿ๐Ÿ‘๐Ÿ’๐Ÿ“๐Ÿ๐ŸŒฐ๐ŸŒฑ๐ŸŒฒ๐ŸŒณ๐ŸŒด๐ŸŒต๐ŸŒท๐ŸŒธ๐ŸŒน๐Ÿ€๐Ÿ๐Ÿ‚๐Ÿƒ๐ŸŒบ๐ŸŒป๐ŸŒผ๐ŸŒฝ๐ŸŒพ๐ŸŒฟโ˜€๐ŸŒˆโ›…โ˜๐ŸŒ๐ŸŒ‚โ˜”๐Ÿ’งโšก๐ŸŒ€โ„โ›„๐ŸŒ™๐ŸŒž๐ŸŒ๐ŸŒš๐ŸŒ›๐ŸŒœ๐ŸŒ‘๐ŸŒ’๐ŸŒ“๐ŸŒ”๐ŸŒ•๐ŸŒ–๐ŸŒ—๐ŸŒ˜๐ŸŽ‘๐ŸŒ„๐ŸŒ…๐ŸŒ‡๐ŸŒ†๐ŸŒƒ๐ŸŒŒ๐ŸŒ‰๐ŸŒŠ๐ŸŒ‹๐ŸŒŽ๐ŸŒ๐ŸŒ๐ŸŒ๐Ÿ ๐Ÿก๐Ÿข๐Ÿฃ๐Ÿค๐Ÿฅ๐Ÿฆ๐Ÿง๐Ÿจ๐Ÿฉ๐Ÿช๐Ÿซโ›ชโ›ฒ๐Ÿฌ๐Ÿฏ๐Ÿฐ๐Ÿญ๐Ÿ—ป๐Ÿ—ผ๐Ÿ—ฝ๐Ÿ—พ๐Ÿ—ฟโš“๐Ÿฎ๐Ÿ’ˆ๐Ÿ”ง๐Ÿ”จ๐Ÿ”ฉ๐Ÿšฟ๐Ÿ›๐Ÿ›€๐Ÿšฝ๐Ÿšพ๐ŸŽฝ๐ŸŽฃ๐ŸŽฑ๐ŸŽณโšพโ›ณ๐ŸŽพโšฝ๐ŸŽฟ๐Ÿ€๐Ÿ๐Ÿ‚๐Ÿƒ๐Ÿ„๐Ÿ†๐Ÿ‡๐ŸŽ๐Ÿˆ๐Ÿ‰๐ŸŠ๐Ÿš‚๐Ÿšƒ๐Ÿš„๐Ÿš…๐Ÿš†๐Ÿš‡โ“‚๐Ÿšˆ๐ŸšŠ๐Ÿš‹๐ŸšŒ๐Ÿš๐ŸšŽ๐Ÿš๐Ÿš๐Ÿš‘๐Ÿš’๐Ÿš“๐Ÿš”๐Ÿš•๐Ÿš–๐Ÿš—๐Ÿš˜๐Ÿš™๐Ÿšš๐Ÿš›๐Ÿšœ๐Ÿš๐Ÿšž๐ŸšŸ๐Ÿš ๐Ÿšก๐Ÿšข๐Ÿšฃ๐Ÿšโœˆ๐Ÿ›‚๐Ÿ›ƒ๐Ÿ›„๐Ÿ›…โ›ต๐Ÿšฒ๐Ÿšณ๐Ÿšด๐Ÿšต๐Ÿšท๐Ÿšธ๐Ÿš‰๐Ÿš€๐Ÿšค๐Ÿšถโ›ฝ๐Ÿ…ฟ๐Ÿšฅ๐Ÿšฆ๐Ÿšง๐Ÿšจโ™จ๐Ÿ’Œ๐Ÿ’๐Ÿ’Ž๐Ÿ’๐Ÿ’’๐Ÿ”๐Ÿ”™๐Ÿ”›๐Ÿ”œ๐Ÿ”šโณโŒ›โฐโ™ˆโ™‰โ™Šโ™‹โ™Œโ™โ™Žโ™โ™โ™‘โ™’โ™“โ›Ž๐Ÿ”ฑ๐Ÿ”ฏ๐Ÿšป๐Ÿšฎ๐Ÿšฏ๐Ÿšฐ๐Ÿšฑ๐Ÿ…ฐ๐Ÿ…ฑ๐Ÿ†Ž๐Ÿ…พ๐Ÿ’ฎ๐Ÿ’ฏ๐Ÿ” ๐Ÿ”ก๐Ÿ”ข๐Ÿ”ฃ๐Ÿ”คโžฟ๐Ÿ“ถ๐Ÿ“ณ๐Ÿ“ด๐Ÿ“ต๐Ÿšน๐Ÿšบ๐Ÿšผโ™ฟโ™ป๐Ÿšญ๐Ÿšฉโš ๐Ÿˆ๐Ÿ”žโ›”๐Ÿ†’๐Ÿ†—๐Ÿ†•๐Ÿ†˜๐Ÿ†™๐Ÿ†“๐Ÿ†–๐Ÿ†š๐Ÿˆฒ๐Ÿˆณ๐Ÿˆด๐Ÿˆต๐Ÿˆถ๐Ÿˆท๐Ÿˆธ๐Ÿˆน๐Ÿˆ‚๐Ÿˆบ๐Ÿ‰๐Ÿ‰‘ใŠ™ยฎยฉโ„ข๐Ÿˆš๐ŸˆฏใŠ—โญ•โŒโŽโ„น๐Ÿšซโœ…โœ”๐Ÿ”—โœดโœณโž•โž–โœ–โž—๐Ÿ’ ๐Ÿ’ก๐Ÿ’ค๐Ÿ’ข๐Ÿ”ฅ๐Ÿ’ฅ๐Ÿ’จ๐Ÿ’ฆ๐Ÿ’ซ๐Ÿ•›๐Ÿ•ง๐Ÿ•๐Ÿ•œ๐Ÿ•‘๐Ÿ•๐Ÿ•’๐Ÿ•ž๐Ÿ•“๐Ÿ•Ÿ๐Ÿ•”๐Ÿ• ๐Ÿ••๐Ÿ•ก๐Ÿ•–๐Ÿ•ข๐Ÿ•—๐Ÿ•ฃ๐Ÿ•˜๐Ÿ•ค๐Ÿ•™๐Ÿ•ฅ๐Ÿ•š๐Ÿ•ฆโ†•โฌ†โ†—โžกโ†˜โฌ‡โ†™โฌ…โ†–โ†”โคดโคตโชโซโฌโฉโ—€โ–ถ๐Ÿ”ฝ๐Ÿ”ผโ‡โœจ๐Ÿ”ด๐Ÿ”ตโšชโšซ๐Ÿ”ณ๐Ÿ”ฒโญ๐ŸŒŸ๐ŸŒ โ–ซโ–ชโ—ฝโ—พโ—ปโ—ผโฌœโฌ›๐Ÿ”ธ๐Ÿ”น๐Ÿ”ถ๐Ÿ”ท๐Ÿ”บ๐Ÿ”ปโ”โ“โ•โ—โ€ผโ‰ใ€ฐโžฐโ™ โ™ฅโ™ฃโ™ฆ๐Ÿ†”๐Ÿ”‘โ†ฉ๐Ÿ†‘๐Ÿ”๐Ÿ”’๐Ÿ”“โ†ช๐Ÿ”โ˜‘๐Ÿ”˜๐Ÿ”Ž๐Ÿ”–๐Ÿ”๐Ÿ”ƒ๐Ÿ”€๐Ÿ”๐Ÿ”‚๐Ÿ”„๐Ÿ“ง๐Ÿ”…๐Ÿ”†๐Ÿ”‡๐Ÿ”ˆ๐Ÿ”‰๐Ÿ”Š=-O :-P ;-) :-( :-) :-! :-$ B-) :O :-* :-D :'( :-\ O:-) :-[

ComeGitSome avatar Jul 13 '15 20:07 ComeGitSome

@ComeGitSome wrote:

Only happens in TextSecure, no other apps.

That is not entirely correct.

Telegram for Android for example has the same issue.

Both Telegram for Android as well as TextSecure for Android do overwrite the native system Emojis with some built-in Emoji images (JPEGs in Telegram, PNGs in TextSecure).

Apparently this causes a performance issue when you insert a lot of Emojis.

Telegram for Android uses a workaround for this though:

In Telegram for Android, when you insert some Emojis into a message, the first 50 Emojis are being replaced with the built-in JPEG Emojis.

But all Emojis after that (starting with the 51st Emoji) are no longer being replaced with the built-in JPEG Emojis. Instead, from the 51st Emoji on, the native system Emojis are being used.

Here you can see the related Telegram for Android issues on GitHub, see:

https://github.com/DrKLO/Telegram/issues/720 https://github.com/DrKLO/Telegram/issues/900 https://github.com/DrKLO/Telegram/issues/961

Regards

ghost avatar Jul 14 '15 15:07 ghost

Looked at a trace last night; this is a deeper problem with Android's TextView implementation, not related to our Emoji code as far as I can tell (as excited as I was to use the TreeRangeSet data structure for the first time). If you notice, after the long paste finished and you exit and re-enter the conversation with the massive set of emoji as a draft, the lag isn't there when re-loading it.

When you paste, the TextView class tries to take HTML-formatted clipboard data (when copied from a browser) and "coerce" it into a set of styled Spans. Unfortunately, this is doing XML parsing and is SUPER slow and I can't see a way to turn it off easily. Thanks android.

mcginty avatar Jul 15 '15 17:07 mcginty

Can't reproduce the issue.

ComeGitSome avatar Sep 21 '16 01:09 ComeGitSome