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

Initializing a dialogue policy for new devices is slow #721

Open
gcampax opened this issue Jul 23, 2021 · 1 comment
Open

Initializing a dialogue policy for new devices is slow #721

gcampax opened this issue Jul 23, 2021 · 1 comment
Labels
bug Something isn't working P2 We need to fix it (backlog) performance Issues related to performance and scaling

Comments

@gcampax
Copy link
Contributor

gcampax commented Jul 23, 2021

See log:

====
# main/2e3831ed-b3c5-40c1-bef7-2f469f79e394
#! timestamp: 2021-07-23T20:49:04.246Z
U: cancel
UT: $dialogue @org.thingpedia.dialogue.transaction.cancel;
C: $dialogue @org.thingpedia.dialogue.transaction.cancel;
#! timestamp: 2021-07-23T20:49:04.530Z
A: Alright, let me know if I can help you with anything else!
AT: $dialogue @org.thingpedia.dialogue.transaction.sys_end;
====
# main/cddd2b9e-d5e1-4e0a-895d-a231bf81ccb1
#! timestamp: 2021-07-23T20:49:45.921Z
U: cancel
UT: $dialogue @org.thingpedia.dialogue.transaction.cancel;
C: $dialogue @org.thingpedia.dialogue.transaction.cancel;
#! timestamp: 2021-07-23T20:49:45.939Z
A: Alright, let me know if I can help you with anything else!
AT: $dialogue @org.thingpedia.dialogue.transaction.sys_end;

The first time, the dialogue policy was reinitialized to empty from a different dialogue policy and it took 300ms (on top of everything else). The second time, the dialogue policy was the same and it was much faster.

@gcampax gcampax added bug Something isn't working performance Issues related to performance and scaling labels Jul 23, 2021
@gcampax
Copy link
Contributor Author

gcampax commented Jul 23, 2021

Other log:

====
# main/548e61fd-88ad-444a-a3a3-5c7160a80ac9
#! timestamp: 2021-07-23T20:51:51.596Z
U: tell me a joke
UT: $dialogue @org.thingpedia.dialogue.transaction.execute;
UT: @com.icanhazdadjoke.get();
C: $dialogue @org.thingpedia.dialogue.transaction.execute;
C: @com.icanhazdadjoke.get()
C: #[results=[
C:   { id="4wciyk3EBAd"^^com.icanhazdadjoke:id, text="I got a reversible jacket for Christmas, I can't wait to see how it turns out." }
C: ]];
#! timestamp: 2021-07-23T20:51:52.043Z
A: I got a reversible jacket for Christmas, I can't wait to see how it turns out.
AT: $dialogue @org.thingpedia.dialogue.transaction.sys_display_result;
#! timestamp: 2021-07-23T20:51:55.892Z
U: cancel
UT: $dialogue @org.thingpedia.dialogue.transaction.cancel;
C: $dialogue @org.thingpedia.dialogue.transaction.cancel;
C: @com.icanhazdadjoke.get()
C: #[results=[
C:   { id="4wciyk3EBAd"^^com.icanhazdadjoke:id, text="I got a reversible jacket for Christmas, I can't wait to see how it turns out." }
C: ]];
#! timestamp: 2021-07-23T20:51:55.913Z
A: Alright, let me know if I can help you with anything else!
AT: $dialogue @org.thingpedia.dialogue.transaction.sys_end;
====
# main/76d47fe0-ea92-426f-8cb7-303c7b3c539c
#! timestamp: 2021-07-23T20:51:59.264Z
U: tell me a joke
UT: $dialogue @org.thingpedia.dialogue.transaction.execute;
UT: @com.icanhazdadjoke.get();
C: $dialogue @org.thingpedia.dialogue.transaction.execute;
C: @com.icanhazdadjoke.get()
C: #[results=[
C:   { id="QuscibaMClb"^^com.icanhazdadjoke:id, text="What does a pirate pay for his corn? A buccaneer!" }
C: ]];
#! timestamp: 2021-07-23T20:51:59.559Z
A: What does a pirate pay for his corn? A buccaneer!
AT: $dialogue @org.thingpedia.dialogue.transaction.sys_display_result;
#! timestamp: 2021-07-23T20:52:01.659Z
U: cancel
UT: $dialogue @org.thingpedia.dialogue.transaction.cancel;
C: $dialogue @org.thingpedia.dialogue.transaction.cancel;
C: @com.icanhazdadjoke.get()
C: #[results=[
C:   { id="QuscibaMClb"^^com.icanhazdadjoke:id, text="What does a pirate pay for his corn? A buccaneer!" }
C: ]];
#! timestamp: 2021-07-23T20:52:01.675Z
A: Alright, let me know if I can help you with anything else!
AT: $dialogue @org.thingpedia.dialogue.transaction.sys_end;

First time, "tell me a joke" takes 447ms. Second time, the same command takes 295ms.

@gcampax gcampax added the P2 We need to fix it (backlog) label Aug 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P2 We need to fix it (backlog) performance Issues related to performance and scaling
Projects
None yet
Development

No branches or pull requests

1 participant