Dataverse-Python-Performance-Optimization
Dataverse-Python-Performance-Optimization是一款code方向的AI技能,核心价值是# Dataverse SDK for Python — Performance & Optimization Guide Based on official Microsoft Dataverse and Azure SDK performance guidance,可用于解决开发者在code领域的实际问题,帮助用户提升效率、自动化重复任务或优化工作流。
# Dataverse SDK for Python — Performance & Optimization Guide Based on official Microsoft Dataverse and Azure SDK performance guidance. ## 1. Performance Overview The Dataverse SDK for Python is op
mkdir -p ./skills/dataverse-python-performance-optimization && curl -sfL https://raw.githubusercontent.com/github/awesome-copilot/main/skills/dataverse-python-performance-optimization/SKILL.md -o ./skills/dataverse-python-performance-optimization/SKILL.md Run in terminal / PowerShell. Requires curl (Unix) or PowerShell 5+ (Windows).
Skill Content
# Dataverse SDK for Python — Performance & Optimization Guide
Based on official Microsoft Dataverse and Azure SDK performance guidance.
1. Performance Overview
The Dataverse SDK for Python is optimized for Python developers but has some limitations in preview:
- **Minimal retry policy**: Only network errors are retried by default
- **No DeleteMultiple**: Use individual deletes or update status instead
- **Limited OData batching**: General-purpose OData batching not supported
- **SQL limitations**: No JOINs, limited WHERE/TOP/ORDER BY
Workarounds and optimization strategies address these limitations.
---
2. Query Optimization
Use Select to Limit Columns
# ❌ SLOW - Retrieves all columns
accounts = client.get("account", top=100)
# ✅ FAST - Only retrieve needed columns
accounts = client.get(
"account",
select=["accountid", "name", "telephone1", "creditlimit"],
top=100
)**Impact**: Reduces payload size and memory usage by 30-50%.
---
Use Filters Efficiently
# ❌ SLOW - Fetch all, filter in Python
all_accounts = client.get("account")
active_accounts = [a for a in all_accounts if a.get("statecode") == 0]
# ✅ FAST - Filter server-side
accounts = client.get(
"account",
filter="statecode eq 0",
top=100
)**OData filter examples**:
# Equals
filter="statecode eq 0"
# String contains
filter="contains(name, 'Acme')"
# Multiple conditions
filter="statecode eq 0 and createdon gt 2025-01-01Z"
# Not equals
filter="statecode ne 2"---
Order by for Predictable Paging
# Ensure consistent order for pagination
accounts = client.get(
"account",
orderby=["createdon desc", "name asc"],
page_size=100
)
for page in accounts:
process_page(page)---
3. Pagination Best Practices
Lazy Pagination (Recommended)
# ✅ BEST - Generator yields one page at a time
pages = client.get(
"account",
top=5000, # Total limit
page_size=200 # Per-page size (hint)
)
for page in pages: # Each iteration fetches one page
for record in page:
process_record(record) # Process immediately**Benefits**:
- Memory efficient (pages loaded on-demand)
- Fast time-to-first-result
- Can stop early if needed
Avoid Loading Everything into Memory
# ❌ SLOW - Loads all 100,000 records at once
all_records = list(client.get("account", top=100000))
process(all_records)
# ✅ FAST - Process as you go
for page in client.get("account", top=100000, page_size=5000):
process(page)---
4. Batch Operations
Bulk Create (Recommended)
# ✅ BEST - Single call with multiple records
payloads = [
{"name": f"Account {i}", "telephone1": f"555-{i:04d}"}
for i in range(1000)
]
ids = client.create("account", payloads) # One API call for many recordsBulk Update - Broadcast Mode
# ✅ FAST - Same update applied to many records
account_ids = ["id1", "id2", "id3", "..."]
client.update("account", account_ids, {"statecode": 1}) # One callBulk Update - Per-Record Mode
# ✅ ACCEPTABLE - Different updates for each record
account_ids = ["id1", "id2", "id3"]
updates = [
{"telephone1": "555-0100"},
{"telephone1": "555-0200"},
{"telephone1": "555-0300"},
]
client.update("account", account_ids, updates)Batch Size Tuning
Based on table complexity (per Microsoft guidance):
| Table Type | Batch Size | Max Threads |
|------------|-----------|-------------|
| OOB (Account, Contact, Lead) | 200-300 | 30 |
| Simple (few lookups) | ≤10 | 50 |
| Moderately complex | ≤100 | 30 |
| Large/complex (>100 cols, >20 lookups) | 10-20 | 10-20 |
def bulk_create_optimized(client, table_name, payloads, batch_size=200):
"""Create records in optimal batch size."""
for i in range(0, len(payloads), batch_size):
batch = payloads[i:i + batch_size]
ids = client.create(table_name, batch)
print(f"Cr🎯 Best For
- UI designers
- Product designers
- Claude users
- GitHub Copilot users
- Software engineers
💡 Use Cases
- Generating component mockups
- Creating design system tokens
- Python code quality enforcement
- Dependency management
📖 How to Use This Skill
- 1
Install the Skill
Copy the install command from the Terminal tab and run it. The SKILL.md file downloads to your local skills directory.
- 2
Load into Your AI Assistant
Open Claude or GitHub Copilot and reference the skill. Paste the SKILL.md content or use the system prompt tab.
- 3
Apply Dataverse-Python-Performance-Optimization to Your Work
Open your project in the AI assistant and ask it to apply the skill. Start with a small module to verify the output quality.
- 4
Review and Refine
Review AI suggestions before committing. Run tests, check for regressions, and iterate on the skill output.
❓ Frequently Asked Questions
Does this work with Figma?
Some design skills integrate with Figma plugins. Check the Works With section for supported tools.
Is Dataverse-Python-Performance-Optimization compatible with Cursor and VS Code?
Yes — this skill works with any AI coding assistant including Cursor, VS Code with Copilot, and JetBrains IDEs.
Do I need specific dependencies for Dataverse-Python-Performance-Optimization?
Check the install command and Works With section. Most code skills only require the AI assistant and your codebase.
How do I install Dataverse-Python-Performance-Optimization?
Copy the install command from the Terminal tab and run it. The skill downloads to ./skills/dataverse-python-performance-optimization/SKILL.md, ready to use.
Can I customize this skill for my team?
Absolutely. Edit the SKILL.md file to add team-specific instructions, examples, or workflows.
⚠️ Common Mistakes to Avoid
Skipping usability testing
AI-generated designs should be validated with real users before development.
Skipping validation
Always test AI-generated code changes, even for simple refactors.
Missing dependency updates
Check if the skill requires updated dependencies or new packages.