projectsyn / reclass-rs

Reimplementation of https://github.com/kapicorp/reclass in Rust with Python bindings through PyO3.
BSD 3-Clause "New" or "Revised" License
7 stars 0 forks source link

Treat `foo/init.yml` as content for class `foo` #82

Closed simu closed 7 months ago

simu commented 8 months ago

This ensures that the behavior of reclass-rs matches Python reclass in regards to how files named init.yml (or init.yaml) are treated.

Python reclass treats such files as content for class foo. While Project Syn doesn't make use of this mapping and instead favors having a file foo.yml alongside a folder foo/ to achieve the same behavior, we want to ensure that reclass-rs is compatible with as many Reclass inventories as possible.

Notably, Python reclass also resolves relative includes in such files as relative to the parent directory of the directory containing the file. For example, relative includes in foo/init.yml are treated relative to the directory holding foo and not relative to directory foo.

This is a breaking change for users which rely on the current reclass-rs behavior of handling files named init.yml, since such files can no longer be included as foo.init.

Checklist

github-actions[bot] commented 8 months ago

Benchmark for f339e72

Click to view benchmark | Test | Base | PR | % | |------|--------------|------------------|---| | Reclass::inventory() multi-threaded | 1531.4±50.76µs | 1553.1±112.86µs | +1.42% | | Reclass::inventory() single-threaded | 3.5±0.03ms | 3.5±0.16ms | 0.00% |
github-actions[bot] commented 8 months ago

Benchmark for ad78bcc

Click to view benchmark | Test | Base | PR | % | |------|--------------|------------------|---| | Reclass::inventory() multi-threaded | 1584.3±116.02µs | 1617.6±50.99µs | +2.10% | | Reclass::inventory() single-threaded | **3.4±0.03ms** | 3.6±0.31ms | **+5.88%** |
github-actions[bot] commented 8 months ago

Benchmark for 4ca531c

Click to view benchmark | Test | Base | PR | % | |------|--------------|------------------|---| | Reclass::inventory() multi-threaded | **1533.6±47.01µs** | 1628.9±130.80µs | **+6.21%** | | Reclass::inventory() single-threaded | **3.4±0.09ms** | 3.6±0.04ms | **+5.88%** |
github-actions[bot] commented 8 months ago

Benchmark for 352b8da

Click to view benchmark | Test | Base | PR | % | |------|--------------|------------------|---| | Reclass::inventory() multi-threaded | 1566.7±111.10µs | 1610.5±90.76µs | +2.80% | | Reclass::inventory() single-threaded | **3.4±0.04ms** | 3.6±0.14ms | **+5.88%** |
github-actions[bot] commented 8 months ago

Benchmark for b813260

Click to view benchmark | Test | Base | PR | % | |------|--------------|------------------|---| | Reclass::inventory() multi-threaded | 1557.7±109.88µs | 1626.3±133.17µs | +4.40% | | Reclass::inventory() single-threaded | **3.4±0.05ms** | 3.6±0.08ms | **+5.88%** |
github-actions[bot] commented 8 months ago

Benchmark for 1cf7c52 (new implementation without additional inventory node)

Click to view benchmark | Test | Base | PR | % | |------|--------------|------------------|---| | Reclass::inventory() multi-threaded | 1559.1±107.59µs | 1531.1±52.24µs | -1.80% | | Reclass::inventory() single-threaded | 3.5±0.15ms | 3.5±0.04ms | 0.00% |
github-actions[bot] commented 8 months ago

Benchmark for a6561c0 (new implementation + additional inventory node)

Click to view benchmark | Test | Base | PR | % | |------|--------------|------------------|---| | Reclass::inventory() multi-threaded | 1582.2±90.12µs | 1646.6±146.58µs | +4.07% | | Reclass::inventory() single-threaded | **3.5±0.04ms** | 3.6±0.14ms | **+2.86%** |
github-actions[bot] commented 8 months ago

Benchmark for 70addae (new impl, no additional inventory contents)

Click to view benchmark | Test | Base | PR | % | |------|--------------|------------------|---| | Reclass::inventory() multi-threaded | 1533.3±65.24µs | 1549.4±119.12µs | +1.05% | | Reclass::inventory() single-threaded | 3.4±0.04ms | 3.4±0.04ms | 0.00% |
github-actions[bot] commented 8 months ago

Benchmark for ec55279 (new impl + new inventory node)

Click to view benchmark | Test | Base | PR | % | |------|--------------|------------------|---| | Reclass::inventory() multi-threaded | **1534.1±50.93µs** | 1612.8±115.73µs | **+5.13%** | | Reclass::inventory() single-threaded | **3.4±0.03ms** | 3.6±0.09ms | **+5.88%** |
simu commented 8 months ago

Performance impact of the implementation change is negligible, benchmarked performance is lower for the complete PR because we add an additional node to the inventory that we use for the benchmark.

github-actions[bot] commented 7 months ago

Benchmark for 04ee8f1 (new impl + new inventory node)

Click to view benchmark | Test | Base | PR | % | |------|--------------|------------------|---| | Reclass::inventory() multi-threaded | 1578.5±113.65µs | 1598.6±88.07µs | +1.27% | | Reclass::inventory() single-threaded | **3.5±0.05ms** | 3.6±0.04ms | **+2.86%** |
github-actions[bot] commented 7 months ago

Benchmark for 7e8866c (new impl, no inventory changes)

Click to view benchmark | Test | Base | PR | % | |------|--------------|------------------|---| | Reclass::inventory() multi-threaded | 1453.7±107.00µs | 1450.9±80.94µs | -0.19% | | Reclass::inventory() single-threaded | 3.3±0.11ms | **3.2±0.08ms** | **-3.03%** |
github-actions[bot] commented 7 months ago

Benchmark for 3ba3a9a (new impl + new inventory node)

Click to view benchmark | Test | Base | PR | % | |------|--------------|------------------|---| | Reclass::inventory() multi-threaded | **1533.7±47.84µs** | 1607.9±120.60µs | **+4.84%** | | Reclass::inventory() single-threaded | 3.5±0.23ms | 3.5±0.04ms | 0.00% |
github-actions[bot] commented 7 months ago

Benchmark for 4eeb47b

Click to view benchmark | Test | Base | PR | % | |------|--------------|------------------|---| | Reclass::inventory() multi-threaded | 1553.8±116.85µs | 1581.8±61.45µs | +1.80% | | Reclass::inventory() single-threaded | **3.4±0.03ms** | 3.6±0.04ms | **+5.88%** |
github-actions[bot] commented 7 months ago

Benchmark for 792be1f

Click to view benchmark | Test | Base | PR | % | |------|--------------|------------------|---| | Reclass::inventory() multi-threaded | 1562.1±124.99µs | 1586.2±52.45µs | +1.54% | | Reclass::inventory() single-threaded | **3.5±0.17ms** | 3.6±0.02ms | **+2.86%** |