123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886(* The [File_path] library has been constructed carefully with respect to performance,
especially allocation. We benchmark (nearly) every function so we can check features
for performance improvements / regressions.
We constrain these modules to the interface of [File_path] and its submodules to make
sure we have benchmarked all appropriate bindings. Whenever a new binding in
[File_path] forces us to add a new binding here, we should add a new benchmark unless
there is a pressing reason not to.
For ppx-derived and functor-generated bindings, we test only a few functions. Otherwise
we test every function. Where there are multiple cases, we try to benchmark all
meaningfully different paths that do not raise.
We define all benchmarks using [let%bench_fun], and bind all function arguments outside
the final closure, wrapped in [Sys.opaque_identity]. This guarantees that computing the
argument is not part of what we time, and that the closure cannot be specialized to the
argument value. *)open!Coretypet=File_path.t[@@derivingquickcheck,sexp,sexp_grammar]letarg_type=File_path.arg_typeletroot=File_path.rootletdot=File_path.dotletdot_dot=File_path.dot_dotinclude(File_path:Identifiable.Swithtypet:=tandtypecomparator_witness=File_path.comparator_witness)let%bench_fun"equal ="=letx=Sys.opaque_identity(of_string"foo/bar/baz")inlety=Sys.opaque_identity(of_string"foo/bar/baz")infun()->equalxy;;let%bench_fun"equal <>"=letx=Sys.opaque_identity(of_string"/foo/bar/baz")inlety=Sys.opaque_identity(of_string"foo/bar/baz")infun()->equalxy;;let%bench_fun"compare ="=letx=Sys.opaque_identityrootinlety=Sys.opaque_identityrootinfun()->comparexy;;let%bench_fun"compare <"=letx=Sys.opaque_identityrootinlety=Sys.opaque_identitydot_dotinfun()->comparexy;;let%bench_fun"compare >"=letx=Sys.opaque_identitydot_dotinlety=Sys.opaque_identityrootinfun()->comparexy;;let%bench_fun"of_string, canonical"=letstring=Sys.opaque_identity"/foo/bar/baz"infun()->of_stringstring;;let%bench_fun"of_string, non-canonical"=letstring=Sys.opaque_identity"/foo//bar/baz/"infun()->of_stringstring;;let%bench_fun"to_string"=lett=Sys.opaque_identity(of_string"/foo/bar/baz")infun()->to_stringt;;let%bench_fun"t_of_sexp, canonical"=letstring=Sys.opaque_identity(Sexp.Atom"/foo/bar/baz")infun()->t_of_sexpstring;;let%bench_fun"t_of_sexp, non-canonical"=letstring=Sys.opaque_identity(Sexp.Atom"/foo//bar/baz/")infun()->t_of_sexpstring;;let%bench_fun"sexp_of_t"=lett=Sys.opaque_identity(of_string"/foo/bar/baz")infun()->sexp_of_tt;;moduleExpert=structletunchecked_of_canonical_string=File_path.Expert.unchecked_of_canonical_stringlet%bench_fun"unchecked_of_canonical_string"=letstring=Sys.opaque_identity"/foo/bar/baz"infun()->unchecked_of_canonical_stringstring;;endletinvariant=File_path.invariantlet%bench_fun"invariant"=lett=Sys.opaque_identity(of_string"/foo/bar/baz")infun()->invariantt;;letis_relative=File_path.is_relativelet%bench_fun"is_relative"=lett=Sys.opaque_identity(of_string"/foo/bar/baz")infun()->is_relativet;;letis_absolute=File_path.is_absolutelet%bench_fun"is_absolute"=lett=Sys.opaque_identity(of_string"/foo/bar/baz")infun()->is_absolutet;;letto_absolute=File_path.to_absolutelet%bench_fun"to_absolute, some"=lett=Sys.opaque_identity(of_string"/foo/bar/baz")infun()->to_absolutet;;let%bench_fun"to_absolute, none"=lett=Sys.opaque_identity(of_string"foo/bar/baz")infun()->to_absolutet;;letto_relative=File_path.to_relativelet%bench_fun"to_relative, some"=lett=Sys.opaque_identity(of_string"foo/bar/baz")infun()->to_relativet;;let%bench_fun"to_relative, none"=lett=Sys.opaque_identity(of_string"/foo/bar/baz")infun()->to_relativet;;letto_absolute_exn=File_path.to_absolute_exnlet%bench_fun"to_absolute_exn"=lett=Sys.opaque_identity(of_string"/foo/bar/baz")infun()->to_absolute_exnt;;letto_relative_exn=File_path.to_relative_exnlet%bench_fun"to_relative_exn"=lett=Sys.opaque_identity(of_string"foo/bar/baz")infun()->to_relative_exnt;;letto_absolute_or_error=File_path.to_absolute_or_errorlet%bench_fun"to_absolute_or_error"=lett=Sys.opaque_identity(of_string"/foo/bar/baz")infun()->to_absolute_or_errort;;letto_relative_or_error=File_path.to_relative_or_errorlet%bench_fun"to_relative_or_error"=lett=Sys.opaque_identity(of_string"foo/bar/baz")infun()->to_relative_or_errort;;letof_absolute=File_path.of_absolutelet%bench_fun"of_absolute"=letabsolute=Sys.opaque_identity(File_path.Absolute.of_string"/foo/bar/baz")infun()->of_absoluteabsolute;;letof_relative=File_path.of_relativelet%bench_fun"of_relative"=letrelative=Sys.opaque_identity(File_path.Relative.of_string"foo/bar/baz")infun()->of_relativerelative;;letof_part_relative=File_path.of_part_relativelet%bench_fun"of_part_relative"=letpart=Sys.opaque_identity(File_path.Part.of_string"foo")infun()->of_part_relativepart;;letbasename=File_path.basenamelet%bench_fun"basename, absolute some"=lett=Sys.opaque_identity(of_string"/foo/bar/baz")infun()->basenamet;;let%bench_fun"basename, absolute none"=lett=Sys.opaque_identityrootinfun()->basenamet;;let%bench_fun"basename, relative some"=lett=Sys.opaque_identity(of_string"foo/bar/baz")infun()->basenamet;;letbasename_exn=File_path.basename_exnlet%bench_fun"basename_exn, absolute"=lett=Sys.opaque_identity(of_string"/foo/bar/baz")infun()->basename_exnt;;let%bench_fun"basename_exn, relative"=lett=Sys.opaque_identity(of_string"foo/bar/baz")infun()->basename_exnt;;letbasename_or_error=File_path.basename_or_errorlet%bench_fun"basename_or_error, absolute"=lett=Sys.opaque_identity(of_string"/foo/bar/baz")infun()->basename_or_errort;;let%bench_fun"basename_or_error, relative"=lett=Sys.opaque_identity(of_string"foo/bar/baz")infun()->basename_or_errort;;letbasename_defaulting_to_dot=File_path.basename_defaulting_to_dotlet%bench_fun"basename_defaulting_to_dot, absolute name"=lett=Sys.opaque_identity(of_string"/foo/bar/baz")infun()->basename_defaulting_to_dott;;let%bench_fun"basename_defaulting_to_dot, absolute dot"=lett=Sys.opaque_identityrootinfun()->basename_defaulting_to_dott;;let%bench_fun"basename_defaulting_to_dot, relative name"=lett=Sys.opaque_identity(of_string"foo/bar/baz")infun()->basename_defaulting_to_dott;;letdirname=File_path.dirnamelet%bench_fun"dirname, absolute some"=lett=Sys.opaque_identity(of_string"/foo/bar/baz")infun()->dirnamet;;let%bench_fun"dirname, absolute none"=lett=Sys.opaque_identityrootinfun()->dirnamet;;let%bench_fun"dirname, relative some"=lett=Sys.opaque_identity(of_string"foo/bar/baz")infun()->dirnamet;;let%bench_fun"dirname, relative none"=lett=Sys.opaque_identity(of_string"foo.bar.baz")infun()->dirnamet;;letdirname_exn=File_path.dirname_exnlet%bench_fun"dirname_exn, absolute"=lett=Sys.opaque_identity(of_string"/foo/bar/baz")infun()->dirname_exnt;;let%bench_fun"dirname_exn, relative"=lett=Sys.opaque_identity(of_string"foo/bar/baz")infun()->dirname_exnt;;letdirname_or_error=File_path.dirname_or_errorlet%bench_fun"dirname_or_error, absolute"=lett=Sys.opaque_identity(of_string"/foo/bar/baz")infun()->dirname_or_errort;;let%bench_fun"dirname_or_error, relative"=lett=Sys.opaque_identity(of_string"foo/bar/baz")infun()->dirname_or_errort;;letdirname_defaulting_to_dot_or_root=File_path.dirname_defaulting_to_dot_or_rootlet%bench_fun"dirname_defaulting_to_dot_or_root, absolute dir"=lett=Sys.opaque_identity(of_string"/foo/bar/baz")infun()->dirname_defaulting_to_dot_or_roott;;let%bench_fun"dirname_defaulting_to_dot_or_root, absolute root"=lett=Sys.opaque_identityrootinfun()->dirname_defaulting_to_dot_or_roott;;let%bench_fun"dirname_defaulting_to_dot_or_root, relative dir"=lett=Sys.opaque_identity(of_string"foo/bar/baz")infun()->dirname_defaulting_to_dot_or_roott;;let%bench_fun"dirname_defaulting_to_dot_or_root, relative dot"=lett=Sys.opaque_identity(of_string"foo.bar.baz")infun()->dirname_defaulting_to_dot_or_roott;;letdirname_and_basename=File_path.dirname_and_basenamelet%bench_fun"dirname_and_basename, absolute some"=lett=Sys.opaque_identity(of_string"/foo/bar/baz")infun()->dirname_and_basenamet;;let%bench_fun"dirname_and_basename, absolute none"=lett=Sys.opaque_identityrootinfun()->dirname_and_basenamet;;let%bench_fun"dirname_and_basename, relative some"=lett=Sys.opaque_identity(of_string"foo/bar/baz")infun()->dirname_and_basenamet;;let%bench_fun"dirname_and_basename, relative none"=lett=Sys.opaque_identity(of_string"foo.bar.baz")infun()->dirname_and_basenamet;;letappend_to_basename_exn=File_path.append_to_basename_exnlet%bench_fun"append_to_basename_exn, absolute, empty"=lett=Sys.opaque_identity(of_string"/foo/bar")inletsuffix=Sys.opaque_identity""infun()->append_to_basename_exntsuffix;;let%bench_fun"append_to_basename_exn, absolute, nonempty"=lett=Sys.opaque_identity(of_string"/foo/bar")inletsuffix=Sys.opaque_identity".baz"infun()->append_to_basename_exntsuffix;;let%bench_fun"append_to_basename_exn, relative, empty"=lett=Sys.opaque_identity(of_string"foo/bar")inletsuffix=Sys.opaque_identity""infun()->append_to_basename_exntsuffix;;let%bench_fun"append_to_basename_exn, relative, nonempty"=lett=Sys.opaque_identity(of_string"foo/bar")inletsuffix=Sys.opaque_identity".baz"infun()->append_to_basename_exntsuffix;;letappend_part=File_path.append_partlet%bench_fun"append_part, root"=lett=Sys.opaque_identityrootinletsuffix=Sys.opaque_identity(File_path.Part.of_string"foo")infun()->append_parttsuffix;;let%bench_fun"append_part, absolute"=lett=Sys.opaque_identity(of_string"/foo/bar")inletsuffix=Sys.opaque_identity(File_path.Part.of_string"baz")infun()->append_parttsuffix;;let%bench_fun"append_part, relative"=lett=Sys.opaque_identity(of_string"foo/bar")inletsuffix=Sys.opaque_identity(File_path.Part.of_string"baz")infun()->append_parttsuffix;;letis_prefix=File_path.is_prefixlet%bench_fun"is_prefix, absolute true"=lett=Sys.opaque_identity(of_string"/foo/bar/baz")inletprefix=Sys.opaque_identity(of_string"/foo/bar")infun()->is_prefixt~prefix;;let%bench_fun"is_prefix, absolute false"=lett=Sys.opaque_identity(of_string"/foo/bar/baz")inletprefix=Sys.opaque_identity(of_string"/foobie")infun()->is_prefixt~prefix;;let%bench_fun"is_prefix, relative true"=lett=Sys.opaque_identity(of_string"foo/bar/baz")inletprefix=Sys.opaque_identity(of_string"foo/bar")infun()->is_prefixt~prefix;;let%bench_fun"is_prefix, relative false"=lett=Sys.opaque_identity(of_string"foo/bar/baz")inletprefix=Sys.opaque_identity(of_string"foobie")infun()->is_prefixt~prefix;;letchop_prefix=File_path.chop_prefixlet%bench_fun"chop_prefix, absolute some"=lett=Sys.opaque_identity(of_string"/foo/bar/baz")inletprefix=Sys.opaque_identity(of_string"/foo/bar")infun()->chop_prefixt~prefix;;let%bench_fun"chop_prefix, absolute none"=lett=Sys.opaque_identity(of_string"/foo/bar/baz")inletprefix=Sys.opaque_identity(of_string"/foobie")infun()->chop_prefixt~prefix;;let%bench_fun"chop_prefix, relative some"=lett=Sys.opaque_identity(of_string"foo/bar/baz")inletprefix=Sys.opaque_identity(of_string"foo/bar")infun()->chop_prefixt~prefix;;let%bench_fun"chop_prefix, relative none"=lett=Sys.opaque_identity(of_string"foo/bar/baz")inletprefix=Sys.opaque_identity(of_string"foobie")infun()->chop_prefixt~prefix;;letchop_prefix_exn=File_path.chop_prefix_exnlet%bench_fun"chop_prefix_exn, absolute"=lett=Sys.opaque_identity(of_string"/foo/bar/baz")inletprefix=Sys.opaque_identity(of_string"/foo/bar")infun()->chop_prefix_exnt~prefix;;let%bench_fun"chop_prefix_exn, relative"=lett=Sys.opaque_identity(of_string"foo/bar/baz")inletprefix=Sys.opaque_identity(of_string"foo/bar")infun()->chop_prefix_exnt~prefix;;letchop_prefix_or_error=File_path.chop_prefix_or_errorlet%bench_fun"chop_prefix_or_error, absolute"=lett=Sys.opaque_identity(of_string"/foo/bar/baz")inletprefix=Sys.opaque_identity(of_string"/foo/bar")infun()->chop_prefix_or_errort~prefix;;let%bench_fun"chop_prefix_or_error, relative"=lett=Sys.opaque_identity(of_string"foo/bar/baz")inletprefix=Sys.opaque_identity(of_string"foo/bar")infun()->chop_prefix_or_errort~prefix;;letchop_prefix_if_exists=File_path.chop_prefix_if_existslet%bench_fun"chop_prefix_if_exists, absolute"=lett=Sys.opaque_identity(of_string"/foo/bar/baz")inletprefix=Sys.opaque_identity(of_string"/foo/bar")infun()->chop_prefix_if_existst~prefix;;let%bench_fun"chop_prefix_if_exists, relative"=lett=Sys.opaque_identity(of_string"foo/bar/baz")inletprefix=Sys.opaque_identity(of_string"foo/bar")infun()->chop_prefix_if_existst~prefix;;letis_suffix=File_path.is_suffixlet%bench_fun"is_suffix, absolute true"=lett=Sys.opaque_identity(of_string"/foo/bar/baz")inletsuffix=Sys.opaque_identity(File_path.Relative.of_string"bar/baz")infun()->is_suffixt~suffix;;let%bench_fun"is_suffix, absolute false"=lett=Sys.opaque_identity(of_string"/foo/bar/baz")inletsuffix=Sys.opaque_identity(File_path.Relative.of_string"barbie")infun()->is_suffixt~suffix;;let%bench_fun"is_suffix, relative true"=lett=Sys.opaque_identity(of_string"foo/bar/baz")inletsuffix=Sys.opaque_identity(File_path.Relative.of_string"bar/baz")infun()->is_suffixt~suffix;;let%bench_fun"is_suffix, relative false"=lett=Sys.opaque_identity(of_string"foo/bar/baz")inletsuffix=Sys.opaque_identity(File_path.Relative.of_string"barbie")infun()->is_suffixt~suffix;;letchop_suffix=File_path.chop_suffixlet%bench_fun"chop_suffix, absolute some"=lett=Sys.opaque_identity(of_string"/foo/bar/baz")inletsuffix=Sys.opaque_identity(File_path.Relative.of_string"bar/baz")infun()->chop_suffixt~suffix;;let%bench_fun"chop_suffix, absolute none"=lett=Sys.opaque_identity(of_string"/foo/bar/baz")inletsuffix=Sys.opaque_identity(File_path.Relative.of_string"barbie")infun()->chop_suffixt~suffix;;let%bench_fun"chop_suffix, relative some"=lett=Sys.opaque_identity(of_string"foo/bar/baz")inletsuffix=Sys.opaque_identity(File_path.Relative.of_string"bar/baz")infun()->chop_suffixt~suffix;;let%bench_fun"chop_suffix, relative none"=lett=Sys.opaque_identity(of_string"foo/bar/baz")inletsuffix=Sys.opaque_identity(File_path.Relative.of_string"barbie")infun()->chop_suffixt~suffix;;letchop_suffix_exn=File_path.chop_suffix_exnlet%bench_fun"chop_suffix_exn, absolute"=lett=Sys.opaque_identity(of_string"/foo/bar/baz")inletsuffix=Sys.opaque_identity(File_path.Relative.of_string"bar/baz")infun()->chop_suffix_exnt~suffix;;let%bench_fun"chop_suffix_exn, relative"=lett=Sys.opaque_identity(of_string"foo/bar/baz")inletsuffix=Sys.opaque_identity(File_path.Relative.of_string"bar/baz")infun()->chop_suffix_exnt~suffix;;letchop_suffix_or_error=File_path.chop_suffix_or_errorlet%bench_fun"chop_suffix_or_error, absolute"=lett=Sys.opaque_identity(of_string"/foo/bar/baz")inletsuffix=Sys.opaque_identity(File_path.Relative.of_string"bar/baz")infun()->chop_suffix_or_errort~suffix;;let%bench_fun"chop_suffix_or_error, relative"=lett=Sys.opaque_identity(of_string"foo/bar/baz")inletsuffix=Sys.opaque_identity(File_path.Relative.of_string"bar/baz")infun()->chop_suffix_or_errort~suffix;;letchop_suffix_if_exists=File_path.chop_suffix_if_existslet%bench_fun"chop_suffix_if_exists, absolute"=lett=Sys.opaque_identity(of_string"/foo/bar/baz")inletsuffix=Sys.opaque_identity(File_path.Relative.of_string"bar/baz")infun()->chop_suffix_if_existst~suffix;;let%bench_fun"chop_suffix_if_exists, relative"=lett=Sys.opaque_identity(of_string"foo/bar/baz")inletsuffix=Sys.opaque_identity(File_path.Relative.of_string"bar/baz")infun()->chop_suffix_if_existst~suffix;;letappend=File_path.appendlet%bench_fun"append, root"=letprefix=Sys.opaque_identityrootinletsuffix=Sys.opaque_identity(File_path.Relative.of_string"bar/baz")infun()->appendprefixsuffix;;let%bench_fun"append, absolute"=letprefix=Sys.opaque_identity(of_string"/foo")inletsuffix=Sys.opaque_identity(File_path.Relative.of_string"bar/baz")infun()->appendprefixsuffix;;let%bench_fun"append, relative"=letprefix=Sys.opaque_identity(of_string"foo")inletsuffix=Sys.opaque_identity(File_path.Relative.of_string"bar/baz")infun()->appendprefixsuffix;;letnumber_of_parts=File_path.number_of_partslet%bench_fun"number_of_parts, root"=lett=Sys.opaque_identityrootinfun()->number_of_partst;;let%bench_fun"number_of_parts, dot"=lett=Sys.opaque_identitydotinfun()->number_of_partst;;let%bench_fun"number_of_parts, absolute compound"=lett=Sys.opaque_identity(of_string"/foo/bar/baz")infun()->number_of_partst;;let%bench_fun"number_of_parts, relative compound"=lett=Sys.opaque_identity(of_string"foo/bar/baz")infun()->number_of_partst;;letto_parts=File_path.to_partslet%bench_fun"to_parts, root"=lett=Sys.opaque_identityrootinfun()->to_partst;;let%bench_fun"to_parts, dot"=lett=Sys.opaque_identitydotinfun()->to_partst;;let%bench_fun"to_parts, absolute"=lett=Sys.opaque_identity(of_string"/foo/bar/baz")infun()->to_partst;;let%bench_fun"to_parts, relative"=lett=Sys.opaque_identity(of_string"foo/bar/baz")infun()->to_partst;;letof_parts_absolute=File_path.of_parts_absolutelet%bench_fun"of_parts_absolute"=letparts=Sys.opaque_identity[File_path.Part.of_string"foo";File_path.Part.of_string"bar";File_path.Part.of_string"baz"]infun()->of_parts_absoluteparts;;letof_parts_relative=File_path.of_parts_relativelet%bench_fun"of_parts_relative, empty"=letparts=Sys.opaque_identity[]infun()->of_parts_relativeparts;;let%bench_fun"of_parts_relative, non-empty"=letparts=Sys.opaque_identity[File_path.Part.of_string"foo";File_path.Part.of_string"bar";File_path.Part.of_string"baz"]infun()->of_parts_relativeparts;;letof_parts_relative_exn=File_path.of_parts_relative_exnlet%bench_fun"of_parts_relative_exn"=letparts=Sys.opaque_identity[File_path.Part.of_string"foo";File_path.Part.of_string"bar";File_path.Part.of_string"baz"]infun()->of_parts_relative_exnparts;;letof_parts_relative_or_error=File_path.of_parts_relative_or_errorlet%bench_fun"of_parts_relative_or_error"=letparts=Sys.opaque_identity[File_path.Part.of_string"foo";File_path.Part.of_string"bar";File_path.Part.of_string"baz"]infun()->of_parts_relative_or_errorparts;;letof_parts_relative_defaulting_to_dot=File_path.of_parts_relative_defaulting_to_dotlet%bench_fun"of_parts_relative_defaulting_to_dot, empty"=letparts=Sys.opaque_identity[]infun()->of_parts_relative_defaulting_to_dotparts;;let%bench_fun"of_parts_relative_defaulting_to_dot, non-empty"=letparts=Sys.opaque_identity[File_path.Part.of_string"foo";File_path.Part.of_string"bar";File_path.Part.of_string"baz"]infun()->of_parts_relative_defaulting_to_dotparts;;letof_parts_relative_nonempty=File_path.of_parts_relative_nonemptylet%bench_fun"of_parts_relative_nonempty"=letparts=Sys.opaque_identity([File_path.Part.of_string"foo";File_path.Part.of_string"bar";File_path.Part.of_string"baz"]:_Nonempty_list.t)infun()->of_parts_relative_nonemptyparts;;letmake_absolute=File_path.make_absolutelet%bench_fun"make_absolute, absolute"=lett=Sys.opaque_identity(of_string"/foo/bar/baz")inletunder=Sys.opaque_identity(File_path.Absolute.of_string"/foo")infun()->make_absolutet~under;;let%bench_fun"make_absolute, relative"=lett=Sys.opaque_identity(of_string"bar/baz")inletunder=Sys.opaque_identity(File_path.Absolute.of_string"/foo")infun()->make_absolutet~under;;letmake_relative=File_path.make_relativelet%bench_fun"make_relative, absolute under"=lett=Sys.opaque_identity(of_string"/foo/bar/baz")inletif_under=Sys.opaque_identity(File_path.Absolute.of_string"/foo")infun()->make_relativet~if_under;;let%bench_fun"make_relative, absolute not-under"=lett=Sys.opaque_identity(of_string"/foo/bar/baz")inletif_under=Sys.opaque_identity(File_path.Absolute.of_string"/foobie")infun()->make_relativet~if_under;;let%bench_fun"make_relative, relative"=lett=Sys.opaque_identity(of_string"bar/baz")inletif_under=Sys.opaque_identity(File_path.Absolute.of_string"/foo")infun()->make_relativet~if_under;;letmake_relative_exn=File_path.make_relative_exnlet%bench_fun"make_relative_exn, absolute"=lett=Sys.opaque_identity(of_string"/foo/bar/baz")inletif_under=Sys.opaque_identity(File_path.Absolute.of_string"/foo")infun()->make_relative_exnt~if_under;;let%bench_fun"make_relative_exn, relative"=lett=Sys.opaque_identity(of_string"bar/baz")inletif_under=Sys.opaque_identity(File_path.Absolute.of_string"/foo")infun()->make_relative_exnt~if_under;;letmake_relative_or_error=File_path.make_relative_or_errorlet%bench_fun"make_relative_or_error, absolute"=lett=Sys.opaque_identity(of_string"/foo/bar/baz")inletif_under=Sys.opaque_identity(File_path.Absolute.of_string"/foo")infun()->make_relative_or_errort~if_under;;let%bench_fun"make_relative_or_error, relative"=lett=Sys.opaque_identity(of_string"bar/baz")inletif_under=Sys.opaque_identity(File_path.Absolute.of_string"/foo")infun()->make_relative_or_errort~if_under;;letmake_relative_if_possible=File_path.make_relative_if_possiblelet%bench_fun"make_relative_if_possible, absolute under"=lett=Sys.opaque_identity(of_string"/foo/bar/baz")inletif_under=Sys.opaque_identity(File_path.Absolute.of_string"/foo")infun()->make_relative_if_possiblet~if_under;;let%bench_fun"make_relative_if_possible, absolute not-under"=lett=Sys.opaque_identity(of_string"/foo/bar/baz")inletif_under=Sys.opaque_identity(File_path.Absolute.of_string"/foobie")infun()->make_relative_if_possiblet~if_under;;let%bench_fun"make_relative_if_possible, relative"=lett=Sys.opaque_identity(of_string"bar/baz")inletif_under=Sys.opaque_identity(File_path.Absolute.of_string"/foo")infun()->make_relative_if_possiblet~if_under;;moduleVariant=File_path.Variantletto_variant=File_path.to_variantlet%bench_fun"to_variant, absolute"=lett=Sys.opaque_identity(of_string"/foo/bar/baz")infun()->to_variantt;;let%bench_fun"to_variant, relative"=lett=Sys.opaque_identity(of_string"foo/bar/baz")infun()->to_variantt;;letof_variant=File_path.of_variantlet%bench_fun"of_variant, absolute"=letvariant=Sys.opaque_identity(Variant.Absolute(File_path.Absolute.of_string"/foo/bar/baz"))infun()->of_variantvariant;;let%bench_fun"of_variant, relative"=letvariant=Sys.opaque_identity(Variant.Relative(File_path.Relative.of_string"foo/bar/baz"))infun()->of_variantvariant;;letsimplify_dot=File_path.simplify_dotlet%bench_fun"simplify_dot, absolute unchanged"=lett=Sys.opaque_identity(of_string"/foo/bar/baz")infun()->simplify_dott;;let%bench_fun"simplify_dot, relative unchanged"=lett=Sys.opaque_identity(of_string"foo/bar/baz")infun()->simplify_dott;;let%bench_fun"simplify_dot, absolute changed"=lett=Sys.opaque_identity(of_string"/foo/./bar/baz/.")infun()->simplify_dott;;let%bench_fun"simplify_dot, relative changed"=lett=Sys.opaque_identity(of_string"./foo/./bar/baz")infun()->simplify_dott;;letsimplify_dot_and_dot_dot_naively=File_path.simplify_dot_and_dot_dot_naivelylet%bench_fun"simplify_dot_and_dot_dot_naively, absolute unchanged"=lett=Sys.opaque_identity(of_string"/foo/bar/baz")infun()->simplify_dot_and_dot_dot_naivelyt;;let%bench_fun"simplify_dot_and_dot_dot_naively, relative unchanged"=lett=Sys.opaque_identity(of_string"foo/bar/baz")infun()->simplify_dot_and_dot_dot_naivelyt;;let%bench_fun"simplify_dot_and_dot_dot_naively, absolute changed"=lett=Sys.opaque_identity(of_string"/foo/quux/../bar/baz/.")infun()->simplify_dot_and_dot_dot_naivelyt;;let%bench_fun"simplify_dot_and_dot_dot_naively, relative changed"=lett=Sys.opaque_identity(of_string"./foo/quux/../bar/baz")infun()->simplify_dot_and_dot_dot_naivelyt;;