Opened 14 years ago

Last modified 13 years ago

#1278 closed task (fixed)

Speeding up the function Exp.crefPrefixOf

Reported by: Adrian Pop Owned by: Adrian Pop
Priority: low Milestone: Red October
Component: Frontend Version:
Keywords: Cc: Adrian Pop, Adrian Pop

Description

Hard to set priority as the impact is very high, but the risk is also very high.
Setting normal, we should discuss this more.

One can see from the gprof log of EngineV6.mos below that this would improve speed as is called VERY often:

./omc -log -no-string-sharing EngineV6.mos
Flat profile:

Each sample counts as 0.01 seconds.
  %   cumulative   self              self     total           
 time   seconds   seconds    calls   s/call   s/call  name    
 11.61    109.20   109.20        1   109.20   396.58  rml_prim_once
  9.70    200.44    91.23 3036392092     0.00     0.00  Exp__crefPrefixOf
  6.50    261.54    61.10                             Exp__crefPrefixOf_5flabel19725
  5.65    314.72    53.19 2104217366     0.00     0.00  Exp__crefEqualNoStringCompare
  4.25    354.70    39.98                             Exp__crefNotPrefixOf_5flabel19808
  4.00    392.34    37.64 2082815642     0.00     0.00  Exp__crefNotPrefixOf
  3.84    428.44    36.10 3398897915     0.00     0.00  Util__listSelect1
  3.64    462.69    34.25                             Util__listSelect1_5fsuccessContLam9526
  3.44    495.01    32.33                             Exp__crefPrefixOf_5ffailureContLam19756
  3.33    526.33    31.32                             Exp__crefPrefixOf_5ffailureContLam19717
  3.21    556.54    30.21                             Exp__crefNotPrefixOf_5fsuccessContLam19807
  2.75    582.40    25.86                             Util__listSelect1_5fsuccessContLam9525
  2.64    607.22    24.82                             Exp__crefPrefixOf_5fsuccessContLam19724
  2.52    630.92    23.71                             Exp__crefEqualNoStringCompare_5ffailureContLam19233
  2.09    650.62    19.70                             Exp__crefEqualNoStringCompare_5flabel19223
  1.46    664.32    13.69                             ConnectionGraph__crefConnectNotPrefixOf_5fsuccessContLam2156
  1.29    676.48    12.16                             ConnectionGraph__crefConnectNotPrefixOf_5fsuccessContLam2155
  1.27    688.41    11.94                             Exp__crefPrefixOf_5fsuccessContLam19776
  1.12    698.97    10.56                             ConnectionGraph__crefConnectNotPrefixOf
  0.81    706.60     7.62 495621808     0.00     0.00  Exp__subscriptEqual
  0.71    713.24     6.64 327236463     0.00     0.00  Exp__crefEqual
  0.66    719.49     6.25 353615202     0.00     0.00  Env__avlTreeGet
  0.60    725.13     5.64                             Env__getHeight
  0.59    730.72     5.58                             ConnectionGraph__crefBranchNotPrefixOf_5fsuccessContLam1958
  0.51    735.50     4.79                             Env__avlTreeAdd_5ffailureContLam2464
  0.48    740.04     4.54                             Env__avlTreeAdd_5flabel2482
  0.46    744.41     4.37                             ConnectionGraph__crefBranchNotPrefixOf
  0.46    748.74     4.32                             ConnectionGraph__crefBranchNotPrefixOf_5fsuccessContLam1957

Change History (2)

comment:1 by Adrian Pop, 14 years ago

Total time EnginveV6.mos (inst + check):

real    9m24.421s
user    0m0.015s
sys     0m0.015s

Summary:

  3.4 s - set-to-zero of unconnected flow components 
  1.9 s - all calls to updateComponentsInEnv
402.4 s - all calls to Exp.crefPrefixOf (6m43s)

It seems is definitely worth a try to speedup
Exp.crefPrefixOf as it accounts for about 50%
of execution time!

comment:2 by Martin Sjölund, 13 years ago

Fixed by not calling the function so damn much

Note: See TracTickets for help on using tickets.