[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7FABYEVY7AACTA6YYRY13AG":3,"skill-same:01M7FABYEVY7AACTA6YYRY13AG":62},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":28,"commitSha":29,"skillDirectory":30,"forksCount":13,"repositoryHtmlUrl":31,"repositoryHomepageUrl":6,"ownerHtmlUrl":32,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":33,"install":34,"resources":47},"01M7FABYEVY7AACTA6YYRY13AG","ifcos-errors-performance",null,"Use when processing large IFC files (100MB+) or optimizing slow IfcOpenShell scripts. Prevents the #1 performance mistake: calling create_shape() per element instead of using the geometry iterator for batch processing. Covers geometry iterator, by_type caching, batch patterns, memory management, multiprocessing strategies, and profiling. Keywords: performance, large IFC, geometry iterator, create_shape, batch processing, memory, multiprocessing, optimization, slow, 100MB, profiling, IFC file too large, takes too long, out of memory.","lagzgabrielmuller-dot\u002Fkit-ingenieria-3d","lagzgabrielmuller-dot","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F333339260?v=4","01M7F985KYC0XB2XZ97B5YWH4C","01M7F985MHK8N2NVE4VAR5WBWS",0,"MIT","https:\u002F\u002Fgithub.com\u002Flagzgabrielmuller-dot\u002Fkit-ingenieria-3d\u002Fblob\u002Fmain\u002Fplugins\u002Fblender-bim-sverchok\u002Fskills\u002Fifcopenshell\u002Ferrors\u002Fifcos-errors-performance\u002FSKILL.md",[],[],"2026-11-16 10:05:34",false,"---\nname: ifcos-errors-performance\ndescription: >\n  Use when processing large IFC files (100MB+) or optimizing slow IfcOpenShell scripts.\n  Prevents the #1 performance mistake: calling create_shape() per element instead of using\n  the geometry iterator for batch processing. Covers geometry iterator, by_type caching,\n  batch patterns, memory management, multiprocessing strategies, and profiling.\n  Keywords: performance, large IFC, geometry iterator, create_shape, batch processing, memory, multiprocessing, optimization, slow, 100MB, profiling, IFC file too large, takes too long, out of memory.\nlicense: MIT\ncompatibility: \"Designed for Claude Code. Requires IfcOpenShell Python library.\"\nmetadata:\n  author: OpenAEC-Foundation\n  version: \"1.0\"\n---\n\n# IfcOpenShell Performance Optimization\n\n## Quick Reference\n\n### Decision Tree: Geometry Processing Strategy\n\n```\nProcessing IFC geometry?\n├── Single element (interactive\u002Fdebug)?\n│   └── ifcopenshell.geom.create_shape(settings, element)\n│\n├── Multiple elements (10+)?\n│   └── ALWAYS use ifcopenshell.geom.iterator\n│       ├── Need all elements? → iterator(settings, model, cpu_count())\n│       └── Need specific types? → iterator(settings, model, cpu_count(), include=filtered)\n│\n└── No geometry needed (data extraction only)?\n    └── Skip geometry entirely — use by_type() + get_psets()\n```\n\n### Decision Tree: Large File Strategy\n\n```\nFile size?\n├── \u003C 10 MB (small) → Standard ifcopenshell.open(), no special handling\n│\n├── 10-200 MB (medium) → Cache by_type() results, batch API calls\n│\n├── 200 MB - 2 GB (large)\n│   ├── Data only? → Load, extract to plain dicts, del model, gc.collect()\n│   ├── Geometry? → Use iterator with include filter, limit threads on low-RAM\n│   └── Repeated access? → Extract once, cache in external format\n│\n└── > 2 GB (very large)\n    ├── Needs full model? → 32+ GB RAM required\n    ├── Needs subset? → Extract IDs first, process in chunks\n    └── Geometry? → Process by type in sequence, gc.collect() between types\n```\n\n### Critical Warnings\n\n- **ALWAYS** use `ifcopenshell.geom.iterator` for batch geometry processing (10+ elements). NEVER call `create_shape()` in a loop for bulk operations — iterator is 5-10x faster.\n- **ALWAYS** pass `multiprocessing.cpu_count()` to the iterator for optimal parallelism. Reduce thread count only on memory-constrained systems.\n- **ALWAYS** cache `by_type()` results when accessing the same type multiple times. The call is fast (O(1) internal index), but repeated calls add overhead in tight loops.\n- **ALWAYS** batch spatial containment and type assignments. Pass a list of products to a single API call instead of calling per-element.\n- **NEVER** store all geometry shapes in memory simultaneously. Process each shape and discard immediately.\n- **NEVER** use `get_info(recursive=True)` on large files — it materializes the entire entity graph into Python dicts.\n- **NEVER** open the same large file multiple times. Open once and pass the `model` reference.\n- **ALWAYS** call `gc.collect()` after releasing large models or between geometry processing batches.\n\n---\n\n## Essential Patterns\n\n### Pattern 1: Geometry Iterator (Batch Processing)\n\n```python\n# IfcOpenShell v0.8+: all schema versions\nimport ifcopenshell\nimport ifcopenshell.geom\nimport multiprocessing\n\nmodel = ifcopenshell.open(\"model.ifc\")\nsettings = ifcopenshell.geom.settings()\n\niterator = ifcopenshell.geom.iterator(\n    settings, model, multiprocessing.cpu_count()\n)\n\nif iterator.initialize():\n    while True:\n        shape = iterator.get()\n        element = model.by_id(shape.id)\n        verts = shape.geometry.verts   # Flat: [x1,y1,z1, x2,y2,z2, ...]\n        faces = shape.geometry.faces   # Flat: [i1,i2,i3, ...]\n        # Process immediately, do NOT accumulate shapes\n        if not iterator.next():\n            break\n```\n\n### Pattern 2: Filtered Geometry Processing\n\n```python\n# IfcOpenShell v0.8+: all schema versions\nimport ifcopenshell\nimport ifcopenshell.geom\nimport multiprocessing\n\nmodel = ifcopenshell.open(\"large_model.ifc\")\nsettings = ifcopenshell.geom.settings()\n\n# Process only walls: reduces memory and time\nwalls = model.by_type(\"IfcWall\")\niterator = ifcopenshell.geom.iterator(\n    settings, model, multiprocessing.cpu_count(),\n    include=walls\n)\n\nif iterator.initialize():\n    while True:\n        shape = iterator.get()\n        # Process shape...\n        if not iterator.next():\n            break\n```\n\n### Pattern 3: Efficient Property Extraction (No Geometry)\n\n```python\n# IfcOpenShell v0.8+: all schema versions\nimport ifcopenshell\nimport ifcopenshell.util.element\n\nmodel = ifcopenshell.open(\"large_model.ifc\")\n\n# Build pset index ONCE from relationship entities\npset_rels = model.by_type(\"IfcRelDefinesByProperties\")\npset_map = {}\nfor rel in pset_rels:\n    for obj in rel.RelatedObjects:\n        if obj.id() not in pset_map:\n            pset_map[obj.id()] = []\n        pset_map[obj.id()].append(rel.RelatingPropertyDefinition)\n\n# Now O(1) lookup per element instead of traversing relationships each time\n```\n\n### Pattern 4: Batch API Operations\n\n```python\n# IfcOpenShell v0.8+: all schema versions\nimport ifcopenshell\nimport ifcopenshell.api\n\nmodel = ifcopenshell.open(\"model.ifc\")\nstorey = model.by_type(\"IfcBuildingStorey\")[0]\nwalls = list(model.by_type(\"IfcWall\"))\n\n# CORRECT: Single API call for all elements\nifcopenshell.api.run(\"spatial.assign_container\", model,\n    relating_structure=storey, products=walls)\n# Creates ONE IfcRelContainedInSpatialStructure for all walls\n\n# CORRECT: Batch type assignment\nwall_type = model.by_type(\"IfcWallType\")[0]\nifcopenshell.api.run(\"type.assign_type\", model,\n    related_objects=walls, relating_type=wall_type)\n```\n\n### Pattern 5: Memory Management for Large Files\n\n```python\n# IfcOpenShell v0.8+: all schema versions\nimport ifcopenshell\nimport ifcopenshell.util.element\nimport gc\n\ndef extract_wall_data(filepath):\n    \"\"\"Extract wall data from large file, then release model.\"\"\"\n    model = ifcopenshell.open(filepath)\n\n    data = []\n    for wall in model.by_type(\"IfcWall\"):\n        psets = ifcopenshell.util.element.get_psets(wall)\n        data.append({\n            \"guid\": wall.GlobalId,\n            \"name\": wall.Name,\n            \"properties\": psets\n        })\n\n    # Release model and force garbage collection\n    del model\n    gc.collect()\n\n    return data  # Work with plain Python dicts from here\n```\n\n### Pattern 6: Sequential Type Processing for Very Large Files\n\n```python\n# IfcOpenShell v0.8+: all schema versions\nimport ifcopenshell\nimport ifcopenshell.geom\nimport gc\n\nmodel = ifcopenshell.open(\"huge_model.ifc\")\n\nelement_types = [\"IfcWall\", \"IfcSlab\", \"IfcColumn\", \"IfcBeam\"]\nfor etype in element_types:\n    elements = model.by_type(etype)\n    if not elements:\n        continue\n\n    settings = ifcopenshell.geom.settings()\n    iterator = ifcopenshell.geom.iterator(\n        settings, model, 4, include=elements\n    )\n\n    if iterator.initialize():\n        while True:\n            shape = iterator.get()\n            # Process and store results immediately\n            if not iterator.next():\n                break\n\n    # Force GC between types to control peak memory\n    gc.collect()\n```\n\n---\n\n## Performance Reference Tables\n\n### File Size vs Resource Usage\n\n| File Size | Approx Elements | RAM Usage | Load Time | Notes |\n|-----------|----------------|-----------|-----------|-------|\n| \u003C 10 MB | \u003C 1,000 | \u003C 200 MB | \u003C 1s | No special handling needed |\n| 10-200 MB | 1,000-50,000 | 200 MB-2 GB | 1-10s | Cache query results |\n| 200 MB-2 GB | 50,000-500,000 | 2-16 GB | 10-60s | Filter and batch everything |\n| > 2 GB | > 500,000 | 16+ GB | 60s+ | Process by type, subprocess isolation |\n\n### Geometry Iterator vs create_shape()\n\n| Aspect | `create_shape()` | `geom.iterator` |\n|--------|-----------------|-----------------|\n| Use case | Single element, interactive | Batch processing, export |\n| Multi-threading | No | Yes (OpenMP, multi-core) |\n| Geometry caching | No | Yes (reuses identical geometry) |\n| Error handling | Exception per element | Skips failed elements automatically |\n| Speed (1000 elements) | ~60s (sequential) | ~8s (8 cores) |\n| Memory per call | Lower overhead | Better amortized for many elements |\n\n### Geometry Settings for Performance\n\n| Setting | Effect | Performance Impact |\n|---------|--------|-------------------|\n| `disable-opening-subtractions` | Skips boolean CSG operations | Major speedup, less accurate geometry |\n| `use-world-coords` | Applies global transforms | Slight overhead, but avoids manual transform |\n| `weld-vertices` | Merges duplicate vertices | Smaller output, slight processing cost |\n| `apply-default-materials` | Adds material data | Required for glTF, adds overhead |\n| `dimensionality` | Controls output complexity | CURVES_SURFACES_AND_SOLIDS is slowest |\n\n### Query Performance\n\n| Method | Complexity | Notes |\n|--------|-----------|-------|\n| `model.by_type(\"IfcWall\")` | O(1) | Uses internal class index |\n| `model.by_id(42)` | O(1) | Uses internal ID map |\n| `model.by_guid(\"3Oe$...\")` | O(1) | Uses GUID index |\n| `for e in model if e.is_a(\"IfcWall\")` | O(n) | NEVER use — iterates ALL entities |\n| `ifcopenshell.util.element.get_psets(wall)` | O(k) | Traverses k relationships per call |\n| `ifcopenshell.util.selector.filter_elements(model, query)` | O(n) | Full scan, but expressive queries |\n\n---\n\n## Common Operations\n\n### Profiling IFC Operations\n\n```python\n# IfcOpenShell v0.8+: all schema versions\nimport ifcopenshell\nimport time\n\nmodel = ifcopenshell.open(\"model.ifc\")\n\n# Time file loading\nstart = time.perf_counter()\nmodel = ifcopenshell.open(\"model.ifc\")\nload_time = time.perf_counter() - start\nprint(f\"Load time: {load_time:.2f}s\")\n\n# Time by_type queries\nstart = time.perf_counter()\nwalls = model.by_type(\"IfcWall\")\nquery_time = time.perf_counter() - start\nprint(f\"by_type query: {query_time:.6f}s for {len(walls)} walls\")\n\n# Time geometry processing\nimport ifcopenshell.geom\nimport multiprocessing\n\nsettings = ifcopenshell.geom.settings()\nstart = time.perf_counter()\niterator = ifcopenshell.geom.iterator(\n    settings, model, multiprocessing.cpu_count()\n)\ncount = 0\nif iterator.initialize():\n    while True:\n        shape = iterator.get()\n        count += 1\n        if not iterator.next():\n            break\ngeom_time = time.perf_counter() - start\nprint(f\"Geometry: {count} shapes in {geom_time:.2f}s \"\n      f\"({count\u002Fgeom_time:.0f} shapes\u002Fsec)\")\n```\n\n### Controlling Thread Count for Memory\n\n```python\n# IfcOpenShell v0.8+: all schema versions\nimport ifcopenshell\nimport ifcopenshell.geom\nimport multiprocessing\nimport os\n\nmodel = ifcopenshell.open(\"large_model.ifc\")\nsettings = ifcopenshell.geom.settings()\n\n# Check available memory (Linux\u002FmacOS)\ntry:\n    import psutil\n    available_gb = psutil.virtual_memory().available \u002F (1024**3)\nexcept ImportError:\n    available_gb = 8  # Conservative fallback\n\n# Scale threads to available memory\n# Each thread can use 500MB-1GB for geometry processing\nmax_threads = multiprocessing.cpu_count()\nsafe_threads = min(max_threads, max(1, int(available_gb \u002F 1.0)))\n\niterator = ifcopenshell.geom.iterator(\n    settings, model, safe_threads\n)\n```\n\n### Subprocess Isolation for Very Large Files\n\n```python\n# IfcOpenShell v0.8+: all schema versions\nimport subprocess\nimport json\n\n# Process geometry in a subprocess to guarantee memory cleanup\n# Python's GC may not release all C++ allocated memory\nresult = subprocess.run(\n    [\"python\", \"-c\", \"\"\"\nimport ifcopenshell\nimport ifcopenshell.geom\nimport json\n\nmodel = ifcopenshell.open(\"huge_model.ifc\")\nsettings = ifcopenshell.geom.settings()\nwalls = model.by_type(\"IfcWall\")\niterator = ifcopenshell.geom.iterator(settings, model, 4, include=walls)\n\ndata = []\nif iterator.initialize():\n    while True:\n        shape = iterator.get()\n        element = model.by_id(shape.id)\n        data.append({\"guid\": element.GlobalId, \"verts\": len(shape.geometry.verts)})\n        if not iterator.next():\n            break\n\nprint(json.dumps(data))\n\"\"\"],\n    capture_output=True, text=True\n)\ndata = json.loads(result.stdout)\n# Subprocess memory is fully reclaimed by OS on exit\n```\n\n### Disabling Expensive Geometry Operations\n\n```python\n# IfcOpenShell v0.8+: all schema versions\nimport ifcopenshell\nimport ifcopenshell.geom\n\nmodel = ifcopenshell.open(\"model.ifc\")\nsettings = ifcopenshell.geom.settings()\n\n# Skip boolean operations (opening subtractions) for speed\n# Doors\u002Fwindows won't create holes in walls, but processing is much faster\nsettings.set(\"disable-opening-subtractions\", True)\n\n# Use world coordinates to avoid manual transform calculations\nsettings.set(\"use-world-coords\", True)\n```\n\n---\n\n## Version Notes\n\n### Schema Sensitivity\n\nThis skill has **low schema sensitivity**. Performance patterns apply equally to IFC2X3, IFC4, and IFC4X3 files. The geometry iterator, caching strategies, and memory management techniques are schema-independent.\n\n### IfcOpenShell Version Notes\n\n| Feature | Version | Notes |\n|---------|---------|-------|\n| `geom.iterator` | All versions | Core performance feature since early releases |\n| `geom.settings()` | All versions | String-based setting names in v0.8+ |\n| `by_type()` class index | All versions | O(1) lookup, always available |\n| `include` filter on iterator | v0.7+ | Filter elements before geometry processing |\n| Subprocess isolation | Any | Python-level pattern, not IfcOpenShell-specific |\n\n---\n\n## Reference Links\n\n- [Performance Method Signatures](references\u002Fmethods.md) — Complete API signatures for geometry processing and querying\n- [Working Performance Examples](references\u002Fexamples.md) — End-to-end optimization examples for real scenarios\n- [Performance Anti-Patterns](references\u002Fanti-patterns.md) — Common performance mistakes and how to avoid them\n","# IfcOpenShell Performance Optimization\n\n## Quick Reference\n\n### Decision Tree: Geometry Processing Strategy\n\n```\nProcessing IFC geometry?\n├── Single element (interactive\u002Fdebug)?\n│   └── ifcopenshell.geom.create_shape(settings, element)\n│\n├── Multiple elements (10+)?\n│   └── ALWAYS use ifcopenshell.geom.iterator\n│       ├── Need all elements? → iterator(settings, model, cpu_count())\n│       └── Need specific types? → iterator(settings, model, cpu_count(), include=filtered)\n│\n└── No geometry needed (data extraction only)?\n    └── Skip geometry entirely — use by_type() + get_psets()\n```\n\n### Decision Tree: Large File Strategy\n\n```\nFile size?\n├── \u003C 10 MB (small) → Standard ifcopenshell.open(), no special handling\n│\n├── 10-200 MB (medium) → Cache by_type() results, batch API calls\n│\n├── 200 MB - 2 GB (large)\n│   ├── Data only? → Load, extract to plain dicts, del model, gc.collect()\n│   ├── Geometry? → Use iterator with include filter, limit threads on low-RAM\n│   └── Repeated access? → Extract once, cache in external format\n│\n└── > 2 GB (very large)\n    ├── Needs full model? → 32+ GB RAM required\n    ├── Needs subset? → Extract IDs first, process in chunks\n    └── Geometry? → Process by type in sequence, gc.collect() between types\n```\n\n### Critical Warnings\n\n- **ALWAYS** use `ifcopenshell.geom.iterator` for batch geometry processing (10+ elements). NEVER call `create_shape()` in a loop for bulk operations — iterator is 5-10x faster.\n- **ALWAYS** pass `multiprocessing.cpu_count()` to the iterator for optimal parallelism. Reduce thread count only on memory-constrained systems.\n- **ALWAYS** cache `by_type()` results when accessing the same type multiple times. The call is fast (O(1) internal index), but repeated calls add overhead in tight loops.\n- **ALWAYS** batch spatial containment and type assignments. Pass a list of products to a single API call instead of calling per-element.\n- **NEVER** store all geometry shapes in memory simultaneously. Process each shape and discard immediately.\n- **NEVER** use `get_info(recursive=True)` on large files — it materializes the entire entity graph into Python dicts.\n- **NEVER** open the same large file multiple times. Open once and pass the `model` reference.\n- **ALWAYS** call `gc.collect()` after releasing large models or between geometry processing batches.\n\n---\n\n## Essential Patterns\n\n### Pattern 1: Geometry Iterator (Batch Processing)\n\n```python\n# IfcOpenShell v0.8+: all schema versions\nimport ifcopenshell\nimport ifcopenshell.geom\nimport multiprocessing\n\nmodel = ifcopenshell.open(\"model.ifc\")\nsettings = ifcopenshell.geom.settings()\n\niterator = ifcopenshell.geom.iterator(\n    settings, model, multiprocessing.cpu_count()\n)\n\nif iterator.initialize():\n    while True:\n        shape = iterator.get()\n        element = model.by_id(shape.id)\n        verts = shape.geometry.verts   # Flat: [x1,y1,z1, x2,y2,z2, ...]\n        faces = shape.geometry.faces   # Flat: [i1,i2,i3, ...]\n        # Process immediately, do NOT accumulate shapes\n        if not iterator.next():\n            break\n```\n\n### Pattern 2: Filtered Geometry Processing\n\n```python\n# IfcOpenShell v0.8+: all schema versions\nimport ifcopenshell\nimport ifcopenshell.geom\nimport multiprocessing\n\nmodel = ifcopenshell.open(\"large_model.ifc\")\nsettings = ifcopenshell.geom.settings()\n\n# Process only walls: reduces memory and time\nwalls = model.by_type(\"IfcWall\")\niterator = ifcopenshell.geom.iterator(\n    settings, model, multiprocessing.cpu_count(),\n    include=walls\n)\n\nif iterator.initialize():\n    while True:\n        shape = iterator.get()\n        # Process shape...\n        if not iterator.next():\n            break\n```\n\n### Pattern 3: Efficient Property Extraction (No Geometry)\n\n```python\n# IfcOpenShell v0.8+: all schema versions\nimport ifcopenshell\nimport ifcopenshell.util.element\n\nmodel = ifcopenshell.open(\"large_model.ifc\")\n\n# Build pset index ONCE from relationship entities\npset_rels = model.by_type(\"IfcRelDefinesByProperties\")\npset_map = {}\nfor rel in pset_rels:\n    for obj in rel.RelatedObjects:\n        if obj.id() not in pset_map:\n            pset_map[obj.id()] = []\n        pset_map[obj.id()].append(rel.RelatingPropertyDefinition)\n\n# Now O(1) lookup per element instead of traversing relationships each time\n```\n\n### Pattern 4: Batch API Operations\n\n```python\n# IfcOpenShell v0.8+: all schema versions\nimport ifcopenshell\nimport ifcopenshell.api\n\nmodel = ifcopenshell.open(\"model.ifc\")\nstorey = model.by_type(\"IfcBuildingStorey\")[0]\nwalls = list(model.by_type(\"IfcWall\"))\n\n# CORRECT: Single API call for all elements\nifcopenshell.api.run(\"spatial.assign_container\", model,\n    relating_structure=storey, products=walls)\n# Creates ONE IfcRelContainedInSpatialStructure for all walls\n\n# CORRECT: Batch type assignment\nwall_type = model.by_type(\"IfcWallType\")[0]\nifcopenshell.api.run(\"type.assign_type\", model,\n    related_objects=walls, relating_type=wall_type)\n```\n\n### Pattern 5: Memory Management for Large Files\n\n```python\n# IfcOpenShell v0.8+: all schema versions\nimport ifcopenshell\nimport ifcopenshell.util.element\nimport gc\n\ndef extract_wall_data(filepath):\n    \"\"\"Extract wall data from large file, then release model.\"\"\"\n    model = ifcopenshell.open(filepath)\n\n    data = []\n    for wall in model.by_type(\"IfcWall\"):\n        psets = ifcopenshell.util.element.get_psets(wall)\n        data.append({\n            \"guid\": wall.GlobalId,\n            \"name\": wall.Name,\n            \"properties\": psets\n        })\n\n    # Release model and force garbage collection\n    del model\n    gc.collect()\n\n    return data  # Work with plain Python dicts from here\n```\n\n### Pattern 6: Sequential Type Processing for Very Large Files\n\n```python\n# IfcOpenShell v0.8+: all schema versions\nimport ifcopenshell\nimport ifcopenshell.geom\nimport gc\n\nmodel = ifcopenshell.open(\"huge_model.ifc\")\n\nelement_types = [\"IfcWall\", \"IfcSlab\", \"IfcColumn\", \"IfcBeam\"]\nfor etype in element_types:\n    elements = model.by_type(etype)\n    if not elements:\n        continue\n\n    settings = ifcopenshell.geom.settings()\n    iterator = ifcopenshell.geom.iterator(\n        settings, model, 4, include=elements\n    )\n\n    if iterator.initialize():\n        while True:\n            shape = iterator.get()\n            # Process and store results immediately\n            if not iterator.next():\n                break\n\n    # Force GC between types to control peak memory\n    gc.collect()\n```\n\n---\n\n## Performance Reference Tables\n\n### File Size vs Resource Usage\n\n| File Size | Approx Elements | RAM Usage | Load Time | Notes |\n|-----------|----------------|-----------|-----------|-------|\n| \u003C 10 MB | \u003C 1,000 | \u003C 200 MB | \u003C 1s | No special handling needed |\n| 10-200 MB | 1,000-50,000 | 200 MB-2 GB | 1-10s | Cache query results |\n| 200 MB-2 GB | 50,000-500,000 | 2-16 GB | 10-60s | Filter and batch everything |\n| > 2 GB | > 500,000 | 16+ GB | 60s+ | Process by type, subprocess isolation |\n\n### Geometry Iterator vs create_shape()\n\n| Aspect | `create_shape()` | `geom.iterator` |\n|--------|-----------------|-----------------|\n| Use case | Single element, interactive | Batch processing, export |\n| Multi-threading | No | Yes (OpenMP, multi-core) |\n| Geometry caching | No | Yes (reuses identical geometry) |\n| Error handling | Exception per element | Skips failed elements automatically |\n| Speed (1000 elements) | ~60s (sequential) | ~8s (8 cores) |\n| Memory per call | Lower overhead | Better amortized for many elements |\n\n### Geometry Settings for Performance\n\n| Setting | Effect | Performance Impact |\n|---------|--------|-------------------|\n| `disable-opening-subtractions` | Skips boolean CSG operations | Major speedup, less accurate geometry |\n| `use-world-coords` | Applies global transforms | Slight overhead, but avoids manual transform |\n| `weld-vertices` | Merges duplicate vertices | Smaller output, slight processing cost |\n| `apply-default-materials` | Adds material data | Required for glTF, adds overhead |\n| `dimensionality` | Controls output complexity | CURVES_SURFACES_AND_SOLIDS is slowest |\n\n### Query Performance\n\n| Method | Complexity | Notes |\n|--------|-----------|-------|\n| `model.by_type(\"IfcWall\")` | O(1) | Uses internal class index |\n| `model.by_id(42)` | O(1) | Uses internal ID map |\n| `model.by_guid(\"3Oe$...\")` | O(1) | Uses GUID index |\n| `for e in model if e.is_a(\"IfcWall\")` | O(n) | NEVER use — iterates ALL entities |\n| `ifcopenshell.util.element.get_psets(wall)` | O(k) | Traverses k relationships per call |\n| `ifcopenshell.util.selector.filter_elements(model, query)` | O(n) | Full scan, but expressive queries |\n\n---\n\n## Common Operations\n\n### Profiling IFC Operations\n\n```python\n# IfcOpenShell v0.8+: all schema versions\nimport ifcopenshell\nimport time\n\nmodel = ifcopenshell.open(\"model.ifc\")\n\n# Time file loading\nstart = time.perf_counter()\nmodel = ifcopenshell.open(\"model.ifc\")\nload_time = time.perf_counter() - start\nprint(f\"Load time: {load_time:.2f}s\")\n\n# Time by_type queries\nstart = time.perf_counter()\nwalls = model.by_type(\"IfcWall\")\nquery_time = time.perf_counter() - start\nprint(f\"by_type query: {query_time:.6f}s for {len(walls)} walls\")\n\n# Time geometry processing\nimport ifcopenshell.geom\nimport multiprocessing\n\nsettings = ifcopenshell.geom.settings()\nstart = time.perf_counter()\niterator = ifcopenshell.geom.iterator(\n    settings, model, multiprocessing.cpu_count()\n)\ncount = 0\nif iterator.initialize():\n    while True:\n        shape = iterator.get()\n        count += 1\n        if not iterator.next():\n            break\ngeom_time = time.perf_counter() - start\nprint(f\"Geometry: {count} shapes in {geom_time:.2f}s \"\n      f\"({count\u002Fgeom_time:.0f} shapes\u002Fsec)\")\n```\n\n### Controlling Thread Count for Memory\n\n```python\n# IfcOpenShell v0.8+: all schema versions\nimport ifcopenshell\nimport ifcopenshell.geom\nimport multiprocessing\nimport os\n\nmodel = ifcopenshell.open(\"large_model.ifc\")\nsettings = ifcopenshell.geom.settings()\n\n# Check available memory (Linux\u002FmacOS)\ntry:\n    import psutil\n    available_gb = psutil.virtual_memory().available \u002F (1024**3)\nexcept ImportError:\n    available_gb = 8  # Conservative fallback\n\n# Scale threads to available memory\n# Each thread can use 500MB-1GB for geometry processing\nmax_threads = multiprocessing.cpu_count()\nsafe_threads = min(max_threads, max(1, int(available_gb \u002F 1.0)))\n\niterator = ifcopenshell.geom.iterator(\n    settings, model, safe_threads\n)\n```\n\n### Subprocess Isolation for Very Large Files\n\n```python\n# IfcOpenShell v0.8+: all schema versions\nimport subprocess\nimport json\n\n# Process geometry in a subprocess to guarantee memory cleanup\n# Python's GC may not release all C++ allocated memory\nresult = subprocess.run(\n    [\"python\", \"-c\", \"\"\"\nimport ifcopenshell\nimport ifcopenshell.geom\nimport json\n\nmodel = ifcopenshell.open(\"huge_model.ifc\")\nsettings = ifcopenshell.geom.settings()\nwalls = model.by_type(\"IfcWall\")\niterator = ifcopenshell.geom.iterator(settings, model, 4, include=walls)\n\ndata = []\nif iterator.initialize():\n    while True:\n        shape = iterator.get()\n        element = model.by_id(shape.id)\n        data.append({\"guid\": element.GlobalId, \"verts\": len(shape.geometry.verts)})\n        if not iterator.next():\n            break\n\nprint(json.dumps(data))\n\"\"\"],\n    capture_output=True, text=True\n)\ndata = json.loads(result.stdout)\n# Subprocess memory is fully reclaimed by OS on exit\n```\n\n### Disabling Expensive Geometry Operations\n\n```python\n# IfcOpenShell v0.8+: all schema versions\nimport ifcopenshell\nimport ifcopenshell.geom\n\nmodel = ifcopenshell.open(\"model.ifc\")\nsettings = ifcopenshell.geom.settings()\n\n# Skip boolean operations (opening subtractions) for speed\n# Doors\u002Fwindows won't create holes in walls, but processing is much faster\nsettings.set(\"disable-opening-subtractions\", True)\n\n# Use world coordinates to avoid manual transform calculations\nsettings.set(\"use-world-coords\", True)\n```\n\n---\n\n## Version Notes\n\n### Schema Sensitivity\n\nThis skill has **low schema sensitivity**. Performance patterns apply equally to IFC2X3, IFC4, and IFC4X3 files. The geometry iterator, caching strategies, and memory management techniques are schema-independent.\n\n### IfcOpenShell Version Notes\n\n| Feature | Version | Notes |\n|---------|---------|-------|\n| `geom.iterator` | All versions | Core performance feature since early releases |\n| `geom.settings()` | All versions | String-based setting names in v0.8+ |\n| `by_type()` class index | All versions | O(1) lookup, always available |\n| `include` filter on iterator | v0.7+ | Filter elements before geometry processing |\n| Subprocess isolation | Any | Python-level pattern, not IfcOpenShell-specific |\n\n---\n\n## Reference Links\n\n- [Performance Method Signatures](references\u002Fmethods.md) — Complete API signatures for geometry processing and querying\n- [Working Performance Examples](references\u002Fexamples.md) — End-to-end optimization examples for real scenarios\n- [Performance Anti-Patterns](references\u002Fanti-patterns.md) — Common performance mistakes and how to avoid them\n",{"name":5,"license":14,"metadata":23,"description":26,"compatibility":27},{"author":24,"version":25},"OpenAEC-Foundation","1.0","Use when processing large IFC files (100MB+) or optimizing slow IfcOpenShell scripts. Prevents the #1 performance mistake: calling create_shape() per element instead of using the geometry iterator for batch processing. Covers geometry iterator, by_type caching, batch patterns, memory management, multiprocessing strategies, and profiling. Keywords: performance, large IFC, geometry iterator, create_shape, batch processing, memory, multiprocessing, optimization, slow, 100MB, profiling, IFC file too large, takes too long, out of memory.\n","Designed for Claude Code. Requires IfcOpenShell Python library.","main","9bb7acf0c2ec4f44373969cb14e55af3c9a8385f","plugins\u002Fblender-bim-sverchok\u002Fskills\u002Fifcopenshell\u002Ferrors\u002Fifcos-errors-performance","https:\u002F\u002Fgithub.com\u002Flagzgabrielmuller-dot\u002Fkit-ingenieria-3d","https:\u002F\u002Fgithub.com\u002Flagzgabrielmuller-dot","2026-11-09 13:26:47",{"source":8,"skillName":5,"commands":35,"prompt":45,"zipAvailable":46},[36,39,42],{"tool":37,"command":38},"npx","npx skills add lagzgabrielmuller-dot\u002Fkit-ingenieria-3d --skill ifcos-errors-performance",{"tool":40,"command":41},"bunx","bunx skills add lagzgabrielmuller-dot\u002Fkit-ingenieria-3d --skill ifcos-errors-performance",{"tool":43,"command":44},"pnpm","pnpm dlx skills add lagzgabrielmuller-dot\u002Fkit-ingenieria-3d --skill ifcos-errors-performance","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Flagzgabrielmuller-dot\u002Fkit-ingenieria-3d\u002Fblob\u002Fmain\u002Fplugins\u002Fblender-bim-sverchok\u002Fskills\u002Fifcopenshell\u002Ferrors\u002Fifcos-errors-performance\u002FSKILL.md",true,[48,54,58],{"path":49,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":52,"sourceHtmlUrl":53},"references\u002Fanti-patterns.md","REFERENCE","参考文档",14763,"https:\u002F\u002Fgithub.com\u002Flagzgabrielmuller-dot\u002Fkit-ingenieria-3d\u002Fblob\u002Fmain\u002Fplugins\u002Fblender-bim-sverchok\u002Fskills\u002Fifcopenshell\u002Ferrors\u002Fifcos-errors-performance\u002Freferences\u002Fanti-patterns.md",{"path":55,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":56,"sourceHtmlUrl":57},"references\u002Fexamples.md",14135,"https:\u002F\u002Fgithub.com\u002Flagzgabrielmuller-dot\u002Fkit-ingenieria-3d\u002Fblob\u002Fmain\u002Fplugins\u002Fblender-bim-sverchok\u002Fskills\u002Fifcopenshell\u002Ferrors\u002Fifcos-errors-performance\u002Freferences\u002Fexamples.md",{"path":59,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":60,"sourceHtmlUrl":61},"references\u002Fmethods.md",9586,"https:\u002F\u002Fgithub.com\u002Flagzgabrielmuller-dot\u002Fkit-ingenieria-3d\u002Fblob\u002Fmain\u002Fplugins\u002Fblender-bim-sverchok\u002Fskills\u002Fifcopenshell\u002Ferrors\u002Fifcos-errors-performance\u002Freferences\u002Fmethods.md",[63,71,78,85,92,99],{"skillNo":64,"name":65,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":67,"sourceHtmlUrl":68,"categories":69,"keywords":70,"publishedAt":18},"01M7FBFSZ93YM463CGS91D0TZG","manimce-best-practices","Trigger when: (1) User mentions \"manim\" or \"Manim Community\" or \"ManimCE\", (2) Code contains `from manim import *`, (3) User runs `manim` CLI commands, (4) Working with Scene, MathTex, Create(), or ManimCE-specific classes.\n\nBest practices for Manim Community Edition - the community-maintained Python animation engine. Covers Scene structure, animations, LaTeX\u002FMathTex, 3D with ThreeDScene, camera control, styling, and CLI usage.\n\nNOT for ManimGL\u002F3b1b version (which uses `manimlib` imports and `manimgl` CLI).","https:\u002F\u002Fgithub.com\u002Flagzgabrielmuller-dot\u002Fkit-ingenieria-3d\u002Fblob\u002Fmain\u002Fplugins\u002Fmanim-animaciones\u002Fskills\u002Fmanimce-best-practices\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Flagzgabrielmuller-dot\u002Fkit-ingenieria-3d\u002Fblob\u002Fmain\u002Fplugins\u002Fmanim-animaciones\u002Fskills\u002Fmanimce-best-practices\u002FSKILL.md",[],[],{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":18},"01M7FB2K59HNNXS9WKHAMWHC3C","drawio","Create, edit, replicate, import, and export draw.io diagrams with an offline YAML-first workflow: architecture, network topologies, flowcharts, UML\u002FER, org charts, Mermaid\u002FCSV conversion, existing .drawio bundles, style presets, themes, and non-publication formula diagrams. For publication figures (paper, thesis, IEEE, camera-ready) use drawio-academic-skills instead.","https:\u002F\u002Fgithub.com\u002Flagzgabrielmuller-dot\u002Fkit-ingenieria-3d\u002Fblob\u002Fmain\u002Fplugins\u002Fdiagramas-y-documentos\u002Fskills\u002Fdrawio\u002FSKILL.md",[],[],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":18},"01M7FB2BWX7GWK9H2X8BGCYDDD","drawio-academic-skills","Publication-figure overlay for draw.io. Use instead of drawio whenever the diagram is for a paper, thesis, dissertation, journal, conference, IEEE\u002FACM submission, manuscript, camera-ready, Word\u002FLaTeX figure, or other publication. Applies venue, figure-type, color, caption\u002Flegend, formula, and paper-readability gates for architecture, workflow, roadmap, network-topology, and replicated paper figures.","https:\u002F\u002Fgithub.com\u002Flagzgabrielmuller-dot\u002Fkit-ingenieria-3d\u002Fblob\u002Fmain\u002Fplugins\u002Fdiagramas-y-documentos\u002Fskills\u002Fdrawio-academic-skills\u002FSKILL.md",[],[],{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":18},"01M7FB22JESEAV8T15DJT3D444","uncertainty-and-units","Tracks physical units and propagates measurement uncertainty in scientific calculations using pint and uncertainties. Use for unit conversion and dimensional checking, GUM uncertainty budgets, Type A and Type B evaluation, coverage factors and expanded uncertainty, Monte Carlo propagation, significant-figure and plus-minus reporting, error propagation through curve fits, CODATA constants, auditing Python code for stripped units or broken uncertainty propagation, and order-of-magnitude plausibility checks using dimensionless groups (Reynolds, Peclet, Damkohler, Knudsen, Biot, Womersley), characteristic scales such as diffusion time or Debye length, and observed magnitude ranges. Trigger on \"is this number physically reasonable\", \"sanity check these units\", \"what regime is this flow in\", or a result that looks off by orders of magnitude.","https:\u002F\u002Fgithub.com\u002Flagzgabrielmuller-dot\u002Fkit-ingenieria-3d\u002Fblob\u002Fmain\u002Fplugins\u002Fciencia-y-calculo\u002Fskills\u002Funcertainty-and-units\u002FSKILL.md",[],[],{"skillNo":93,"name":94,"nameZh":6,"description":95,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":18},"01M7FB1ANRSG28R335FDY9SA3R","statistical-analysis","Guided statistical analysis for research data - test selection, assumption checking, effect sizes, power analysis, Bayesian alternatives, and APA-formatted reporting. Use whenever a user wants to compare groups, test a hypothesis, analyze experimental or survey data, check statistical assumptions, compute required sample sizes, or write up results - even if they never name a specific test. Covers t-tests, ANOVA, chi-square, correlation, regression, non-parametric and Bayesian methods. For low-level model APIs, see the statsmodels and pymc skills.","https:\u002F\u002Fgithub.com\u002Flagzgabrielmuller-dot\u002Fkit-ingenieria-3d\u002Fblob\u002Fmain\u002Fplugins\u002Fciencia-y-calculo\u002Fskills\u002Fstatistical-analysis\u002FSKILL.md",[],[],{"skillNo":100,"name":101,"nameZh":6,"description":102,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":103,"categories":104,"keywords":105,"publishedAt":18},"01M7FB15KRA9D7JCPH4P9T6XJY","simpy","Builds, inspects, tests, and analyzes bounded process-based discrete-event simulations with SimPy. Use for event scheduling, resource queues, interrupts, monitoring, independent replications, warm-up, and reproducible output analysis.","https:\u002F\u002Fgithub.com\u002Flagzgabrielmuller-dot\u002Fkit-ingenieria-3d\u002Fblob\u002Fmain\u002Fplugins\u002Fciencia-y-calculo\u002Fskills\u002Fsimpy\u002FSKILL.md",[],[]]