-
Notifications
You must be signed in to change notification settings - Fork 270
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
content model: Avoid classes.contains
, which does extra work like creating a Set
#497
Labels
a-content
Parsing and rendering Zulip HTML content, notably message contents
performance
Smooth and responsive UI; fixing jank, stutters, and lag
Milestone
Comments
chrisbobbe
added a commit
to chrisbobbe/zulip-flutter
that referenced
this issue
Feb 2, 2024
It turns out that `classes.contains` instantiates a Set every time it's called. That's unfortunate. So, remove some of this work by just checking the class string (`className`) directly, in the case where we expect just one class. When we expect two or more classes, we'll want a check that doesn't enforce a particular order, so perhaps we'll use a regular expression for those, or something, in later work. See zulip#497. Fixes-partly: zulip#497
gnprice
pushed a commit
to gnprice/zulip-flutter
that referenced
this issue
Feb 5, 2024
It turns out that `classes.contains` instantiates a Set every time it's called. That's unfortunate. So, remove some of this work by just checking the class string (`className`) directly, in the case where we expect just one class. When we expect two or more classes, we'll want a check that doesn't enforce a particular order, so perhaps we'll use a regular expression for those, or something, in later work. See zulip#497. Fixes-partly: zulip#497
This was referenced Feb 5, 2024
chrisbobbe
added a commit
that referenced
this issue
Feb 6, 2024
It turns out that `classes.contains` instantiates a Set every time it's called. That's unfortunate. So, remove some of this work by just checking the class string (`className`) directly, in the case where we expect just one class. When we expect two or more classes, we'll want a check that doesn't enforce a particular order, so perhaps we'll use a regular expression for those, or something, in later work. See #497. Fixes-partly: #497
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
a-content
Parsing and rendering Zulip HTML content, notably message contents
performance
Smooth and responsive UI; fixing jank, stutters, and lag
Greg and I discovered on our call today that
classes.contains
does some extra work:When we're checking that there are no classes, we should just check if
className
is empty. When we're checking that there is one class, we should just do string equality onclassName
. When we're checking that there is more than one class, we might want to do a regular expression or something.The text was updated successfully, but these errors were encountered: