Logo Mobile Performance

Mobile Performance

Cộng đồng
Omar-Obando
mobile-performance

Tối ưu hiệu suất ứng dụng di động, thời gian khởi động, quản lý bộ nhớ và mức tiêu thụ pin

Add to TypingMind

Tổng quan

Nhà phát hànhOmar-Obando
Kho mãqwen-orchestrator
Tên kỹ năngmobile-performance
Sao
53
Bản fork
13
Tệp đi kèm
Chỉ có hướng dẫn
Giấy phépMIT
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI dùng hướng dẫn viết bằng Markdown thay vì mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • Hướng dẫn có đủ mọi thứ cần thiết

    Mọi thứ mô hình cần đều nằm trong hướng dẫn — không có tệp bổ sung cần đồng bộ.

  • Mã nguồn mở

    Được Omar-Obando công bố trên GitHub. Hãy đọc các tệp nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Mobile Performance trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL của thư mục kỹ năng được hiển thị bên dưới rồi xác nhận.
    https://github.com/Omar-Obando/qwen-orchestrator/tree/main/skills/mobile-performance
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/Omar-Obando/qwen-orchestrator.git /tmp/qwen-orchestrator
mkdir -p .claude/skills
cp -r /tmp/qwen-orchestrator/skills/mobile-performance .claude/skills/mobile-performance
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Mobile Performance trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự nạp Mobile Performance ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên bạn có thể dùng Mobile Performance với cả những mô hình khác ngoài mô hình ban đầu. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên khi kỹ năng chưa được dùng, bạn không tốn token cho phần hướng dẫn.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

Mobile Performance Optimization

When to Use

  • Optimizing mobile app startup time
  • Reducing memory footprint and preventing leaks
  • Improving scroll performance and frame rates
  • Optimizing battery consumption
  • Reducing app bundle size
  • Implementing lazy loading for mobile resources
  • Optimizing image loading and caching strategies
  • Improving network request efficiency on mobile
  • Reducing jank and stuttering in animations
  • Optimizing database queries on mobile devices
  • Implementing efficient state management
  • Reducing cold/warm start times
  • Optimizing rendering pipeline
  • Implementing efficient list/virtualization patterns
  • Reducing memory allocations in hot paths
  • Optimizing JavaScript execution on mobile
  • Implementing efficient caching strategies
  • Reducing main thread blocking operations
  • Optimizing image decoding and processing
  • Implementing efficient animation systems
  • Reducing layout thrashing
  • Optimizing touch response times
  • Implementing efficient background task handling

When NOT to Use

  • Desktop web performance optimization (use performance skill instead)
  • Server-side rendering optimization (use serverless-optimization skill)
  • API endpoint performance (use api-design skill)
  • Database server optimization (use database-design skill)
  • Network infrastructure optimization
  • CDN configuration and optimization
  • Web worker optimization for desktop
  • WebGL/WebGPU performance tuning
  • Progressive Web App caching strategies
  • Service worker optimization
  • HTTP/2 or HTTP/3 configuration
  • Server push optimization
  • Critical CSS generation for web
  • Font loading optimization for web
  • Preload/prefetch hint optimization

Prerequisites

  • Understanding of mobile app architecture (React Native, Flutter, or native)
  • Knowledge of mobile device constraints (memory, CPU, battery)
  • Familiarity with mobile profiling tools
  • Understanding of mobile network conditions (3G, 4G, 5G, offline)
  • Experience with mobile-specific performance metrics

Performance Metrics

Core Mobile Metrics

MetricTargetMeasurement Tool
Time to Interactive (TTI)< 3s (4G), < 8s (3G)Chrome DevTools, Lighthouse
First Contentful Paint (FCP)< 1.8sChrome DevTools, Web Vitals
Largest Contentful Paint (LCP)< 2.5sChrome DevTools, Web Vitals
First Input Delay (FID)< 100msChrome DevTools, Web Vitals
Cumulative Layout Shift (CLS)< 0.1Chrome DevTools, Web Vitals
Total Blocking Time (TBT)< 300msChrome DevTools, Lighthouse
Memory Usage< 150MB (iOS), < 200MB (Android)Xcode Instruments, Android Profiler
Battery Impact< 5% per hourDevice battery stats, battery-historian
Frame Rate60fps (target), 120fps (high refresh)FPS counter, Performance Monitor
App Bundle Size< 50MB (initial), < 100MB (total)App Store Connect, Play Console

Mobile-Specific Metrics

MetricDescriptionTarget
Jank RatePercentage of dropped frames< 1%
Touch Response TimeTime from touch to visual feedback< 100ms
Scroll SmoothnessConsistency of scroll frame rate60fps sustained
Memory Leak RateMemory growth per navigation cycle0MB growth
Network Request TimeAverage request completion time< 500ms (cached), < 2s (network)
Image Load TimeTime to display optimized images< 1s
Animation Frame BudgetTime available per frame16.67ms (60fps)

Startup Time Optimization

Cold Start Optimization

javascript
// ❌ BAD: Heavy operations during startup
class App extends Component {
  componentDidMount() {
    // All these block startup
    this.loadUserData();
    this.initializeAnalytics();
    this.fetchNotifications();
    this.syncLocalDatabase();
    this.preloadImages();
  }
}

// ✅ GOOD: Prioritized, async startup
class App extends Component {
  componentDidMount() {
    // Phase 1: Show splash screen immediately
    this.showSplashScreen();

    // Phase 2: Critical initialization (parallel)
    Promise.all([
      this.initializeCoreServices(),
      this.loadUserPreferences(),
    ]).then(() => {
      // Phase 3: Navigate to main screen
      this.navigateToMainScreen();

      // Phase 4: Background tasks (non-blocking)
      this.initializeAnalytics();
      this.fetchNotifications();
      this.syncLocalDatabase();
    });
  }
}

React Native Startup Optimization

javascript
// App.js - Optimized startup
import React, { lazy, Suspense } from 'react';
import { ActivityIndicator, View } from 'react-native';
import { NavigationContainer } from '@react-navigation/native';

// Lazy load heavy screens
const Dashboard = lazy(() => import('./screens/Dashboard'));
const Settings = lazy(() => import('./screens/Settings'));
const Profile = lazy(() => import('./screens/Profile'));

const LazyScreen = ({ screen }) => (
  <Suspense
    fallback={
      <View style={styles.loadingContainer}>
        <ActivityIndicator size="large" />
      </View>
    }
  >
    {screen}
  </Suspense>
);

export default function App() {
  return (
    <NavigationContainer>
      {/* Heavy screens are only loaded when navigated to */}
      <Stack.Screen
        name="Dashboard"
        component={() => <LazyScreen screen={<Dashboard />} />}
      />
      <Stack.Screen
        name="Settings"
        component={() => <LazyScreen screen={<Settings />} />}
      />
      <Stack.Screen
        name="Profile"
        component={() => <LazyScreen screen={<Profile />} />}
      />
    </NavigationContainer>
  );
}

Flutter Startup Optimization

dart
// main.dart - Optimized startup
import 'package:flutter/material.dart';
import 'package:flutter_cache_manager/flutter_cache_manager.dart';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();

  // Pre-warm cache in background
  DefaultCacheManager().getFileFromCache('banner.jpg').then((_) {
    // Cache warmed, navigate to main app
  });

  // Initialize services without blocking
  unawaited(initializeAnalytics());
  unawaited(syncLocalDatabase());

  runApp(const MyApp());
}

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  bool _isLoading = true;

  @override
  void initState() {
    super.initState();
    // Show splash, load critical data
    loadCriticalData().then((_) {
      setState(() {
        _isLoading = false;
      });
    });
  }

  @override
  Widget build(BuildContext context) {
    if (_isLoading) {
      return const SplashScreen();
    }
    return const MainApp();
  }
}

