Is there any performance reasons to change a function into a static function?

aberrant80

When developing actionscript/flex in IntelliJ IDEA, there's this IDEA inspection that suggests that so-and-so private function can be turned into a static function.

I've been ignoring it for a while now, but I'm curious as to whether, in actionscript, there's any performance benefit of declaring functions that can be static as static.

Coming from a Java background, it seems odd to me for IDEA to be suggesting that a function be made static just because it can... yet such an inspection does not exist in the Java editor.

For example, IDEA would suggest that I make the following static:

    private function eventName(attributeName:String):String {
        return attributeName + EVENT_NAME_SUFFIX;
    }
Panzercrisis

No. There is actually quite an incentive to do the opposite.

This should not be so - naturally, one would think static functions would be faster - but ActionScript 3 does not behave this way. Whoever wrote IDEA did not do their research on this, but rather they went with their instincts and with what should be true.

Here's one source of information on this subject:

http://blog.controul.com/2009/04/how-slow-is-static-access-in-as3avm2-exactly/

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Is there any performance reasons to change a function into a static function?

From Dev

Is there any difference in performance to declare a large variable inside a function as `static`?

From Dev

Is there a way to return an abstraction from a function without using new (for performance reasons)

From Dev

Any performance implications of moving SqlDataReader to external function?

From Dev

Function that accepts static arrays of any size (D)

From Dev

Does it matter (performance-wise) where a static function is defined?

From Dev

Does it matter (performance-wise) where a static function is defined?

From Dev

On change of any checkbox inside a div trigger a function

From Dev

Static function from static function

From Dev

Is there any performance impact when calling require inside a function?

From Dev

Is there any way to "call a function" in python without incurring the usual performance hit?

From Dev

Does declare function cause any performance problems in Clojure?

From Dev

What are reasons for function call to address NULL?

From Dev

Can function comparators be static function?

From Dev

How to change search function to accept any combination of words

From Dev

Any way to change the function of keyboard button particularly right ctrl

From Dev

Trigger javascript function when any of multiple fields change (onchange)

From Dev

How do I change the value of any global variable inside of a function?

From Java

Julia: function types and performance

From Dev

Performance of splitAt function on a vector

From Dev

Erlang sublist function performance

From Dev

Clojure function call performance

From Dev

Javascript nested function performance

From Dev

Custom performance function in Matlab

From Dev

Performance issue with DATEADD function

From Dev

Performance of "function_score"

From Java

Performance of foreach, array_map with lambda and array_map with static function

From Dev

Function calling any specified function

From Dev

Static variables local to function

Related Related

  1. 1

    Is there any performance reasons to change a function into a static function?

  2. 2

    Is there any difference in performance to declare a large variable inside a function as `static`?

  3. 3

    Is there a way to return an abstraction from a function without using new (for performance reasons)

  4. 4

    Any performance implications of moving SqlDataReader to external function?

  5. 5

    Function that accepts static arrays of any size (D)

  6. 6

    Does it matter (performance-wise) where a static function is defined?

  7. 7

    Does it matter (performance-wise) where a static function is defined?

  8. 8

    On change of any checkbox inside a div trigger a function

  9. 9

    Static function from static function

  10. 10

    Is there any performance impact when calling require inside a function?

  11. 11

    Is there any way to "call a function" in python without incurring the usual performance hit?

  12. 12

    Does declare function cause any performance problems in Clojure?

  13. 13

    What are reasons for function call to address NULL?

  14. 14

    Can function comparators be static function?

  15. 15

    How to change search function to accept any combination of words

  16. 16

    Any way to change the function of keyboard button particularly right ctrl

  17. 17

    Trigger javascript function when any of multiple fields change (onchange)

  18. 18

    How do I change the value of any global variable inside of a function?

  19. 19

    Julia: function types and performance

  20. 20

    Performance of splitAt function on a vector

  21. 21

    Erlang sublist function performance

  22. 22

    Clojure function call performance

  23. 23

    Javascript nested function performance

  24. 24

    Custom performance function in Matlab

  25. 25

    Performance issue with DATEADD function

  26. 26

    Performance of "function_score"

  27. 27

    Performance of foreach, array_map with lambda and array_map with static function

  28. 28

    Function calling any specified function

  29. 29

    Static variables local to function

HotTag

Archive