Skip to content
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

Remove glyph FRP #5725

Merged
merged 19 commits into from
Mar 6, 2023
Merged

Remove glyph FRP #5725

merged 19 commits into from
Mar 6, 2023

Conversation

kazcw
Copy link
Contributor

@kazcw kazcw commented Feb 21, 2023

Pull Request Description

Implements #5724. Cuts new_glyph time in half. I'm looking in to the remainder of the time...

Important Notes

Checklist

Please include the following checklist in your PR:

  • The documentation has been updated if necessary.
  • All code conforms to the
    Scala,
    Java,
    and
    Rust
    style guides.
  • All code has been tested:
    • Unit tests have been written where possible.
    • If GUI codebase was changed: Enso GUI was tested when built using BOTH
      ./run ide build and ./run ide watch.

@kazcw kazcw self-assigned this Feb 21, 2023
@kazcw kazcw linked an issue Feb 22, 2023 that may be closed by this pull request
@kazcw kazcw added the CI: No changelog needed Do not require a changelog entry for this PR. label Feb 22, 2023
@enso-bot
Copy link

enso-bot bot commented Feb 22, 2023

Keziah Wesley reports a new STANDUP for today (2023-02-21):

Progress: Checked out text rendering. Removing glyph FRP (#5725) reduced cost by 30%. Pre-computing MSDFs should eliminate an additional 40% (#5722). It should be finished by 2023-02-22.

Next Day: Next day I will be working on the #5722 task. See if there's anything else I can cut from new_glyph (#5725), then start on pre-computing MSDFs.

@kazcw
Copy link
Contributor Author

kazcw commented Feb 22, 2023

Most of the remaining time in new_glyph is spent creating the display::Object and instantiating the shape system:

self_duration total_duration count profiler
220.7 220.7 599 instantiate (lib/rust/ensogl/core/src/display/shape/primitive/system.rs:303)
107.2 107.2 293 new (lib/rust/ensogl/core/src/display/object/instance.rs:1122)
73.0 401.3 1107 new_glyph (lib/rust/ensogl/component/text/src/font/glyph.rs:552)
0.4 0.4 1 new (lib/rust/ensogl/core/src/display/shape/primitive/system.rs:272)

These are worth looking in to after more impactful planned improvements like #5722.

@kazcw kazcw marked this pull request as ready for review February 22, 2023 18:12
@wdanilo
Copy link
Member

wdanilo commented Feb 22, 2023

@kazcw , what about updating the text-area debug scene? Have you tried it? After removing these FRP bindings here, the scene does not allow for testing bigger glyphs, different colors, etc. It would be cool to allow for it by implementing the removed logic there. Have you tried doing it?

@kazcw kazcw marked this pull request as draft February 22, 2023 22:03
@kazcw
Copy link
Contributor Author

kazcw commented Feb 23, 2023

@kazcw , what about updating the text-area debug scene? Have you tried it? After removing these FRP bindings here, the scene does not allow for testing bigger glyphs, different colors, etc. It would be cool to allow for it by implementing the removed logic there. Have you tried doing it?

Implemented. The bindings to change hinting are now Ctrl+(Shift)+E to increase (decrease) opacity_exponent, and Ctrl+(Shift)+O to increase (decrease) opacity_increment. Other bindings are unchanged. Internally, hinting parameters are now maintained per font, not per glyph.

@kazcw kazcw marked this pull request as ready for review February 23, 2023 21:36
@enso-bot
Copy link

enso-bot bot commented Feb 24, 2023

Keziah Wesley reports a new 🔴 DELAY for yesterday (2023-02-22):

Summary: There is 1 day delay in implementation of the Remove glyph FRP (#5725) task.
It will cause 0 days delay for the delivery of this weekly plan.

Delay Cause: Designing a way to set glyph parameters for debug scene to work without FRP.

@enso-bot
Copy link

enso-bot bot commented Feb 24, 2023

Keziah Wesley reports a new STANDUP for yesterday (2023-02-22):

Progress: Finished removing per-glyph FRP. Planning pre-computed MSDFs. It should be finished by 2023-02-23.

Next Day: Next day I will be working on the #5725 task. Port text debug scene to new API.

@enso-bot
Copy link

enso-bot bot commented Feb 24, 2023

Keziah Wesley reports a new STANDUP for today (2023-02-23):

Progress: Implemented text area debug scene functionality without FRP. It should be finished by 2023-02-23.

Next Day: Next day I will be working on the #5722 task. Implementing pre-computed MSDF atlas.

@enso-org enso-org deleted a comment from enso-bot bot Feb 28, 2023
Comment on lines 885 to 898
impl Hinting {
fn for_font(font_name: &str) -> Self {
let platform = platform::current();
match (platform, font_name) {
(Some(platform::Platform::MacOS), "mplus1p") =>
Self { opacity_increase: 0.4, opacity_exponent: 4.0 },
(Some(platform::Platform::Windows), "mplus1p") =>
Self { opacity_increase: 0.3, opacity_exponent: 3.0 },
(Some(platform::Platform::Linux), "mplus1p") =>
Self { opacity_increase: 0.3, opacity_exponent: 3.0 },
_ => Self::default(),
}
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should add explanation here why do we need it and why it differs.

@@ -526,7 +461,8 @@ impl WeakGlyph {
// ==============

#[cfg(not(target_arch = "wasm32"))]
#[derive(Clone, Copy, CloneRef, Debug, Default)]
#[derive(Clone, CloneRef, Debug, Default)]
#[allow(missing_copy_implementations)]
Copy link
Contributor

@farmaazon farmaazon Mar 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why cannot we implement Copy?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a mock of a non-Copy type; if it's Copy, the linter will complain when we clone it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. You can add a comment there, so nobody will ask this question again.

lib/rust/profiler/data/src/aggregate.rs Outdated Show resolved Hide resolved
Comment on lines 106 to 109
if let Some(prefix) = INCLUDE_ONLY_SUBTREES_MATCHING_PREFIX
&& label.starts_with(prefix) {
enable = true;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let enabled = enable || INCLUDE_ONLY_SUBTREES_MATCHING_PREFIX.map_or(false, |pfx| label.starts_with(pfx));
if enabled {...

I feel it shows the logic more clearly.

@kazcw kazcw added the CI: Ready to merge This PR is eligible for automatic merge label Mar 3, 2023
@kazcw kazcw mentioned this pull request Mar 6, 2023
4 tasks
@mergify mergify bot merged commit b74debb into develop Mar 6, 2023
@mergify mergify bot deleted the wip/kw/remove-glyph-frp branch March 6, 2023 23:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI: No changelog needed Do not require a changelog entry for this PR. CI: Ready to merge This PR is eligible for automatic merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Eliminate Glyph FRP Network
3 participants