[Glass] [Seaside] Progress bar for database query

Dale Henrichs via Glass glass at lists.gemtalksystems.com
Thu Oct 15 10:10:51 PDT 2015


Dario,

If you have tODE, you can use the `pf` command:

   pf start                                         #start profiling
   eval`Here goes your execution`
   pf view                                          #stop profiling and 
bring up profile viewer

Does pretty much what Mariano described, the profile viewer allows you 
interactively poke around in the profiling results while viewing the 
method source ...

Dale

On 10/15/2015 07:56 AM, Mariano Martinez Peck via Glass wrote:
> | profMon |
> profMon := ProfMonitorTree new.
> profMon *interval: 10.*
>  profMon startMonitoring.
>
> *self HERE_GOES_YOUR_CODE_EXECUTION.*
>
>  profMon
>         stopMonitoring;
>         gatherResults.
>
> (FileStream forceNewFileNamed: *'/Users/mariano/profile.txt'*) 
> nextPutAll: (profMon reportDownTo: *1*); cr.
>
>
> Ok, replace "self HERE_GOES_YOUR_CODE_EXECUTION." with your real code 
> you want to profile.
> Change internal if you want samples to be more or less frequent (I 
> would let 10).
> Change reportDownTo: to see until how much you want to print in the 
> file. If 1 is too much large file, you may want to try 10 or 100.
> Change profile.txt location
>
> Then simply inspect profile.txt, go to the very end and analyze where 
> the time is spent.
>
> Cheers,
>
>
>
>
> On Thu, Oct 15, 2015 at 11:50 AM, Trussardi Dario Romano 
> <dario.trussardi at tiscali.it <mailto:dario.trussardi at tiscali.it>> wrote:
>
>     Ciao Mariano,
>
>>     Dario,
>>
>>     With the years I have learned that I will  not spend a single
>>     second of my life anymore trying to optimize something without
>>     having previously profile it. Most of the times, the bottleneck
>>     is elsewhere where you imagined. So if I were you, before doing
>>     anything, I would profile the report and understand where is the
>>     bottleneck. And then analyze possible solutions: algorithmic,
>>     database index, kind of collection used, collection message used,
>>     gemstone tunning (do you have native code enabled? ), etc.
>>
>>     Let me know if you need help with the profiling.
>
>     I don't have any knowledge about profiling.
>
>     Have you some considerations, reference about it ?
>
>     Thanks for any suggestion,
>
>     Dario
>
>>
>>     Cheers,
>>
>>
>>     On Thu, Oct 15, 2015 at 11:28 AM, Trussardi Dario Romano via
>>     Glass <glass at lists.gemtalksystems.com
>>     <mailto:glass at lists.gemtalksystems.com>> wrote:
>>
>>         Ciao Mariano,
>>
>>         thanks for your considerations.
>>
>>>         Hi Dario,
>>>
>>>         It looks strange to me that a query to GemStone could take
>>>         that much. Did you profile it?  how many rows has the
>>>         collection? which type of collection is it?   the complexity
>>>         / time goes into the "condition" rather in the select?
>>>         I ask because many times I was in the same situation, after
>>>         a quick profiling,
>>         I don't have experience into index.
>>
>>>         I noticed that adding an index would solve it.
>>
>>         I defined my request as 'query'   but, i think,it is not a
>>         query on possible indexed data.
>>
>>         My query is relative to the some dictionaries ( one
>>         dictionary for any day ) everyone with a dictionary about the
>>         documents ( 200 - 300 )  managed on the day.
>>
>>         Every document is based on a bag of items ecc.  ecc.. ecc...
>>
>>         With my surprise when i have 2 - 3 moths on-line all works
>>         fine.  ( the SPC is set to 2097152 )
>>
>>         But now when i have 6 months on-line the system answer with
>>         some delay.
>>
>>         My goal for now is to have online 12 months.
>>
>>         I need to change  my internal structure ?
>>
>>         Cheers,
>>         Dario
>>
>>
>>>
>>>         Cheers,
>>>
>>>         ---------- Forwarded message ----------
>>>         From: *dtrussardi at tiscali.it <mailto:dtrussardi at tiscali.it>*
>>>         <dtrussardi at tiscali.it <mailto:dtrussardi at tiscali.it>>
>>>         Date: Thu, Oct 15, 2015 at 9:23 AM
>>>         Subject: [Seaside] Progress bar for database query
>>>         To: seaside-wiki <seaside at lists.squeakfoundation.org
>>>         <mailto:seaside at lists.squeakfoundation.org>>
>>>
>>>
>>>         Ciao,
>>>
>>>                 i have a seaside application with some user interface.
>>>
>>>                 Now i have one specific user request for query the
>>>         database.
>>>
>>>                 This request required some long time on the server
>>>         before answer.
>>>
>>>                 My goal is to :
>>>
>>>                         a) display a progress bar when the user
>>>         submit this query
>>>
>>>                         b)  block the web user request until the
>>>         server answer the data query result
>>>
>>>
>>>                 How i can implemented this solution?
>>>
>>>                 Thank for any considerations.
>>>
>>>
>>>                         Dario
>>>
>>>         _______________________________________________
>>>         seaside mailing list
>>>         seaside at lists.squeakfoundation.org
>>>         <mailto:seaside at lists.squeakfoundation.org>
>>>         http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>>>
>>>
>>>
>>>         -- 
>>>         Mariano
>>>         http://marianopeck.wordpress.com
>>>         <http://marianopeck.wordpress.com/>
>>>         _______________________________________________
>>>         Glass mailing list
>>>         Glass at lists.gemtalksystems.com
>>>         <mailto:Glass at lists.gemtalksystems.com>
>>>         http://lists.gemtalksystems.com/mailman/listinfo/glass
>>
>>
>>         _______________________________________________
>>         Glass mailing list
>>         Glass at lists.gemtalksystems.com
>>         <mailto:Glass at lists.gemtalksystems.com>
>>         http://lists.gemtalksystems.com/mailman/listinfo/glass
>>
>>
>>
>>
>>     -- 
>>     Mariano
>>     http://marianopeck.wordpress.com <http://marianopeck.wordpress.com/>
>
>
>
>
> -- 
> Mariano
> http://marianopeck.wordpress.com
>
>
> _______________________________________________
> Glass mailing list
> Glass at lists.gemtalksystems.com
> http://lists.gemtalksystems.com/mailman/listinfo/glass

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gemtalksystems.com/mailman/private/glass/attachments/20151015/a3290979/attachment-0001.html>


More information about the Glass mailing list