<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Eugene Chekan</title>
    <description>The latest articles on DEV Community by Eugene Chekan (@hom3chuk).</description>
    <link>https://dev.to/hom3chuk</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F50215%2F0d3e70c6-6b80-4bb8-b595-6cb0b6fed623.png</url>
      <title>DEV Community: Eugene Chekan</title>
      <link>https://dev.to/hom3chuk</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/hom3chuk"/>
    <language>en</language>
    <item>
      <title>Unusual render-blocking CSS case within International phone number input clonable</title>
      <dc:creator>Eugene Chekan</dc:creator>
      <pubDate>Sun, 06 Apr 2025 22:20:11 +0000</pubDate>
      <link>https://dev.to/hom3chuk/unusual-render-blocking-css-case-within-international-phone-number-input-clonable-3k4e</link>
      <guid>https://dev.to/hom3chuk/unusual-render-blocking-css-case-within-international-phone-number-input-clonable-3k4e</guid>
      <description>&lt;p&gt;If you are using a "&lt;a href="https://webflow.com/made-in-webflow/website/int-phone-input" rel="noopener noreferrer"&gt;International phone number input clonable&lt;/a&gt;" (or one of handful of similar ones) on your Webflow site, this might be a story for you. We reported the issue to the Webflow and to the component author, not sure how long will it take to fix it.&lt;/p&gt;

&lt;p&gt;Recently I was working with my new client that has a website on the Webflow, usual stuff: speeding up metrics on Google pagespeed, that kind of things. All went smooth, except for one thing: for some reason, the render time on google pagespeed was slower than expected. Sometimes firt render took like 5-10 seconds more. On my browser it was closer to 1-2s range. So I recorded a profile in Chrome's DevTools and saw a loooong element render delay.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fsitespeed.pro%2Fcase-studies%2Fwebflow%2Funusual-render-blocking-css-from-clonable%2Fwebflow-render-blocking-css-long-render-delay.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fsitespeed.pro%2Fcase-studies%2Fwebflow%2Funusual-render-blocking-css-from-clonable%2Fwebflow-render-blocking-css-long-render-delay.webp" alt="webflow render blocking css long render delay" width="800" height="395"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There was no network data transfer, no Javascript running, no styles calculations. It was just hanging in there for some reason and I could not pin it down. I then zoomed in even more and noticed a thin microsecond-sized task that mentioned some demo.css. Okay at least that's something, CSS will block page from rendering, let's go and find it, I thought. There it was.&lt;/p&gt;

&lt;p&gt;Notice the domain name there. That's an expired domain that was owned by the library author on github. The thing is, domain has expired and someone bought it, and it now redirects to some sketchy page.&lt;/p&gt;

&lt;p&gt;Now, I'm not sure what different browsers do when they get a sketchy webpage instead of a CSS file: most likely they will fail parsing that file right away and discard it. What I do know is that new domain that we're being redirected to is slow to respond, and that's what blocks the render.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fsitespeed.pro%2Fcase-studies%2Fwebflow%2Funusual-render-blocking-css-from-clonable%2Foutdated-render-blocking-css-from-international-telephione-component-clonable.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fsitespeed.pro%2Fcase-studies%2Fwebflow%2Funusual-render-blocking-css-from-clonable%2Foutdated-render-blocking-css-from-international-telephione-component-clonable.webp" alt="outdated render blocking css from international telephione component clonable" width="800" height="349"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When I blocked the CSS in my devtools, the Element render delay went down to just 200ms!&lt;/p&gt;

&lt;p&gt;After we updated the Webflow website code to not include that component, the pagespeed score for mobile skyrocketed from 50-ish into 80+!&lt;/p&gt;

&lt;p&gt;So yeah, if you use that international phone number component, you might wanna check if you have that demo.css stuff pointing to a sketchy domain and disable it while WF and component author are fixing that.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fsitespeed.pro%2Fcase-studies%2Fwebflow%2Funusual-render-blocking-css-from-clonable%2Fimproved-element-render-delay-by-eliminating-obsolete-css-from-a-clonable.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fsitespeed.pro%2Fcase-studies%2Fwebflow%2Funusual-render-blocking-css-from-clonable%2Fimproved-element-render-delay-by-eliminating-obsolete-css-from-a-clonable.webp" alt="improved element render delay by eliminating obsolete css from a clonable" width="800" height="322"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Shameless plug time: if you want me to help you out with &lt;a href="https://sitespeed.pro/" rel="noopener noreferrer"&gt;improving website performance&lt;/a&gt; then get in touch, I'm available!&lt;/p&gt;

</description>
      <category>webperf</category>
      <category>webflow</category>
      <category>perfmatters</category>
      <category>css</category>
    </item>
    <item>
      <title>Need startup/pet project idea? You can have dozen of them daily</title>
      <dc:creator>Eugene Chekan</dc:creator>
      <pubDate>Tue, 23 Oct 2018 10:02:57 +0000</pubDate>
      <link>https://dev.to/hom3chuk/need-startuppet-project-idea-you-can-have-dozen-of-them-daily-37dl</link>
      <guid>https://dev.to/hom3chuk/need-startuppet-project-idea-you-can-have-dozen-of-them-daily-37dl</guid>
      <description>&lt;p&gt;Many people find it hard to actually come up with the idea for a startup or a pet project. Some time ago it was the same for me, but now it’s not: I can generate dozens of ideas daily, thanks to the method I’ve come up with through all these years. Here’s the transcript of a small talk I did on the matter of generating and validating ideas.&lt;/p&gt;

&lt;h1&gt;
  
  
  Why?
&lt;/h1&gt;

&lt;p&gt;First of all, it is important to answer this question:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“Do you want do it because of fun or to make money?”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Fun or money, either is great, but settle on that as early as possible. “Fun” doesn’t imply that it will be something easy to do, it implies that you’ll do something you can relate to or something you will enjoy doing. “Fun” is fun for you.&lt;/p&gt;

&lt;p&gt;Now, some may think it is too early to make this decision, and why can’t I get both? This “fun or money” choice will be a rule of thumb for the decisions throughout the project: marketing, goals, priorities, everything.&lt;/p&gt;

&lt;h1&gt;
  
  
  Asking right questions
&lt;/h1&gt;

&lt;p&gt;Now let’s find the idea. To do this, we need to ask questions to people (you didn’t think you’ll do well without going out and talking to people, did you?). And obviously you need to listen to their answers. I will give you three questions to ask, but you can easily work out more. One thing you shouldn’t ask: “Do you have any idea for a possible project?”. Just don’t ask this one, believe me.&lt;/p&gt;

&lt;h2&gt;
  
  
  What do you hate doing?
&lt;/h2&gt;

&lt;p&gt;This may relate to work, daily life, pets, anything. This may be something happening once a month or on a daily basis. What you should look for is &lt;em&gt;The Pain Point&lt;/em&gt;. Remembering and typing in passwords, trying new (and bad tasting) beers, choosing route in heavily trafficked city. We hate that. That’s why there’s &lt;a href="https://www.lastpass.com/" rel="noopener noreferrer"&gt;LastPass&lt;/a&gt;, &lt;a href="https://untappd.com/" rel="noopener noreferrer"&gt;Untappd&lt;/a&gt; and &lt;a href="https://www.google.com/maps" rel="noopener noreferrer"&gt;Google Maps&lt;/a&gt;. Solve &lt;em&gt;The Pain Point&lt;/em&gt; for people and you’ll have the fame.&lt;/p&gt;

&lt;h2&gt;
  
  
  What steals your time?
&lt;/h2&gt;

&lt;p&gt;Here you should find out what takes away from people some fair amount of their time. Again, this can be related to work, personal life, etc. The big difference with previous questions is that “steals your time” doesn’t imply people hate it. You may (should) love talking to your clients, plan your budget, and organize your tasks. That’s why there’s &lt;a href="https://mailchimp.com/" rel="noopener noreferrer"&gt;Mailchimp&lt;/a&gt;, &lt;a href="https://www.youneedabudget.com/" rel="noopener noreferrer"&gt;YNAB&lt;/a&gt; and &lt;a href="https://trello.com/" rel="noopener noreferrer"&gt;Trello&lt;/a&gt;. Actually, that’s exactly how &lt;a href="https://downosaur.com/" rel="noopener noreferrer"&gt;Downosaur&lt;/a&gt; was born: we love to stay updated on status of things we use (GitHub outage, anyone?), but it takes a lot of time for a newly onboarded person in a company/freelance gig/startup to subscribe to status updates of all services we use.&lt;/p&gt;

&lt;h2&gt;
  
  
  What doesn’t work well enough?
&lt;/h2&gt;

