Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reading lot of string values from database (fetching string values) performance is poor [DNET579] #548

Closed
firebird-automations opened this issue Dec 2, 2014 · 1 comment

Comments

@firebird-automations
Copy link

Submitted by: Toni Martir (toni_martir)

Votes: 1

When fetching rows, reading string column values calls public static Charset GetCharset(string charsetName)

Replacing the sequential search with a dictionary there is a 80% performance gain when reading strings:

    private static Dictionary<string, Charset\> supportedCharsetsNames;

	public static Charset GetCharset\(string charsetName\)
	\{
        return supportedCharsetsNames\[charsetName\];

	\}

And inside InitializeSupportedCharsets:

        supportedCharsetsNames = new Dictionary<string, Charset\>\(\);
        foreach \(Charset ncharset in charsets\)
        \{
            supportedCharsetsNames\.Add\(<http://ncharset.name>, ncharset\);
        \}

Commits: b750ac8

@firebird-automations
Copy link
Author

Modified by: @cincuranet

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Fix Version: vNext [ 10640 ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants