DEV Community

azu
azu

Posted on • Originally published at Medium on

3

Almin + React/Vue can optimizing performance visually

Almin is a State management library like Redux/Flux. But Almin aim to help Client-side DDD/CQRS.

This architecture is also known as Layered Architecture.

We have released Almin 0.14.0 that support to measure performance profile based on performance.mark. You can profiling UseCase execute, StoreGroup write/read, Store update using the browser developer tool timeline.

performance.mark is defined in User Timing Level 2 as Web standard API. It means that almin work with other library like React and Vue on performance profile.

Usage

If you have not heard of almin, please see Introduction · Almin.js

You can turn on performance profile by performanceProfile option.

https://gist.github.com/c40f4e11b9b0d131146b4a2c6ac7b546

Steps

  1. Turn on performanceProfile option
  2. Load your app
  3. Open the browser DevTools “Performance tab and press Record”
  4. Stop recording
  5. Almin events will be grouped under the **User Timing** label

Actually, you can see performance profile with Chrome DevTool timeline.

Liquid error: internal

This video show Almin + React on timeline. React has ?react_perf options that does profiling performance.

That example code is following.

Vue + Almin

Vue also support performance option based on performance.mark.

I’ve created a example project that use Almin + Vue.

  • Vue’s profile show view metrics(render and patch)
  • Almin’s profile show UseCase execute, StoreGroup write/read, Store update time

The collection of metrics is writtend in following document.

This project is migrated from Vue + Vuex to Vue + Almin. The diff is following.

Conclusion

Almin can measure performance profile with browser DevTools.

This performance profile also work with the other library like React, or Vue.

You can find bottleneck using these metrics.

For more details, See followoing documents.

almin/almin

AWS GenAI LIVE image

Real challenges. Real solutions. Real talk.

From technical discussions to philosophical debates, AWS and AWS Partners examine the impact and evolution of gen AI.

Learn more

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

Instrument, monitor, fix: a hands-on debugging session

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

Tune in to the full event

DEV is partnering to bring live events to the community. Join us or dismiss this billboard if you're not interested. ❤️