Логотип Mobile Performance

Mobile Performance

Спільнота
Omar-Obando
mobile-performance

Оптимізація продуктивності мобільних застосунків: час запуску, керування пам’яттю та енергоефективність

Add to TypingMind

Огляд

ВидавецьOmar-Obando
Репозиторійqwen-orchestrator
Назва навичкиmobile-performance
Зірки
53
Форки
13
Файли в пакеті
Лише інструкції
ЛіцензіяMIT
Посилання
  • Інструкції у форматі Markdown

    Файл SKILL.md, який модель завантажує за потреби, тож токени витрачаються лише тоді, коли запит справді відповідає навичці.

  • Працює з будь-якою LLM

    Навички ШІ — це звичайний Markdown, а не код для певного постачальника, тому вони працюють із GPT, Claude, Gemini, Grok або локальною моделлю.

  • Усе необхідне — в інструкціях

    Усе потрібне моделі міститься в інструкціях — жодних додаткових файлів для синхронізації.

  • Відкритий вихідний код

    Видавець на GitHub: Omar-Obando. Перед установленням перегляньте вихідні файли навички.

Встановлення

Установіть навичку ШІ Mobile Performance у TypingMind, щоб використовувати її з будь-якою LLM, або додайте її до іншого агента, що читає SKILL.md.

1

Встановити в TypingMind

TypingMind встановлює навичку безпосередньо з її папки на GitHub — читає SKILL.md, збирає файли ресурсів у пакет і зберігає результат локально.

  1. Відкрийте застосунок і перейдіть до розділу «Плагіни» → «Навички».
  2. Виберіть «Встановити з GitHub».
  3. Вставте наведений нижче URL папки навички та підтвердьте встановлення.
    https://github.com/Omar-Obando/qwen-orchestrator/tree/main/skills/mobile-performance
  4. Увімкніть навичку в кожному чаті, де хочете її використовувати.
Плагіни → Навички → Додати навичку → За URL GitHub, потім вставте URL папки й натисніть «Продовжити».
2

Встановити в іншому агенті

Будь-який агент, що підтримує формат Agent Skills, може використовувати цю навичку — скопіюйте папку до каталогу навичок цього агента.

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
Після копіювання перезапустіть Claude Code, щоб завантажити нову навичку.

Використовуйте навичку в TypingMind

Увімкніть навичку Mobile Performance в будь-якому чаті TypingMind, і далі модель усе зробить сама. Назва й опис навички містяться в системному промпті, а щойно надходить відповідний запит, модель самостійно завантажує повні інструкції — вам не потрібно викликати навичку вручну, і до фактичного використання вона не витрачає токенів.

Модель самостійно завантажує навичку Mobile Performance, щойно надходить відповідний запит.

Працює з будь-якою моделлю ШІ

Навички ШІ — це звичайні інструкції у форматі Markdown, а не код для певного постачальника, тому навичка Mobile Performance не прив’язана до моделі, для якої її створено. Установіть її один раз у TypingMind і використовуйте з GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama або локальною моделлю, яку ви запускаєте самостійно, — усе з вашими власними ключами API.

  • Завантажується лише за потреби

    Системний промпт містить лише назву й опис. Інструкції завантажуються за першого відповідного запиту, тож поки навичка не потрібна, токени на її інструкції не витрачаються.

  • Змінюйте моделі під час чату

    Оскільки навичка — це інструкції, а не код, зміна моделі не порушує її роботу: наступна модель читає той самий файл SKILL.md.

Інструкції навички

Це вміст файлу SKILL.md, який завантажує модель. Прочитайте його перед установленням — навичка містить інструкції, яких дотримуватиметься ваша модель.

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

Поширені запитання

Що робить навичка ШІ Mobile Performance?

Оптимізація продуктивності мобільних застосунків: час запуску, керування пам’яттю та енергоефективність

Навіщо використовувати Mobile Performance у TypingMind?

Тому що ви встановлюєте її один раз і використовуєте з будь-якою моделлю. Mobile Performance — це звичайний Markdown, а не код для конкретного постачальника, тому та сама навичка працює з GPT-5, Claude, Gemini, Grok або локальною моделлю. Ви можете змінити модель навіть посеред чату, і навичка продовжить працювати. TypingMind використовує ваші власні ключі API, тож ви платите безпосередньо постачальникам замість передплати за кожне місце користувача, а ваші навички й чати залишаються у вашому сховищі.

Як встановити Mobile Performance у TypingMind?

Відкрийте в TypingMind Плагіни → Навички → Встановити з GitHub і вставте https://github.com/Omar-Obando/qwen-orchestrator/tree/main/skills/mobile-performance. TypingMind прочитає файл SKILL.md і встановить навичку, яку можна вмикати окремо для кожного чату.

Які моделі ШІ можуть використовувати Mobile Performance?

Будь-яка модель, яку ви підключите в TypingMind. Навички ШІ — це звичайні інструкції у форматі Markdown, а не код для конкретного постачальника, тому GPT, Claude, Gemini, Grok і локальні моделі можуть завантажувати цю навичку, коли запит їй відповідає.

Зі скількома моделями ШІ можна використовувати Mobile Performance?

Зі скількома забажаєте. У TypingMind ви можете використовувати Mobile Performance із будь-якою моделлю, яка підтримує навички, зокрема з GPT, Claude, Gemini, Grok, DeepSeek, Mistral чи Llama. Для цього ви використовуєте власні ключі API.

Чи безкоштовна навичка ШІ Mobile Performance?

Так. На GitHub цю навичку публікує Omar-Obando за ліцензією MIT. Ви платите лише своєму постачальнику ШІ за використані токени.

Що таке навички ШІ?

Навичка ШІ — це набір інструкцій для повторного використання, який навчає модель ШІ виконувати одне конкретне завдання. Він відповідає відкритому формату Agent Skills: файл SKILL.md із назвою та описом, а також скрипти, шаблони чи довідкові файли, які можуть знадобитися моделі. Модель читає інструкції лише тоді, коли ваш запит відповідає навичці, тому встановлена навичка нічого не коштує, доки її не використано.

Чим навички ШІ відрізняються від плагінів або серверів MCP?

Плагін або сервер MCP надає моделі нові інструменти, які вона може викликати, — код, який десь виконується й повертає результат. Натомість навичка ШІ дає моделі знання й пояснює порядок дій: як підійти до завдання, яких кроків дотримуватися та яким має бути якісний результат. Навички — це звичайний Markdown, тож їм не потрібні ні сервер, ні ключ API, ні середовище виконання, і вони працюють із будь-якою моделлю.

Усі

Створіть власний робочий простір зі ШІ вже зараз

Підпишіться на нашу розсилку, щоб дізнаватися про нові функції та майбутні розіграші 👇