Alex Rivera | Logout

Does adding [Serializable] to the class have any performance implications?

Asked 2009-09-10T01:00:01.853
29

I need to add the [Serializable] attribute to a class that is extremely performance sensitive.

Will this attribute have any performance implications on the operation of the class?

Edit
Report

1 Answer

10

Attributes are a metadata annotations so they don't add weight to a class at runtime, unless they are interpreted by the runtime in a certain way that makes it treat the class differently.

[Serializable] is simply a marker attribute used as a convention to indicate that the class is serializable, it has no effect and the runtime does not treat the classes in any special way.

answered 2009-09-10T01:08:31.153

Your Answer