&lt;p&gt;Last but not least question, and it can actually give you surprisingly lot of insights. This one looks like the reverse of “what do you hate?” coin, and it is. If there’s something people lack in existing product, they will adore the product where those features are present. Sketch to Figma, Blogger to Medium, hosting provider DNS to Cloudlfare’s one.&lt;/p&gt;

&lt;h1&gt;
  
  
  Formulate
&lt;/h1&gt;

&lt;p&gt;Now you need to refine your idea, be it The Pain Point elimination, something to save people time or fixing what is broken. Try to say it in a single, short sentence. “Status updates for small teams” is great, “The website where you put your emails to receive messages when GitHub or something else goes down” is not. Reduce as much as possible, this will help you throughout next steps (not only in the context of this article).&lt;/p&gt;

&lt;h1&gt;
  
  
  Validate
&lt;/h1&gt;

&lt;p&gt;Now when you have your idea idea, don’t rush to implement it. Don’t start a MVP. You need to validate the idea first, and not waste any time implementing something that will not take off. So here’re two things you should do.&lt;/p&gt;

&lt;h2&gt;
  
  
  We’re in beta, leave your email
&lt;/h2&gt;

&lt;p&gt;That’s it: simple landing page capturing subscriptions. &lt;a href="https://mailchimp.com/help/add-a-signup-form-to-your-website/" rel="noopener noreferrer"&gt;Mailchimp has those&lt;/a&gt;, as well as tons of others. Now share the link across some Reddit/Twitter and across your own network. You may also go and chip in a $50 into Google Ads and get some traffic from Google’s search. Keep in mind that ad clicks &lt;em&gt;are validations too&lt;/em&gt;, it’s not about subscriptions themselves.&lt;/p&gt;

&lt;h2&gt;
  
  
  We’re in beta, here’s your email
&lt;/h2&gt;

&lt;p&gt;Alternative way of validating your idea [cheap and quickly] is to find your potential customers and ask them, &lt;em&gt;if they want it&lt;/em&gt;. And optionally, &lt;em&gt;if they are willing to pay for it&lt;/em&gt;. It often takes more than 10 emails before you get any reply, but it totally worth it. A friend of mine was to develop a Shopify plugin and just went and contacted a bunch of Shopify-driven shops via contact form on their site. The feedback he’s got saved him a couple of months of implementing the app nobody was going to use because they have already had an app for that.&lt;/p&gt;

&lt;h1&gt;
  
  
  KISS
&lt;/h1&gt;

&lt;p&gt;If you decide to go with implementing your new idea, then keep it simple. Don’t give up too soon, yet don’t try to make something unmanageable work. Ideas are free, your time isn’t. And now when you can generate a bunch of ideas you shouldn’t care too much when one of them looks like a possible failure. Throw it away, come up with 10 new ones, and 🚀&lt;/p&gt;

&lt;p&gt;If you want me to help you &lt;a href="https://sitespeed.pro/" rel="noopener noreferrer"&gt;improve your website performance&lt;/a&gt; then get in touch, I'm available!&lt;/p&gt;

</description>
      <category>startup</category>
      <category>petproject</category>
      <category>ideas</category>
      <category>brainstorming</category>
    </item>
    <item>
      <title>"Performance marks: the missing manual, Part 1"</title>
      <dc:creator>Eugene Chekan</dc:creator>
      <pubDate>Mon, 01 Jan 2018 23:45:44 +0000</pubDate>
      <link>https://dev.to/hom3chuk/performance-marks-the-missing-manual-part-1-b6</link>
      <guid>https://dev.to/hom3chuk/performance-marks-the-missing-manual-part-1-b6</guid>
      <description>&lt;p&gt;Image by &lt;a href="https://www.shutterstock.com/g/viktoriiaa" rel="noopener noreferrer"&gt;Viktoriiaa&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/Performance/mark" rel="noopener noreferrer"&gt;&lt;code&gt;performance.mark()&lt;/code&gt;&lt;/a&gt; is a part of &lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/User_Timing_API" rel="noopener noreferrer"&gt;User Timing API&lt;/a&gt;. Arguably, it is the most useful performance-related method we have in browsers now because its application possibilities are far beyond just “mark this timestamp for me”, especially when combined with deep understanding of how browsers actually work. &lt;/p&gt;

&lt;h2&gt;
  
  
  Basic Usage
&lt;/h2&gt;

