Skip to content

High speed efficiency and performance. #237

@konethmelathil

Description

@konethmelathil

My understanding is that performance is better when

  1. Not using variables in maps.
  2. Variables exist only one level deep in a structure

Are there any other performance notes anyone can provide for a high speed usage efficiency? Anything would be appreciated!
Thank you.

I did a profile of a go app using goja, Following is a 30 second profile:

 flat  flat%   sum%        cum   cum%
 0.10s   0.3% 69.95%      0.47s  1.43%  github.com/dop251/goja.(*Runtime).typeInfo
 0.10s   0.3% 70.25%      4.59s 13.98%  github.com/dop251/goja.(*baseFuncObject).init
 0.10s   0.3% 70.55%     15.20s 46.29%  github.com/dop251/goja.(*vm).try
 0.09s  0.27% 71.13%     11.69s 35.60%  github.com/dop251/goja.getProp.exec
 0.08s  0.24% 72.44%      0.20s  0.61%  github.com/dop251/goja.cmp
 0.07s  0.21% 73.87%     15.40s 46.89%  github.com/dop251/goja.(*Runtime).RunProgram
 0.07s  0.21% 74.09%     11.48s 34.96%  github.com/dop251/goja.(*objectGoReflect)._get
 0.07s  0.21% 74.30%      0.49s  1.49%  github.com/dop251/goja.stringValueFromRaw
 0.07s  0.21% 74.51%      0.25s  0.76%  reflect.packEface
 0.06s  0.18% 74.70%      2.43s  7.40%  github.com/dop251/goja.(*Runtime).wrapReflectFunc.func1
 0.06s  0.18% 74.88%     11.59s 35.29%  github.com/dop251/goja.(*objectGoReflect).getStr

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions