emmetio / sublime-text-plugin

The essential toolkit for web-developers
https://emmet.io
MIT License
250 stars 30 forks source link

Very slow in CSS files with base64-encoded fonts #177

Open chrisgrieser opened 1 year ago

chrisgrieser commented 1 year ago

I have a larger CSS files which contains a few base64-encoded fonts. (the css file is ~800kb of which 650kb are the fonts). I noticed a considerable slowdown, similar to what has previously been described in #143.

I tested removing all base64 fonts, and Emmet is blazingly fast. For context, I used a fresh install of the plugin, without any changes to the configuration in Emmet.sublime-settings (setting auto_mark to false also didn't result in any noticeable speedup).

Not sure about how exactly Emmet works, but considering the format, would it maybe be possible for emmet to simply ignore things base64-encoded lines? (or all of @font-face, if that's easier to implement?)

@font-face {
    font-family: "iA Writer Quattro S";
    font-weight: 700;
    font-style: normal;
    font-display: swap;
    src:
            url("data:font/woff2;charset=utf-8;base64,d09GMgABAAAA....")
            format("woff2");
}
sergeche commented 1 year ago

When do you have a slowdown? When expanding abbreviation?

chrisgrieser commented 1 year ago

when expanding, but also when any sort of typing results in a visible lag, e.g. typing pr10 takes a second before the characters show up.

When disabling auto_mark, the typing itself gets quicker again, but the manual expansion via a hotkey is still very laggy.