This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Requires: web-vitals package to be added to your package.json dependencies. | |
| // Usage: <WebVitalsWidget enabled /> | |
| // Ideally you should mount this component as high as you can in your component hierarchy so it renders ASAP. | |
| // You can set the enabled prop to use an environment variable to make sure it's only on in dev/staging and off in prod if you want. | |
| // You can add a query parameter of __vitals=true to the end of your URL at any time and it will trigger the widget to show. | |
| // If the widget is covering an important part of your app, you can move it around with the location prop. | |
| // Some data won't populate in the widget until you click somewhere on the page to bring focus to the window (LCP/FID) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.util.concurrent.TimeUnit; | |
| import liqp.Template; | |
| public class Playground { | |
| private static void parse(String template) { | |
| for (int i = 0; i < 10; i++) { | |
| long start = System.nanoTime(); | |
| Template.parse(template); |