Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3278180
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T19:27:09+00:00 2026-05-17T19:27:09+00:00

I recently changed the Session State to use SQL server and then realized not

  • 0

I recently changed the Session State to use SQL server and then realized not all my entities were serializable.

Now trying to find out which entities are being put in session throughout the code seems to be a big pain, so I was thinking why not make all of them serializable?

Will this have any performance hit? Why are classes not marked as Serializable by default?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T19:27:10+00:00Added an answer on May 17, 2026 at 7:27 pm

    Adding [Serializable] doesn’t impact performance; simply most classes don’t need to be serializable, and the ability to store internal state doesn’t always make sense – it only really makes sense for “entity”or “DTO” objects.

    Some things to watch: make sure events aren’t serialized; mark then [field: NonSerialized] – otherwise you might grow more data than you expect ;p

    Also; BinaryFormatter can be… rather voluminous. If you want smaller data, I would suggest looking at (for example) protobuf-net (100% free), which you can hook via ISerializable – it is generally significantly more efficient than BinaryFormatter. Let me know if you are interested in more details.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I manage shared session state across 2 production web servers using SQL Server database.
Not sure if Azure cache has recently changed, however the access keys seem to
I was recently trying to re-install the fos:userbundle and noticed the docs have changed.
Recently I changed the hostname of my computer and now every time I start
Amazon recently changed their APIs which and it seems there's no way now to
I have recently changed from using the cassini development server to IIS 7.5 express,
I've recently changed my form to use Ajax to submit the data. My form
I've recently inherited an application that makes very heavy use of session, including storing
Trying to locate a very specific set of recently changed files within a code
I recently changed my password and have to change my maven settings.xml file to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.