Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: rewrite the project #36

Merged
merged 1 commit into from
Sep 15, 2024
Merged

refactor: rewrite the project #36

merged 1 commit into from
Sep 15, 2024

Conversation

ianprime0509
Copy link
Owner

This is a complete rewrite of the project, using a more efficient and flexible design based around the concept of a forward-only "view" into the source document. Some capabilities are regressed in this initial implementation, including built-in non-UTF-8 support and some of the writer functionality.


Benchmark results compared to the old Reader implementation:

Benchmark 1 (43 runs): ../../zig-xml-main/bench/zig-out/bin/reader zig-out/Gtk-4.0.gir
  measurement          mean ± σ            min … max           outliers         delta
  wall_time           118ms ± 2.11ms     115ms …  125ms          1 ( 2%)        0%
  peak_rss           7.49MB ± 77.4KB    7.32MB … 7.58MB          0 ( 0%)        0%
  cpu_cycles          465M  ± 6.90M      456M  …  477M           0 ( 0%)        0%
  instructions       1.17G  ± 21.0      1.17G  … 1.17G           0 ( 0%)        0%
  cache_references   1.07M  ±  312K      728K  … 2.70M           1 ( 2%)        0%
  cache_misses       26.3K  ± 9.07K     13.3K  … 55.4K           1 ( 2%)        0%
  branch_misses      1.38M  ± 4.20K     1.38M  … 1.40M           2 ( 5%)        0%
Benchmark 2 (73 runs): zig-out/bin/reader zig-out/Gtk-4.0.gir
  measurement          mean ± σ            min … max           outliers         delta
  wall_time          68.9ms ±  626us    68.1ms … 71.4ms          4 ( 5%)        ⚡- 41.3% ±  0.4%
  peak_rss           7.53MB ± 58.3KB    7.45MB … 7.60MB          0 ( 0%)          +  0.5% ±  0.3%
  cpu_cycles          265M  ± 1.41M      262M  …  269M           0 ( 0%)        ⚡- 43.0% ±  0.4%
  instructions        604M  ± 16.8       604M  …  604M          12 (16%)        ⚡- 48.3% ±  0.0%
  cache_references    481K  ±  265K      268K  … 2.42M           5 ( 7%)        ⚡- 54.9% ± 10.1%
  cache_misses       19.8K  ± 3.77K     11.0K  … 27.5K           5 ( 7%)        ⚡- 24.6% ±  9.1%
  branch_misses       899K  ± 3.71K      893K  …  910K           2 ( 3%)        ⚡- 35.0% ±  0.1%

This is a complete rewrite of the project, using a more efficient and flexible
design based around the concept of a forward-only "view" into the source
document. Some capabilities are regressed in this initial implementation,
including built-in non-UTF-8 support and some of the writer functionality.
@ianprime0509 ianprime0509 marked this pull request as ready for review September 15, 2024 03:45
@ianprime0509
Copy link
Owner Author

Follow-up work will be to implement new features and optimizations. Aside from the core design, very little attempt at optimizing the code has been made so far.

@ianprime0509 ianprime0509 merged commit 346cb70 into main Sep 15, 2024
4 checks passed
@ianprime0509 ianprime0509 deleted the rewrite branch September 15, 2024 03:46
ianprime0509 added a commit that referenced this pull request Sep 15, 2024
Identified while migrating zig-gobject, and I forgot to update #36 before merging.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant