feat: Add parallel entry processing for all platform exporters - #56
Conversation
Introduce `parallelMapEntries` function to process exporter entries in parallel, enhancing performance while respecting concurrency limits. Adapters for Android, Flutter, Web, and iOS exporters now leverage this improved parallel processing mechanism for colors, icons, and images. Changes: - Replace sequential entry processing with parallel processing using the new `parallelMapEntries` across all platform exporters. - Introduce `parallelMapEntries` in `ExFigCore` for general-purpose parallel execution with configurable concurrency limits. - Update `TerminalUI` to suppress spinner display during parallel execution, preventing visual conflicts. - Remove `EntryProcessor.swift`, which handled sequential processing, as it is now obsolete. - Add comprehensive unit tests for `parallelMapEntries`, verifying correct order preservation and error handling. These changes significantly improve export speed by leveraging parallel execution while maintaining API rate limits and user feedback integrity.
Summary of ChangesHello @alexey1312, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the performance of all platform exporters by introducing entry-level parallelism. By processing individual entries (colors, icons, images) concurrently using a new Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This is an excellent pull request that introduces entry-level parallelism to significantly speed up the export process. The new parallelMapEntries utility is well-designed and thoroughly tested. The changes are applied consistently across all platform exporters, and the related UI fix to prevent spinner interleaving is a thoughtful addition. I have only a few minor suggestions to improve conciseness in the exporter files.
Summary
Add entry-level parallelism (3rd level) to all 12 platform exporters. Entries within the same resource type (icons, images, colors) now process in parallel using a sliding window approach (max 5 concurrent), significantly reducing export time for configs with many entries.
Changes
parallelMapEntries()inExFigCore/Concurrency/— sliding windowwithThrowingTaskGroup, order-preserving, configurable concurrencyfor entry in entriesloops withparallelMapEntriesin all iOS/Android/Flutter/Web exporters for colors, icons, and imageshasActiveAnimationcheck inTerminalUI.withSpinner()to prevent spinner interleaving when entries run in parallel (standalone mode only; batch mode already suppressed)EntryProcessor.swiftparallelMapEntries(empty input, single entry, order preservation, sequential fallback, error propagation, parallel verification, aggregation)Safety
RateLimitedClientthrottles Figma API globallyTerminalUIisSendableand thread-safe viaTerminalOutputManagerExportContextimplementations areSendableTest Plan
./bin/mise run build— 0 errors, 0 warnings./bin/mise run test— 2151 tests passed./bin/mise run lint— clean./bin/mise run format-check— clean