This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| """Run a custom FUSE filesystem inside a BoxLite VM.""" | |
| import asyncio | |
| from pathlib import Path | |
| import boxlite | |
| HERE = Path(__file__).parent |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 # Shebang for direct execution | |
| import asyncio # Async runtime for SimpleBox | |
| import boxlite # BoxLite Python SDK | |
| import textwrap # Embed the guest-side FUSE script as a string | |
| # Minimal FUSE filesystem served inside the box (as a multi-line string) | |
| FUSE_SCRIPT = textwrap.dedent(r""" | |
| #!/usr/bin/env python3 # Guest-side shebang | |
| import os, sys, time, stat # Stdlib imports inside guest | |
| from mfusepy import FUSE, Operations # FUSE bindings inside guest |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Latency Comparison Numbers | |
| -------------------------- | |
| L1 cache reference/hit 1.5 ns 4 cycles | |
| Floating-point add/mult/FMA operation 1.5 ns 4 cycles | |
| L2 cache reference/hit 5 ns 12 ~ 17 cycles | |
| Branch mispredict 6 ns 15 ~ 20 cycles | |
| L3 cache hit (unshared cache line) 16 ns 42 cycles | |
| L3 cache hit (shared line in another core) 25 ns 65 cycles | |
| Mutex lock/unlock 25 ns | |
| L3 cache hit (modified in another core) 29 ns 75 cycles |