Skip to content

Conversation

@hannesm
Copy link
Collaborator

@hannesm hannesm commented Oct 9, 2025

  • String.start_with now uses a C stub calling to memcmp, instead of String.sub (which allocates)
  • Conex_diff_provider instead of moving everything to a path (list of segments of a filename), we first do the string prefix check (to avoid allocations)
  • Conex_diff_provider: source and target return string or an exception now; previously an option was used which caused lots of allocations

And conex_verify suddenly is in the incremental setting ~10x faster (and so actually usable and not annoying). All of this was found by memtrace (statmemprof).

…ng allocation

- String.start_with now uses a C stub calling to memcmp, instead of String.sub
  (which allocates)
- Conex_diff_provider instead of moving everything to a path (list of segments
  of a filename), we first do the string prefix check (to avoid allocations)
- Conex_diff_provider: source and target return string or an exception now;
  previously an option was used which caused lots of allocations
This improves the memory footprint by reducing allocation.
@reynir
Copy link
Contributor

reynir commented Oct 10, 2025

Ah, now I see https://github.com/robur-coop/conex/pull/44/files and in that case both of my comments don't apply (they require ocaml>=4.13 and ocaml>=4.10 respectively).

@hannesm
Copy link
Collaborator Author

hannesm commented Oct 10, 2025

The goal is to have 4.08 support in conex, and conex-mirage-crypto is fine to stay with a more recent OCaml version... Since at some point conex may be integrated into opam, the goal is to have the same lower bound...

@hannesm
Copy link
Collaborator Author

hannesm commented Oct 10, 2025

The GitHub actions I ignore here, they're more relevant in #44 where I'll fix them.

On OpenBSD, the failure is Error initializing context 15747873575136:error:06FFF096:digital envelope routines:CRYPTO_internal:operation not supported for this keytype:/usr/src/lib/libcrypto/evp/pmeth_fn.c:126: -- we need to figure out how to verify ed25519 signatures with libressl delivered with current OpenBSD.

@hannesm hannesm merged commit e291a27 into main Oct 10, 2025
2 of 7 checks passed
@hannesm hannesm deleted the performance branch October 10, 2025 08:20
hannesm added a commit to hannesm/opam-repository that referenced this pull request Oct 24, 2025
CHANGES:

* Various bugfixes and quality of life improvements of the tooling
* Various fixes to the conex diff provider (robur-coop/conex#47 robur-coop/conex#49)
* Improve performance (allocate less, robur-coop/conex#43)
* Use the now separate patch library (robur-coop/conex#41)
* Avoid Format.str_formatter due to it being racy (robur-coop/conex#39 robur-coop/conex#40)
* FEATURE: Support Ed25519 signatures (robur-coop/conex#35)
* Speedup conex-verify-openssl by using sha instead of openssl dgst (robur-coop/conex#36)
* Adapt to newer dependencies (remove rresult, mirage-crypto-rng 1.2.0,
  cmdliner 2.0.0 compatibility)
* Add snapshot and timestamp support, and applications for these (robur-coop/conex#22, robur-coop/conex#26)
* Require OCaml 4.08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants