Skip to content

ut3.ut.run is slow to start #757

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

Closed
luffySF opened this issue Sep 25, 2018 · 12 comments
Closed

ut3.ut.run is slow to start #757

luffySF opened this issue Sep 25, 2018 · 12 comments

Comments

@luffySF
Copy link

luffySF commented Sep 25, 2018

the API of ut3.ut.run is a bit slow.

for example, ut.run('hr.test_apply_bonus', ut_xunit_reporter());

please give me some help! thanks!

@jgebal
Copy link
Member

jgebal commented Sep 25, 2018

Hi @luffySF
Please be as much secific as possible.
Your request fir help is very vague.
What do you mean by "a bit slow".
How slow it is?
Is it always that slow?
How fast you expect it to be?
What vesion of utPLSQL are you using exactly?
What DB version are you using?
How many objects are there in HR shema?
How many users are using your DB?
....

There ahe hundreds of factor that can cause slowness.
The more background you provide, the better chances for getting valuable help.

Hor now I can't help you, given the info you provided.

@luffySF
Copy link
Author

luffySF commented Sep 27, 2018

Hi @jgebal

Thank you for your reply!
The API of ut3.ut.run takes about 7 seconds to execute in my environment. I expect it to be less than 2 seconds.
The vesion of utPLSQL i'm using is v3.0.4 . and the DB is oracle 11g.
There are about hundreds of objects in HR schema ,and eighty user are using the DB.

As the same time , I found that the execution time of
ut.run('hr.test_apply_bonus.test_case_one') and ut.run('hr.test_apply_bonus')
is almost same.

However , the execution time of ut.run(ut_varchar2_list('hr.test_apply_bonus.test_case_one','hr.test_apply_bonus.test_case_two')) is about two times of ut.run('hr.test_apply_bonus.test_case_one').

that's all !

I'm looking forward to your reply soon. thank you very much !

@jgebal
Copy link
Member

jgebal commented Sep 27, 2018

Can you update to 3.1.2?
There were several changes in framework since 3.0.4
I would like to know if you see similar issues with latest version

@jgebal
Copy link
Member

jgebal commented Sep 27, 2018

Here you can find releases and release notes.
https://github.com/utPLSQL/utPLSQL/releases

@jgebal
Copy link
Member

jgebal commented Sep 27, 2018

One more thing that comes to my mind.
Does the user executing ut.run have access to DBA views? Can you query dba_objects/dba_source?

If nit, that can be a bottleneck, as the ALL views are significantly slower.
Another question.
Is the slowness showing always or only sometimes?
Do your active users compile packages frequently?

@luffySF
Copy link
Author

luffySF commented Sep 28, 2018

The slowness always happens. compile not frequently.

the Profiler is provided below.

1

@jgebal
Copy link
Member

jgebal commented Sep 28, 2018

Please try 3.1.2 and let me know how tgat works for you.
There is a session level cache that should drastically improve performance on test rerun even with 3.0.4.

Thanks for providing profiler info.
This shows that cache was not used.
Do you always run tests in new session?

@jgebal
Copy link
Member

jgebal commented Oct 1, 2018

If your package spec is always recompiled before tests there is not much we can do.
utPLSQL needs to chceck if source of packahe specifications have changed and scan source cide to identify annotations.
The only way around it would be to implement #631

@jgebal
Copy link
Member

jgebal commented Oct 4, 2018

I've had a look at performance of Oracle 11g/12.1/12.2/18 when it comes to querying data-dictionary.
It seems that by default 11g (out of the box DB) is performing worst.

Can you try to gather stats on system and see if that affect utPLSQL by any degree?

begin
  dbms_stats.gather_system_stats;
  dbms_stats.gather_fixed_objects_stats;
end;
/

Another step would be to assure that use has one of the privs:
grant select any dictionary to ...
grant select_catalog_role to ....

Let me know if you see any improvement

@jgebal
Copy link
Member

jgebal commented Nov 6, 2018

@luffySF - are you able to install the framework from github?
If so, can you try the feature branch: https://github.com/utPLSQL/utPLSQL/tree/feature/suite_query_api

This branch has a very different approach to fetching suites. Could give you a huge boost.
Since you're the one that encountered performance issues, it would be great to get feedback from you.

Please let me know if that solution gives better/worse performance.

@jgebal jgebal changed the title ut3.ut.run ut3.ut.run is slow to start Nov 6, 2018
@jgebal
Copy link
Member

jgebal commented Nov 28, 2018

@luffySF
Can you upgrade to 3.1.3 and let us know if it is better?
There are many startup performance inprovements in 3.1.3
Thanks

@jgebal
Copy link
Member

jgebal commented Jan 14, 2019

No reply from @luffySF - closing

@jgebal jgebal closed this as completed Jan 14, 2019
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

No branches or pull requests

2 participants