这个实现会影响用户体验吗
我被分配的任务是实现缩短文本输入文本的功能,
例如,当我突出显示“you”这样的文本时,它必须像“u”一样改变,
我将有一个表格,其中包含更长的单词列表文本的版本和要替换的文本。因此,每当用户键入单词并突出显示它时,我想查询数据库以查找匹配项,如果找到匹配项,我想用缩短的单词替换该单词。
这不是我的想法,我被分配到这个实施。
我认为此功能会降低应用程序响应速度。它在应用程序的用户友好性方面存在一些缺点。
因此,我想听听您的意见,了解它有哪些缺点以及如何以更好的方式实施它。或者说有这样的功能就可以了吗?不会影响app速度吗?
I am assigned with the task to implement a functionality to shorten text typed text
For example , I type text like "you" when I highlight it and it has to change like "u"
I will have table which has list of words which has longer version of text and with text to be replaced.so whenever a user types word and highlights it i want to query the db for match , if a match is found I want to replace the word with the shortened word.
This is not my idea and am being assigned to this implementation.
I think this functionality will down the speed of the app responsiveness. And it has some disadvantages over the user friendliness of the application.
So I'd like to hear your opinions on what are the disadvantages it has and how can I implement this in a better manner. Or is that ok to have this kind of functionlity? Won't it affect the app speed?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
很难想象您会看到性能明显下降。即使是 iPhone 3G 的处理器也运行在 400MHz 左右,在 iPhone 上打字速度非常快的人可能会在一秒钟内输入四到五个字符。您所讨论的此类事情的简单实现将涉及在数据结构(例如字典、树或数据库)中进行查找,并且您应该能够非常快速地完成此操作。
为什么不尝试一下呢?实现您能想到的最简单的事情并衡量其性能。为了测量的目的,您可能需要使用循环来重复从数组中查找单词。计算您可以在 20 秒内执行的查找次数,然后除以 20 以获得每秒的平均次数。
It's hard to imagine that you'll see a noticeable decrease in performance. Even the iPhone 3G's processor runs at around 400MHz, and someone typing really fast on an iPhone might get four or five characters entered in a second. A simple implementation of the sort of thing you're talking about would involve a lookup in a data structure such as a dictionary, tree, or database, and you ought to be able to do that pretty quickly.
Why not try it? Implement the simplest thing you can think of and measure its performance. For the purpose of measuring, you might want to use a loop to repeatedly look up words from an array. Count the number of lookups you can do in, say, 20 seconds, and divide by 20 to get the average number per second.
我不认为这会花费很多性能,无论如何你可以使用分析器来检查每个方法花费了多长时间,至于功能,我相信你应该给用户机会“撤消”并遵守他自己的诺言(与苹果的自动校正相同)
i dont think it will take a lot of performance, anyway you can use the profiler to check how long every method is taking, as for the functionality, i believe you should give the user the opportunity to "undo" and keep his own word (same as apple's auto correction)