Memory Optimization

Prevent Memory Leaks

javascript
// ❌ BAD: Memory leak from event listeners
class Component extends React.Component {
  componentDidMount() {
    EventEmitter.on('data', this.handleData);
    setInterval(this.pollData, 5000);
  }

  // Missing cleanup!

  render() {
    return <View />;
  }
}

// ✅ GOOD: Proper cleanup
class Component extends React.Component {
  componentDidMount() {
    EventEmitter.on('data', this.handleData);
    this.intervalId = setInterval(this.pollData, 5000);
  }

  componentWillUnmount() {
    EventEmitter.off('data', this.handleData);
    clearInterval(this.intervalId);
  }

  render() {
    return <View />;
  }
}

Image Memory Management

javascript
// React Native - Image optimization
import FastImage from 'react-native-fast-image';
import {Image} from 'react-native';

// Predefine image sizes
const IMAGE_SIZES = {
  thumbnail: {width: 100, height: 100},
  medium: {width: 400, height: 300},
  large: {width: 800, height: 600},
};

// Use FastImage with caching
const OptimizedImage = ({uri, size = 'medium'}) => (
  <FastImage
    source={{
      uri,
      priority: FastImage.priority.normal,
      // Cache control
      cache: FastImage.cacheControl.cacheOnly,
    }}
    style={{
      width: IMAGE_SIZES[size].width,
      height: IMAGE_SIZES[size].height,
    }}
    resizeMode={FastImage.resizeMode.cover}
  />
);

// Flutter - Image optimization
import 'package:cached_network_image/cached_network_image.dart';

Widget optimizedImage(String url) {
  return CachedNetworkImage(
    imageUrl: url,
    // Memory cache settings
    memCacheWidth: 400, // Constrain memory cache
    memCacheHeight: 300,
    // Disk cache
    fadeInDuration: Duration(milliseconds: 300),
    placeholder: (context, url) => CircularProgressIndicator(),
    errorWidget: (context, url, error) => Icon(Icons.error),
  );
}

Scroll Performance

Virtualized Lists

javascript
// React Native - FlatList optimization
import {FlatList} from 'react-native';

const OptimizedList = ({items}) => (
  <FlatList
    data={items}
    renderItem={RenderItem}
    // Key optimizations
    keyExtractor={item => item.id}
    initialNumToRender={10}          // Render first 10 items
    maxToRenderPerBatch={5}          // Batch size for subsequent renders
    windowSize={5}                   // Number of screens to render
    removeClippedSubviews={true}     // Remove off-screen views (Android)
    // Performance optimizations
    getItemLayout={(data, index) => ({
      length: ITEM_HEIGHT,
      offset: ITEM_HEIGHT * index,
      index,
    })}
    // Remove layout calculation
    onEndReachedThreshold={0.5}      // Load more at 50% from end
    onEndReached={() => loadMore()}
    // Memoize render
    renderItem={({item}) => <MemoizedItem item={item}/>}
  />
);

// Flutter - ListView optimization
import 'package:flutter_slidable/flutter_slidable.dart';

Widget optimizedList(List<Item> items) {
  return ListView.builder(
    // Pre-calculate item count
    itemCount: items.length,
    // Use builder pattern
    itemBuilder: (context, index) {
      final item = items[index];
      return ListTile(
        key: ValueKey(item.id), // Stable key
        title: Text(item.title),
        subtitle: Text(item.subtitle),
        leading: CircleAvatar(child: Text(item.initial)),
      );
    },
    // Optimize scrolling
    cacheExtent: 500.0, // Pre-render 500px ahead
    addAutomaticKeepAlives: true, // Keep item state
    addRepaintBoundaries: true,   // Isolate repaints
  );
}

Battery Optimization

Reduce Background Activity

javascript
// React Native - Battery-efficient polling
import { AppState } from 'react-native';

