Skip to content

CP-49135: speed up UUID generation #6018

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

Merged
merged 6 commits into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 1 addition & 9 deletions ocaml/idl/ocaml_backend/gen_api.ml
Original file line number Diff line number Diff line change
Expand Up @@ -400,15 +400,7 @@ let gen_client_types highapi =
; " Rpc.failure (rpc_of_failure ([\"Fault\"; code]))"
]
; ["include Rpc"; "type string_list = string list [@@deriving rpc]"]
; [
"module Ref = struct"
; " include Ref"
; " let rpc_of_t (_:'a -> Rpc.t) (x: 'a Ref.t) = rpc_of_string \
(Ref.string_of x)"
; " let t_of_rpc (_:Rpc.t -> 'a) x : 'a t = of_string (string_of_rpc \
x);"
; "end"
]
; ["module Ref = Ref"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there still any point to this line, as it is not renaming anything?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I got a build failure without it, we could probably find what generates Foo.Ref and make it generate just Ref instead.

; [
"module Date = struct"
; " open Xapi_stdext_date"
Expand Down
4 changes: 4 additions & 0 deletions ocaml/xapi-types/ref.ml
Original file line number Diff line number Diff line change
Expand Up @@ -138,3 +138,7 @@ let really_pretty_and_small x =
"NULL"

let pp ppf x = Format.fprintf ppf "%s" (string_of x)

let rpc_of_t _ x = Rpc.rpc_of_string (string_of x)

let t_of_rpc _ x = of_string (Rpc.string_of_rpc x)
4 changes: 4 additions & 0 deletions ocaml/xapi-types/ref.mli
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@

type 'a t

val rpc_of_t : ('a -> Rpc.t) -> 'a t -> Rpc.t

val t_of_rpc : (Rpc.t -> 'a) -> Rpc.t -> 'a t

val ref_prefix : string

val make : unit -> 'a t
Expand Down