[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7949CFMM4M1T8C4HM6NDWWF":3,"skill-same:01M7949CFMM4M1T8C4HM6NDWWF":58},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":35,"commitSha":36,"skillDirectory":37,"forksCount":38,"repositoryHtmlUrl":39,"repositoryHomepageUrl":6,"ownerHtmlUrl":40,"ownerBlogUrl":41,"ownerDescription":42,"updatedAt":43,"install":44,"resources":57},"01M7949CFMM4M1T8C4HM6NDWWF","palantir-performance-tuning",null,"Optimize Palantir Foundry API performance with caching, batching, and pagination.\nUse when experiencing slow API responses, optimizing transform builds,\nor improving request throughput for Foundry integrations.\nTrigger with phrases like \"palantir performance\", \"optimize foundry\",\n\"foundry slow\", \"palantir caching\", \"foundry batch\".","jukeyman\u002Fjukeyman-skills","jukeyman","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F142960420?v=4","01M78FR4Y3DHMMCBCC0GXXNB3F","RICK JEFFERSON","01M78FR4Z8RVQRAD31Y5J7V6EB",1,"MIT","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fsaas-packs--palantir-pack--palantir-performance-tuning\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: palantir-performance-tuning\ndescription: |\n  Optimize Palantir Foundry API performance with caching, batching, and pagination.\n  Use when experiencing slow API responses, optimizing transform builds,\n  or improving request throughput for Foundry integrations.\n  Trigger with phrases like \"palantir performance\", \"optimize foundry\",\n  \"foundry slow\", \"palantir caching\", \"foundry batch\".\nallowed-tools: Read, Write, Edit\nversion: 2.0.0\nlicense: MIT\nauthor: Jeremy Longshore \u003Cjeremy@intentsolutions.io>\ntags: [saas, palantir, foundry, performance, optimization]\ncompatible-with: claude-code, codex, openclaw\n---\n\n# Palantir Performance Tuning\n\n## Overview\nOptimize Foundry API performance: efficient pagination, client-side caching, batch object retrieval, and Spark transform tuning with `@configure` profiles.\n\n## Prerequisites\n- Completed `palantir-install-auth` setup\n- Working Foundry integration to optimize\n- Access to Foundry build metrics (for transform tuning)\n\n## Instructions\n\n### Step 1: Efficient Pagination\n```python\nfrom functools import lru_cache\n\ndef fetch_all_objects(client, ontology: str, object_type: str, page_size: int = 500):\n    \"\"\"Fetch all objects with maximum page size to minimize API calls.\"\"\"\n    all_objects = []\n    page_token = None\n    while True:\n        result = client.ontologies.OntologyObject.list(\n            ontology=ontology,\n            object_type=object_type,\n            page_size=min(page_size, 500),  # Foundry max is 500\n            page_token=page_token,\n        )\n        all_objects.extend(result.data)\n        page_token = result.next_page_token\n        if not page_token:\n            break\n    return all_objects\n```\n\n### Step 2: Client-Side Caching\n```python\nfrom cachetools import TTLCache\nimport hashlib, json\n\n_cache = TTLCache(maxsize=1000, ttl=300)  # 5-minute TTL\n\ndef cached_get_object(client, ontology, object_type, primary_key):\n    \"\"\"Cache Ontology object reads to reduce API calls.\"\"\"\n    cache_key = f\"{ontology}:{object_type}:{primary_key}\"\n    if cache_key in _cache:\n        return _cache[cache_key]\n    obj = client.ontologies.OntologyObject.get(\n        ontology=ontology, object_type=object_type, primary_key=primary_key,\n    )\n    _cache[cache_key] = obj\n    return obj\n\ndef invalidate_cache(ontology, object_type, primary_key):\n    cache_key = f\"{ontology}:{object_type}:{primary_key}\"\n    _cache.pop(cache_key, None)\n```\n\n### Step 3: Batch Object Retrieval\n```python\ndef batch_get_objects(client, ontology, object_type, primary_keys, batch_size=50):\n    \"\"\"Retrieve multiple objects using search filter instead of individual GETs.\"\"\"\n    results = {}\n    for i in range(0, len(primary_keys), batch_size):\n        batch = primary_keys[i:i+batch_size]\n        search_result = client.ontologies.OntologyObject.search(\n            ontology=ontology,\n            object_type=object_type,\n            where={\n                \"type\": \"in\",\n                \"field\": \"primaryKey\",\n                \"value\": batch,\n            },\n            page_size=batch_size,\n        )\n        for obj in search_result.data:\n            pk = obj.properties.get(\"primaryKey\", obj.rid)\n            results[pk] = obj\n    return results\n```\n\n### Step 4: Transform Build Performance\n```python\nfrom transforms.api import transform_df, Input, Output, configure, incremental\n\n# Use incremental for append-only data — processes only new rows\n@incremental()\n@transform_df(\n    Output(\"\u002FCompany\u002Fdatasets\u002Fevents_processed\"),\n    events=Input(\"\u002FCompany\u002Fdatasets\u002Fraw_events\"),\n)\ndef process_events(events):\n    return events.filter(events.event_type.isNotNull())\n\n# Tune Spark resources for heavy aggregations\n@configure(profile=[\"DRIVER_MEMORY_LARGE\", \"EXECUTOR_MEMORY_LARGE\"])\n@transform_df(\n    Output(\"\u002FCompany\u002Fdatasets\u002Fdaily_summary\"),\n    data=Input(\"\u002FCompany\u002Fdatasets\u002Flarge_table\"),\n)\ndef daily_summary(data):\n    from pyspark.sql import functions as F\n    return data.groupBy(\"date\", \"region\").agg(\n        F.sum(\"revenue\").alias(\"total_revenue\"),\n        F.countDistinct(\"user_id\").alias(\"unique_users\"),\n    )\n```\n\n### Step 5: Connection Pooling\n```python\nimport requests\nfrom requests.adapters import HTTPAdapter\nfrom urllib3.util.retry import Retry\n\nsession = requests.Session()\nadapter = HTTPAdapter(\n    pool_connections=10,\n    pool_maxsize=20,\n    max_retries=Retry(total=3, backoff_factor=0.5, status_forcelist=[429, 500, 502, 503]),\n)\nsession.mount(\"https:\u002F\u002F\", adapter)\n```\n\n## Output\n- Maximum page size pagination reducing API call count\n- TTL-based caching for repeated object reads\n- Batch search replacing individual GET calls\n- Optimized Spark transforms with `@configure` and `@incremental`\n\n## Error Handling\n| Performance Issue | Diagnosis | Fix |\n|-------------------|-----------|-----|\n| Slow pagination | Small page_size | Increase to 500 (max) |\n| Repeated reads | No caching | Add TTLCache |\n| N+1 object fetches | Individual GETs | Use batch search |\n| Transform OOM | Insufficient memory | Add `@configure(profile=[\"..._LARGE\"])` |\n| Full rebuild on append data | Not incremental | Add `@incremental()` decorator |\n\n## Resources\n- [Transforms @configure](https:\u002F\u002Fwww.palantir.com\u002Fdocs\u002Ffoundry\u002Fapi-reference\u002Ftransforms-python-library\u002Fapi-configure)\n- [Incremental Transforms](https:\u002F\u002Fwww.palantir.com\u002Fdocs\u002Ffoundry\u002Ftransforms-python\u002Ftransforms-pipelines)\n- [cachetools](https:\u002F\u002Fcachetools.readthedocs.io\u002F)\n\n## Next Steps\nFor cost optimization, see `palantir-cost-tuning`.\n","# Palantir Performance Tuning\n\n## Overview\nOptimize Foundry API performance: efficient pagination, client-side caching, batch object retrieval, and Spark transform tuning with `@configure` profiles.\n\n## Prerequisites\n- Completed `palantir-install-auth` setup\n- Working Foundry integration to optimize\n- Access to Foundry build metrics (for transform tuning)\n\n## Instructions\n\n### Step 1: Efficient Pagination\n```python\nfrom functools import lru_cache\n\ndef fetch_all_objects(client, ontology: str, object_type: str, page_size: int = 500):\n    \"\"\"Fetch all objects with maximum page size to minimize API calls.\"\"\"\n    all_objects = []\n    page_token = None\n    while True:\n        result = client.ontologies.OntologyObject.list(\n            ontology=ontology,\n            object_type=object_type,\n            page_size=min(page_size, 500),  # Foundry max is 500\n            page_token=page_token,\n        )\n        all_objects.extend(result.data)\n        page_token = result.next_page_token\n        if not page_token:\n            break\n    return all_objects\n```\n\n### Step 2: Client-Side Caching\n```python\nfrom cachetools import TTLCache\nimport hashlib, json\n\n_cache = TTLCache(maxsize=1000, ttl=300)  # 5-minute TTL\n\ndef cached_get_object(client, ontology, object_type, primary_key):\n    \"\"\"Cache Ontology object reads to reduce API calls.\"\"\"\n    cache_key = f\"{ontology}:{object_type}:{primary_key}\"\n    if cache_key in _cache:\n        return _cache[cache_key]\n    obj = client.ontologies.OntologyObject.get(\n        ontology=ontology, object_type=object_type, primary_key=primary_key,\n    )\n    _cache[cache_key] = obj\n    return obj\n\ndef invalidate_cache(ontology, object_type, primary_key):\n    cache_key = f\"{ontology}:{object_type}:{primary_key}\"\n    _cache.pop(cache_key, None)\n```\n\n### Step 3: Batch Object Retrieval\n```python\ndef batch_get_objects(client, ontology, object_type, primary_keys, batch_size=50):\n    \"\"\"Retrieve multiple objects using search filter instead of individual GETs.\"\"\"\n    results = {}\n    for i in range(0, len(primary_keys), batch_size):\n        batch = primary_keys[i:i+batch_size]\n        search_result = client.ontologies.OntologyObject.search(\n            ontology=ontology,\n            object_type=object_type,\n            where={\n                \"type\": \"in\",\n                \"field\": \"primaryKey\",\n                \"value\": batch,\n            },\n            page_size=batch_size,\n        )\n        for obj in search_result.data:\n            pk = obj.properties.get(\"primaryKey\", obj.rid)\n            results[pk] = obj\n    return results\n```\n\n### Step 4: Transform Build Performance\n```python\nfrom transforms.api import transform_df, Input, Output, configure, incremental\n\n# Use incremental for append-only data — processes only new rows\n@incremental()\n@transform_df(\n    Output(\"\u002FCompany\u002Fdatasets\u002Fevents_processed\"),\n    events=Input(\"\u002FCompany\u002Fdatasets\u002Fraw_events\"),\n)\ndef process_events(events):\n    return events.filter(events.event_type.isNotNull())\n\n# Tune Spark resources for heavy aggregations\n@configure(profile=[\"DRIVER_MEMORY_LARGE\", \"EXECUTOR_MEMORY_LARGE\"])\n@transform_df(\n    Output(\"\u002FCompany\u002Fdatasets\u002Fdaily_summary\"),\n    data=Input(\"\u002FCompany\u002Fdatasets\u002Flarge_table\"),\n)\ndef daily_summary(data):\n    from pyspark.sql import functions as F\n    return data.groupBy(\"date\", \"region\").agg(\n        F.sum(\"revenue\").alias(\"total_revenue\"),\n        F.countDistinct(\"user_id\").alias(\"unique_users\"),\n    )\n```\n\n### Step 5: Connection Pooling\n```python\nimport requests\nfrom requests.adapters import HTTPAdapter\nfrom urllib3.util.retry import Retry\n\nsession = requests.Session()\nadapter = HTTPAdapter(\n    pool_connections=10,\n    pool_maxsize=20,\n    max_retries=Retry(total=3, backoff_factor=0.5, status_forcelist=[429, 500, 502, 503]),\n)\nsession.mount(\"https:\u002F\u002F\", adapter)\n```\n\n## Output\n- Maximum page size pagination reducing API call count\n- TTL-based caching for repeated object reads\n- Batch search replacing individual GET calls\n- Optimized Spark transforms with `@configure` and `@incremental`\n\n## Error Handling\n| Performance Issue | Diagnosis | Fix |\n|-------------------|-----------|-----|\n| Slow pagination | Small page_size | Increase to 500 (max) |\n| Repeated reads | No caching | Add TTLCache |\n| N+1 object fetches | Individual GETs | Use batch search |\n| Transform OOM | Insufficient memory | Add `@configure(profile=[\"..._LARGE\"])` |\n| Full rebuild on append data | Not incremental | Add `@incremental()` decorator |\n\n## Resources\n- [Transforms @configure](https:\u002F\u002Fwww.palantir.com\u002Fdocs\u002Ffoundry\u002Fapi-reference\u002Ftransforms-python-library\u002Fapi-configure)\n- [Incremental Transforms](https:\u002F\u002Fwww.palantir.com\u002Fdocs\u002Ffoundry\u002Ftransforms-python\u002Ftransforms-pipelines)\n- [cachetools](https:\u002F\u002Fcachetools.readthedocs.io\u002F)\n\n## Next Steps\nFor cost optimization, see `palantir-cost-tuning`.\n",{"name":5,"tags":24,"author":30,"license":15,"version":31,"description":32,"allowed-tools":33,"compatible-with":34},[25,26,27,28,29],"saas","palantir","foundry","performance","optimization","Jeremy Longshore \u003Cjeremy@intentsolutions.io>","2.0.0","Optimize Palantir Foundry API performance with caching, batching, and pagination.\nUse when experiencing slow API responses, optimizing transform builds,\nor improving request throughput for Foundry integrations.\nTrigger with phrases like \"palantir performance\", \"optimize foundry\",\n\"foundry slow\", \"palantir caching\", \"foundry batch\".\n","Read, Write, Edit","claude-code, codex, openclaw","main","99825ad3f3bcc6597ddcc7294a14e6e922f2b67b","skills\u002Fsaas-packs--palantir-pack--palantir-performance-tuning",0,"https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills","https:\u002F\u002Fgithub.com\u002Fjukeyman","https:\u002F\u002FRJBUSINESSSOLUTIONS.ORG","Credit and Finance Expert | Developer\r\n\r\nI'm Rick Jefferson, a seasoned credit and finance expert with over a decade of experience in financial literacy,","2026-07-13 07:03:29",{"source":8,"skillName":5,"commands":45,"prompt":55,"zipAvailable":56},[46,49,52],{"tool":47,"command":48},"npx","npx skills add jukeyman\u002Fjukeyman-skills --skill palantir-performance-tuning",{"tool":50,"command":51},"bunx","bunx skills add jukeyman\u002Fjukeyman-skills --skill palantir-performance-tuning",{"tool":53,"command":54},"pnpm","pnpm dlx skills add jukeyman\u002Fjukeyman-skills --skill palantir-performance-tuning","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fsaas-packs--palantir-pack--palantir-performance-tuning\u002FSKILL.md",true,[],[59,66,73,80,87,95],{"skillNo":60,"name":61,"nameZh":6,"description":62,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":63,"categories":64,"keywords":65,"publishedAt":19},"01M79ANS2SM329NEP5ZCX106RR","zustand-store-creator","Create zustand store creator operations. Auto-activating skill for Frontend Development.\nTriggers on: zustand store creator, zustand store creator\nPart of the Frontend Development skill category. Use when working with zustand store creator functionality. Trigger with phrases like \"zustand store creator\", \"zustand creator\", \"zustand\".","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzustand-store-creator\u002FSKILL.md",[],[],{"skillNo":67,"name":68,"nameZh":6,"description":69,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":70,"categories":71,"keywords":72,"publishedAt":19},"01M79AMZKP4YDEZ7EHG1Y7PP74","zero-trust-config-helper","Configure with zero trust config helper operations. Auto-activating skill for Security Advanced.\nTriggers on: zero trust config helper, zero trust config helper\nPart of the Security Advanced skill category. Use when configuring systems or services. Trigger with phrases like \"zero trust config helper\", \"zero helper\", \"zero\".","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzero-trust-config-helper\u002FSKILL.md",[],[],{"skillNo":74,"name":75,"nameZh":6,"description":76,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":19},"01M79AMJSBCEJQNBTYNAHYN5HM","zapier-integration-helper","Assist with zapier integration helper operations. Auto-activating skill for Business Automation.\nTriggers on: zapier integration helper, zapier integration helper\nPart of the Business Automation skill category. Use when working with APIs or building integrations. Trigger with phrases like \"zapier integration helper\", \"zapier helper\", \"zapier\".","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzapier-integration-helper\u002FSKILL.md",[],[],{"skillNo":81,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":19},"01M79AHJZGVMARS13VFQYRR1MP","yaml-config-validator","Validate yaml config validator operations. Auto-activating skill for DevOps Basics.\nTriggers on: yaml config validator, yaml config validator\nPart of the DevOps Basics skill category. Use when configuring systems or services. Trigger with phrases like \"yaml config validator\", \"yaml validator\", \"yaml\".","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fyaml-config-validator\u002FSKILL.md",[],[],{"skillNo":88,"name":89,"nameZh":6,"description":90,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":91,"sourceHtmlUrl":92,"categories":93,"keywords":94,"publishedAt":19},"01M79AHGDZRN0020RDQSQDPAM8","xvary-stock-research","Thesis-driven equity analysis from public SEC EDGAR and market data; \u002Fanalyze, \u002Fscore, \u002Fcompare workflows with bundled Python tools (Claude Code, Cursor, Codex).","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fxvary-stock-research\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fxvary-stock-research\u002FSKILL.md",[],[],{"skillNo":96,"name":97,"nameZh":6,"description":98,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":99,"categories":100,"keywords":101,"publishedAt":19},"01M79AHCYJ9FV9RMHQ24HDRN33","xss-vulnerability-scanner","Scan xss vulnerability scanner operations. Auto-activating skill for Security Fundamentals.\nTriggers on: xss vulnerability scanner, xss vulnerability scanner\nPart of the Security Fundamentals skill category. Use when working with xss vulnerability scanner functionality. Trigger with phrases like \"xss vulnerability scanner\", \"xss scanner\", \"xss\".","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fxss-vulnerability-scanner\u002FSKILL.md",[],[]]