&lt;p&gt;To use it, just call &lt;code&gt;performance.mark()&lt;/code&gt; and pass mark name as a parameter within any JavaScript code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;performance&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;mark&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;fontsLoaded&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will add a &lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/PerformanceMark" rel="noopener noreferrer"&gt;PerformanceMark&lt;/a&gt; to the &lt;a href="https://www.w3.org/TR/performance-timeline/#performance-timeline" rel="noopener noreferrer"&gt;performance timeline&lt;/a&gt;.&lt;br&gt;
To delete a mark, make a call to the &lt;code&gt;performance.clearMarks()&lt;/code&gt; method:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;performance&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;clearMarks&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;fontsLoaded&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;JS one-liners inlined directly into HTML will do as well:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;What a beautiful text&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;script&amp;gt;&lt;/span&gt;
  &lt;span class="nx"&gt;performance&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;mark&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;afterText&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I know what you're thinking: “Hey JS is mostly single-threaded, can I mark the moment when browser reaches &lt;em&gt;exact line&lt;/em&gt; in the document?”. For the most part, yes, you can. Let's try this out!&lt;/p&gt;

&lt;h2&gt;
  
  
  Mark all the things
&lt;/h2&gt;

&lt;p&gt;First, a bit of theory 🤓. &lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Using_web_workers" rel="noopener noreferrer"&gt;Most of the time&lt;/a&gt;, document parsing and JS execution is done in a single thread, with respect for document structure from a first line to the last one. When browser meets, say, a &lt;code&gt;&amp;lt;link&amp;gt;&lt;/code&gt; to the stylesheet or a script, it pauses execution, downloads the resource it stumbled on, parses and executes it, and only then continues with parsing and executing stuff below. This concept — render-blocking resources — is crucial for achieving fast rendering timings and brilliantly covered by &lt;a href="https://twitter.com/igrigorik" rel="noopener noreferrer"&gt;Ilya Grigorik&lt;/a&gt; in his talks and &lt;a href="https://developers.google.com/web/fundamentals/performance/critical-rendering-path/" rel="noopener noreferrer"&gt;free online course&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Now, optimizations aside, you may want to know &lt;em&gt;how much time do you lose due to render being blocked by resources&lt;/em&gt;. Take a look at this snippet:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;title&amp;gt;&lt;/span&gt;Performance marks demo #1&lt;span class="nt"&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;script&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;performance&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;mark&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;parsing:css:start&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;link&lt;/span&gt; &lt;span class="na"&gt;rel=&lt;/span&gt;&lt;span class="s"&gt;"stylesheet"&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"shiny-style.css"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;script&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;performance&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;mark&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;parsing:css:end&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;What a beautiful text&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://hom3chuk.github.io/perfmarks-demo-1/index.html" rel="noopener noreferrer"&gt;Opening this in browser&lt;/a&gt; will mark two events: the one before stylesheet link, and one after. Check'em out:&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6skpdeioemb7fu8hbvtu.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6skpdeioemb7fu8hbvtu.jpg" alt="render-blocking CSS performance marks" width="800" height="727"&gt;&lt;/a&gt;&lt;br&gt;
Whoa 😱! It took browser near 80 ms to download, parse and apply our shiny stylesheet, faster than &lt;a href="http://bionumbers.hms.harvard.edu/bionumber.aspx?&amp;amp;id=100706&amp;amp;ver=4&amp;amp;trm=blink" rel="noopener noreferrer"&gt;a blink of an eye&lt;/a&gt;. Not so fast for one CSS selector we have there, though.&lt;/p&gt;

&lt;p&gt;On the bright side, you now know how to measure for how long rendering is blocked by resources. Wait, did I say &lt;code&gt;measure&lt;/code&gt;?&lt;/p&gt;
&lt;h3&gt;
  
  
  Measures
&lt;/h3&gt;

&lt;p&gt;We all &lt;a href="https://xkcd.com/55/" rel="noopener noreferrer"&gt;❤️ math&lt;/a&gt;, don't we? But when it comes to actual calculations, we like to make computers do it. Performance marks are no exception and we have handy &lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/Performance/measure" rel="noopener noreferrer"&gt;&lt;code&gt;performance.measure()&lt;/code&gt;&lt;/a&gt; method which, well, &lt;em&gt;measures&lt;/em&gt; distance between two marks. Let's add it to our HTML snippet:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;title&amp;gt;&lt;/span&gt;Performance marks demo #2: measures&lt;span class="nt"&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;script&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;performance&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;mark&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;parsing:css:start&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;link&lt;/span&gt; &lt;span class="na"&gt;rel=&lt;/span&gt;&lt;span class="s"&gt;"stylesheet"&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"shiny-style.css"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;script&amp;gt;&lt;/span&gt;
    &lt;span class="nx"&gt;performance&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;mark&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;parsing:css:end&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nx"&gt;performance&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;measure&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;blocking-styles&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;parsing:css:start&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;parsing:css:end&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;What a beautiful text&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now let's see &lt;a href="https://hom3chuk.github.io/perfmarks-demo-1/index-2.html" rel="noopener noreferrer"&gt;how this measure thing looks in browser&lt;/a&gt;:&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fug6vysf2m6vk5tg0u5uo.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fug6vysf2m6vk5tg0u5uo.jpg" alt="performance measure example" width="800" height="922"&gt;&lt;/a&gt;&lt;br&gt;