class BatteryEfficientComponent extends Component {
  state = { appState: AppState.currentState };

  componentDidMount() {
    this.appStateSubscription = AppState.addEventListener(
      'change',
      this.handleAppStateChange
    );

    // Only poll when app is in foreground
    if (this.state.appState === 'active') {
      this.startPolling();
    }
  }

  handleAppStateChange = (nextAppState) => {
    if (this.state.appState === 'active' && nextAppState === 'inactive') {
      this.stopPolling(); // App went to background
    } else if (nextAppState === 'active') {
      this.startPolling(); // App came to foreground
    }
    this.setState({ appState: nextAppState });
  };

  componentWillUnmount() {
    this.appStateSubscription?.remove();
    this.stopPolling();
  }
}

Bundle Size Optimization

Code Splitting

javascript
// React Native - Dynamic imports
import React, { lazy, Suspense } from 'react';

// Split by feature
const ChatFeature = lazy(() => import('./features/Chat'));
const PaymentFeature = lazy(() => import('./features/Payment'));
const SettingsFeature = lazy(() => import('./features/Settings'));

// Split by route
const Dashboard = lazy(() => import('./screens/Dashboard'));
const Profile = lazy(() => import('./screens/Profile'));

// Split by platform
const PlatformSpecific = lazy(() =>
  Platform.OS === 'ios'
    ? import('./components/IOSComponent')
    : import('./components/AndroidComponent')
);

Tree Shaking

javascript
// ❌ BAD: Import entire library
import _ from 'lodash';
_.debounce(() => {});

// ✅ GOOD: Import only what you need
import debounce from 'lodash/debounce';

Profiling Tools

React Native

ToolPurposeURL
React DevToolsComponent hierarchy, render timinghttps://facebook.github.io/react-native/react-devtools
Hermes ProfilerJavaScript execution profilingBuilt into React Native
FlipperNetwork, layout, plugin debugginghttps://fbflipper.com
Android ProfilerMemory, CPU, networkAndroid Studio
InstrumentsMemory leaks, energy impactXcode

Flutter

ToolPurposeURL
Flutter DevToolsPerformance, memory, networkhttps://docs.flutter.dev/tools/devtools
TimelineFrame rendering analysisBuilt into Flutter
Memory ViewHeap analysisFlutter DevTools
Network ViewRequest monitoringFlutter DevTools

Production Checklist

  • App startup time < 3s on mid-range device
  • Memory usage < 150MB (iOS), < 200MB (Android)
  • No memory leaks detected (profile 30min session)
  • Scroll performance 60fps sustained
  • Touch response < 100ms
  • Battery impact < 5% per hour
  • Bundle size < 50MB (initial download)
  • Images optimized and cached
  • Network requests batched and cached
  • Background tasks respect app state
  • Animations use native driver
  • Lists are virtualized
  • No jank during navigation
  • Tested on 3G network conditions
  • Offline mode functional
  • Memory profiling shows no leaks
  • Frame rate consistent during animations
  • Touch targets meet accessibility guidelines

References

Câu hỏi thường gặp

Kỹ năng AI Mobile Performance làm được gì?

Tối ưu hiệu suất ứng dụng di động, thời gian khởi động, quản lý bộ nhớ và mức tiêu thụ pin

Vì sao nên dùng Mobile Performance trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Mobile Performance là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Mobile Performance trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/Omar-Obando/qwen-orchestrator/tree/main/skills/mobile-performance. TypingMind đọc tệp SKILL.md rồi cài đặt kỹ năng để bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Mobile Performance?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Có thể dùng Mobile Performance với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Mobile Performance với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Mobile Performance có miễn phí không?

Có. Kỹ năng này được Omar-Obando phát hành trên GitHub theo giấy phép MIT. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp các công cụ mới mà mô hình có thể gọi. Khi mô hình gọi một công cụ, mã của công cụ đó chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và những tiêu chí mà kết quả cần đáp ứng. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