Slow Population of Tables

For questions regarding the import, export and manipulation of data in EViews, including graphing and basic statistics.

Moderators: EViews Gareth, EViews Steve, EViews Moderator, EViews Jason

vkarora
Posts: 9
Joined: Fri May 31, 2013 10:59 am

Slow Population of Tables

Postby vkarora » Fri Sep 05, 2014 7:39 am

I'm running a program that fills relatively large tables using for loops. The tables are at least 50,000 x 4, but can be as large as 200,000 x 4. The tables are taking at least 30 minutes a piece to fill-up. But the whole program, with three large tables, used to run and complete in less than 5 minutes before we switched over to Windows 7 and I upgraded to EViews 64 bit.

My current settings for max threads is auto and I've set EViews as a high priority process. I have also noticed that the CPU usage has been less than 15% throughout (even after setting as a high priority) and memory usage is around 20% as well.

Any thoughts on how I might speed this up?

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13603
Joined: Tue Sep 16, 2008 5:38 pm

Re: Slow Population of Tables

Postby EViews Gareth » Fri Sep 05, 2014 8:28 am

We'd need more information on how you've written your loops. Ideally posting the program/workfile.

vkarora
Posts: 9
Joined: Fri May 31, 2013 10:59 am

Re: Slow Population of Tables

Postby vkarora » Fri Sep 05, 2014 8:34 am

Thanks, here is the code to the smallest table:
.........................................................
pivot_output_sh(1,1) = "Year"
pivot_output_sh(1,2) = "Country/Region"
pivot_output_sh(1,3) = "Source"
pivot_output_sh(1,4) = "Concept"
pivot_output_sh(1,5) = "Value"
' Label each table.

!row_counter = 2
for !j = 1980 to 2040
for %y {%ieo_regions}
for %x gi ox hs pr
if %x = "gi" then
for %t {%ieo_go_all_mer}
pivot_output_sh(!row_counter,1) = !j
pivot_output_sh(!row_counter,2) = %y
pivot_output_sh(!row_counter,3) = %x
pivot_output_sh(!row_counter,4) = %t
!value = @elem({%y}_{%t}_sh_{%x},@str(!j))
pivot_output_sh(!row_counter,5) = !value
!row_counter = !row_counter + 1
next
else
if %x = "hs" then
for %t {%ieo_go_old}
pivot_output_sh(!row_counter,1) = !j
pivot_output_sh(!row_counter,2) = %y
pivot_output_sh(!row_counter,3) = %x
pivot_output_sh(!row_counter,4) = %t
!value = @elem({%y}_{%t}_sh_{%x},@str(!j))
pivot_output_sh(!row_counter,5) = !value
!row_counter = !row_counter + 1
next
else
for %t {%ieo_go_all}
pivot_output_sh(!row_counter,1) = !j
pivot_output_sh(!row_counter,2) = %y
pivot_output_sh(!row_counter,3) = %x
pivot_output_sh(!row_counter,4) = %t
!value = @elem({%y}_{%t}_sh_{%x},@str(!j))
pivot_output_sh(!row_counter,5) = !value
!row_counter = !row_counter + 1
next
endif
endif
next
next
next
' Write out in pivot chart (or database) format to table.

EViews Jason
EViews Developer
Posts: 870
Joined: Tue Sep 16, 2008 3:50 pm

Re: Slow Population of Tables

Postby EViews Jason » Fri Sep 05, 2014 9:42 am

3 things I would try: 1) run the program in quiet mode, 2)presize the table and 3)close the table window if present.

To run in quiet mode by default, select options->general options->runtime settings and select 'Quiet- no screen or status ....'

For #2 and #3, before you populate the table in your program add the following lines

Code: Select all

'if you can precalculate the size of the table then use that value instead of the 200000 I have here pivot_output_sh(200000,4)= " " close pivot_output_sh ' close the table window

vkarora
Posts: 9
Joined: Fri May 31, 2013 10:59 am

Re: Slow Population of Tables

Postby vkarora » Fri Sep 05, 2014 11:39 am

Worked like a charm. Thanks very much.


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 0 guests