Cool, we can now just look at &lt;code&gt;measure&lt;/code&gt;'s &lt;code&gt;duration&lt;/code&gt; instead of doing math. Yay computers!&lt;/p&gt;
&lt;h2&gt;
  
  
  Mark-fu
&lt;/h2&gt;

&lt;p&gt;Me myself as well as some other developers prefer to use some kind of namespacing when setting up marks to organize taxonomy across different mark and event types:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;performance&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;mark&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;fonts:roboto:load&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;performance&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;mark&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;parsing.head.start&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That is, you just separate namespaces with colon or dot and your marks are getting nice structure. Of course you can use anything (&lt;a href="https://hom3chuk.github.io/perfmarks-demo-1/index-3.html" rel="noopener noreferrer"&gt;🐰, anyone?&lt;/a&gt;) to separate namespaces, not just dots and colons. There is no solid standard about performance marks namespacing and you are welcome to use whatever separator you want to use, pretty much like CSV format.&lt;/p&gt;

&lt;h2&gt;
  
  
  Retrieve your marks
&lt;/h2&gt;

&lt;h3&gt;
  
  
  During development
&lt;/h3&gt;

&lt;p&gt;Getting performance marks with your browser is easy:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Go to the developer tools of your browser&lt;/li&gt;
&lt;li&gt;Switch to JavaScript Console tab&lt;/li&gt;
&lt;li&gt;Put down &lt;code&gt;performance.getEntriesByType('mark')&lt;/code&gt; and here they are!&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  From real users
&lt;/h3&gt;

&lt;p&gt;Now, the hardest part is to retrieve these marks from your real users, and we're at Taki care about marks a lot. We are currently developing Marks'n'Measures Dashboard, although marks are already visible in our Waterfall view.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.webpagetest.org" rel="noopener noreferrer"&gt;Webpagetest&lt;/a&gt;, as well as WPT-based &lt;a href="https://www.machmetrics.com/" rel="noopener noreferrer"&gt;MachMetrics&lt;/a&gt; &amp;amp; &lt;a href="https://speedcurve.com" rel="noopener noreferrer"&gt;SpeedCurve&lt;/a&gt;, do support performance marks to some extent and you can get a glance at marks in Performance Timeline with these tools. If you haven't heard about WPT, go check it out: it is one of the best #webperf tools out there, it's completely free yet carries a whole lot of features. I literally use it on a &lt;em&gt;daily&lt;/em&gt; basis and do love it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Who use it?
&lt;/h2&gt;

&lt;p&gt;There's a couple of examples of performance marks in wild I know of: Google Maps and Optimizely. They set up marks throughout their client-side JS, so if you have GMaps embeded, or do run some Optimizely experiments, check out performance entries with your devtools on those pages!&lt;/p&gt;

&lt;h2&gt;
  
  
  What next?
&lt;/h2&gt;

&lt;p&gt;In coming articles I will show a lot more of advanced level &lt;em&gt;mark-fu&lt;/em&gt; and tell you about differences across different browsers in marks handling (you didn't even thought everything will work the same across all the browserzoo we're developing to, do you?😉).&lt;/p&gt;

&lt;p&gt;If you know some other examples of marks in the wild other than Google Maps and Optimizely, please do share them in comments below. And of course I encourage you to share your experience with marks, would love to take a look at other devs approach to marks.&lt;/p&gt;

&lt;p&gt;If you want me to help you out with &lt;a href="https://sitespeed.pro/" rel="noopener noreferrer"&gt;improving website performance&lt;/a&gt; then get in touch, I'm available!&lt;/p&gt;

&lt;p&gt;And remember, #perfmatters!&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>performance</category>
      <category>usertimingapi</category>
      <category>perfmatters</category>
    </item>
  </channel>
</rss>
