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

WIP: Codegen-free FASTER C# #67

Merged
merged 31 commits into from
Dec 14, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
8ecf607
Initial checkin
badrishc Nov 22, 2018
f260537
Removed Key* from benchmarks
badrishc Nov 22, 2018
d1172b1
Updates
badrishc Nov 23, 2018
0aa9968
Changed callback functions from static to object.
badrishc Nov 25, 2018
a23a354
Removed raw pointers to Value type.
badrishc Nov 25, 2018
4ca8aa3
All user types are now ref-based.
badrishc Nov 26, 2018
c346eb0
Generic version of FASTER compiles and works fine for blittable types…
badrishc Nov 26, 2018
5d64a2d
Updates to support generic version
badrishc Nov 30, 2018
594b2b5
Updates to refactor allocator
Dec 3, 2018
d8044cd
Testing alt allocator structure
badrishc Dec 4, 2018
dc8ff26
Updated cleanup code
badrishc Dec 4, 2018
7ee860e
Updates
badrishc Dec 4, 2018
fce9ba5
More updates
badrishc Dec 4, 2018
3f86f4e
Updates
badrishc Dec 5, 2018
bd8e889
Updates - fully working generic support, still needs cleanup
badrishc Dec 5, 2018
debf9f6
Fixed multi-threading bug with generic allocator.
badrishc Dec 7, 2018
d430781
Further updates, object recovery not yet passing.
badrishc Dec 8, 2018
33b6ddd
Fixes to generic object recovery. All tests pass! Cleanup still pending.
badrishc Dec 9, 2018
5e1d3e7
Update samples
badrishc Dec 9, 2018
21528ff
More cleanup and refactoring
badrishc Dec 10, 2018
6f6e670
More cleanup and code cutting.
badrishc Dec 10, 2018
1f6e792
Heavy simplification of user API and interfaces.
badrishc Dec 11, 2018
bb9536d
Removed InitialValueLength from user callback functions
badrishc Dec 11, 2018
2c00cb7
Updating AddressInfo calculation for AnyCPU 32-bit compat. Other clea…
badrishc Dec 11, 2018
c6b52fd
Cleanup of inlining directives
badrishc Dec 12, 2018
0a175b7
Changing key comparer to use a separate IFasterEqualityComparer<T> in…
badrishc Dec 12, 2018
00862a7
Cleanup, simplification, updates. Persistence API cleaned up as well.
badrishc Dec 13, 2018
25078ee
Simplifying Guid determination for persistence callback.
badrishc Dec 13, 2018
eb09851
Fixing test break in AnyCPU-Debug due to different struct layout.
badrishc Dec 13, 2018
083f397
Merge branch 'master' into nocodegen
badrishc Dec 13, 2018
92ca950
Fixing the checkpointing directory settings and log creation and init…
badrishc Dec 14, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -191,4 +191,5 @@ packages/
*.VC.opendb
.vs/
*.lib
nativebin/
nativebin/
/cs/benchmark/Properties/launchSettings.json
112 changes: 45 additions & 67 deletions cs/FASTER.sln
Original file line number Diff line number Diff line change
Expand Up @@ -5,35 +5,31 @@ VisualStudioVersion = 15.0.27004.2008
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FASTER.benchmark", "benchmark\FASTER.benchmark.csproj", "{33A732D1-2B58-4FEE-9696-B9483496229F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FASTER.test", "test\FASTER.test.csproj", "{0DC7F5A2-E963-4E7F-BD37-6F7864B726F2}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FASTER.test", "test\FASTER.test.csproj", "{0DC7F5A2-E963-4E7F-BD37-6F7864B726F2}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "playground", "playground", "{E6026D6A-01C5-4582-B2C1-64751490DABE}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ManagedSample1", "playground\ManagedSample1\ManagedSample1.csproj", "{17BDD0A5-98E5-464A-8A00-050D9FF4C562}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "benchmark", "benchmark", "{CA6AB459-A31A-4C15-B1A6-A82C349B54B4}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{81B3B5D1-70F6-4979-AC76-003F9A6B316B}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ManagedSample2", "playground\ManagedSample2\ManagedSample2.csproj", "{7DB87633-9CAB-4AE4-9ED0-AA6E77448486}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ManagedSample3", "playground\ManagedSample3\ManagedSample3.csproj", "{3E571C7C-59B5-485C-AC78-3F34D3511CD2}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SumStore", "playground\SumStore\SumStore.csproj", "{05D61B37-9714-4234-9961-384A63F7175E}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ManagedSample4", "playground\ManagedSample4\ManagedSample4.csproj", "{E1AC9797-ABE3-4881-A51B-37D8687AAE35}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SumStore", "playground\SumStore\SumStore.csproj", "{05D61B37-9714-4234-9961-384A63F7175E}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ClassCache", "playground\ClassCache\ClassCache.csproj", "{10FD4868-BB16-442B-B0AC-18AE278D9C60}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NestedTypesTest", "playground\NestedTypesTest\NestedTypesTest.csproj", "{2D5F23F7-3184-43EC-A7F1-C924F7FEF786}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{28800357-C8CE-4CD0-A2AD-D4A910ABB496}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "core", "core", "{9531E3D2-217B-4446-98E8-E48F0FDD1452}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FASTER.core", "src\core\FASTER.core.csproj", "{F947BC6A-2943-4AC7-ACA7-F17351E25FE7}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ManagedSampleCore", "playground\ManagedSampleCore\ManagedSampleCore.csproj", "{C9391533-1F31-47F6-BE08-9642C95401A8}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StructSample", "playground\StructSample\StructSample.csproj", "{494703CF-C1C9-4800-B994-EF3974EB051D}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StructSampleCore", "playground\StructSampleCore\StructSampleCore.csproj", "{D938612F-4B99-409E-953E-28A3A027B0E3}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ClassSample", "playground\ClassSample\ClassSample.csproj", "{18B6FB88-202F-4DAD-A582-17E1CEB873EC}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MixedSample", "playground\MixedSample\MixedSample.csproj", "{8B9F682D-145C-4085-AD8A-845255597F5D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -59,30 +55,6 @@ Global
{0DC7F5A2-E963-4E7F-BD37-6F7864B726F2}.Release|Any CPU.Build.0 = Release|Any CPU
{0DC7F5A2-E963-4E7F-BD37-6F7864B726F2}.Release|x64.ActiveCfg = Release|x64
{0DC7F5A2-E963-4E7F-BD37-6F7864B726F2}.Release|x64.Build.0 = Release|x64
{17BDD0A5-98E5-464A-8A00-050D9FF4C562}.Debug|Any CPU.ActiveCfg = Debug|x64
{17BDD0A5-98E5-464A-8A00-050D9FF4C562}.Debug|Any CPU.Build.0 = Debug|x64
{17BDD0A5-98E5-464A-8A00-050D9FF4C562}.Debug|x64.ActiveCfg = Debug|x64
{17BDD0A5-98E5-464A-8A00-050D9FF4C562}.Debug|x64.Build.0 = Debug|x64
{17BDD0A5-98E5-464A-8A00-050D9FF4C562}.Release|Any CPU.ActiveCfg = Release|x64
{17BDD0A5-98E5-464A-8A00-050D9FF4C562}.Release|Any CPU.Build.0 = Release|x64
{17BDD0A5-98E5-464A-8A00-050D9FF4C562}.Release|x64.ActiveCfg = Release|x64
{17BDD0A5-98E5-464A-8A00-050D9FF4C562}.Release|x64.Build.0 = Release|x64
{7DB87633-9CAB-4AE4-9ED0-AA6E77448486}.Debug|Any CPU.ActiveCfg = Debug|x64
{7DB87633-9CAB-4AE4-9ED0-AA6E77448486}.Debug|Any CPU.Build.0 = Debug|x64
{7DB87633-9CAB-4AE4-9ED0-AA6E77448486}.Debug|x64.ActiveCfg = Debug|x64
{7DB87633-9CAB-4AE4-9ED0-AA6E77448486}.Debug|x64.Build.0 = Debug|x64
{7DB87633-9CAB-4AE4-9ED0-AA6E77448486}.Release|Any CPU.ActiveCfg = Release|x64
{7DB87633-9CAB-4AE4-9ED0-AA6E77448486}.Release|Any CPU.Build.0 = Release|x64
{7DB87633-9CAB-4AE4-9ED0-AA6E77448486}.Release|x64.ActiveCfg = Release|x64
{7DB87633-9CAB-4AE4-9ED0-AA6E77448486}.Release|x64.Build.0 = Release|x64
{3E571C7C-59B5-485C-AC78-3F34D3511CD2}.Debug|Any CPU.ActiveCfg = Debug|x64
{3E571C7C-59B5-485C-AC78-3F34D3511CD2}.Debug|Any CPU.Build.0 = Debug|x64
{3E571C7C-59B5-485C-AC78-3F34D3511CD2}.Debug|x64.ActiveCfg = Debug|x64
{3E571C7C-59B5-485C-AC78-3F34D3511CD2}.Debug|x64.Build.0 = Debug|x64
{3E571C7C-59B5-485C-AC78-3F34D3511CD2}.Release|Any CPU.ActiveCfg = Release|x64
{3E571C7C-59B5-485C-AC78-3F34D3511CD2}.Release|Any CPU.Build.0 = Release|x64
{3E571C7C-59B5-485C-AC78-3F34D3511CD2}.Release|x64.ActiveCfg = Release|x64
{3E571C7C-59B5-485C-AC78-3F34D3511CD2}.Release|x64.Build.0 = Release|x64
{05D61B37-9714-4234-9961-384A63F7175E}.Debug|Any CPU.ActiveCfg = Debug|x64
{05D61B37-9714-4234-9961-384A63F7175E}.Debug|Any CPU.Build.0 = Debug|x64
{05D61B37-9714-4234-9961-384A63F7175E}.Debug|x64.ActiveCfg = Debug|x64
Expand All @@ -91,14 +63,6 @@ Global
{05D61B37-9714-4234-9961-384A63F7175E}.Release|Any CPU.Build.0 = Release|x64
{05D61B37-9714-4234-9961-384A63F7175E}.Release|x64.ActiveCfg = Release|x64
{05D61B37-9714-4234-9961-384A63F7175E}.Release|x64.Build.0 = Release|x64
{E1AC9797-ABE3-4881-A51B-37D8687AAE35}.Debug|Any CPU.ActiveCfg = Debug|x64
{E1AC9797-ABE3-4881-A51B-37D8687AAE35}.Debug|Any CPU.Build.0 = Debug|x64
{E1AC9797-ABE3-4881-A51B-37D8687AAE35}.Debug|x64.ActiveCfg = Debug|x64
{E1AC9797-ABE3-4881-A51B-37D8687AAE35}.Debug|x64.Build.0 = Debug|x64
{E1AC9797-ABE3-4881-A51B-37D8687AAE35}.Release|Any CPU.ActiveCfg = Release|x64
{E1AC9797-ABE3-4881-A51B-37D8687AAE35}.Release|Any CPU.Build.0 = Release|x64
{E1AC9797-ABE3-4881-A51B-37D8687AAE35}.Release|x64.ActiveCfg = Release|x64
{E1AC9797-ABE3-4881-A51B-37D8687AAE35}.Release|x64.Build.0 = Release|x64
{10FD4868-BB16-442B-B0AC-18AE278D9C60}.Debug|Any CPU.ActiveCfg = Debug|x64
{10FD4868-BB16-442B-B0AC-18AE278D9C60}.Debug|Any CPU.Build.0 = Debug|x64
{10FD4868-BB16-442B-B0AC-18AE278D9C60}.Debug|x64.ActiveCfg = Debug|x64
Expand All @@ -107,14 +71,6 @@ Global
{10FD4868-BB16-442B-B0AC-18AE278D9C60}.Release|Any CPU.Build.0 = Release|x64
{10FD4868-BB16-442B-B0AC-18AE278D9C60}.Release|x64.ActiveCfg = Release|x64
{10FD4868-BB16-442B-B0AC-18AE278D9C60}.Release|x64.Build.0 = Release|x64
{2D5F23F7-3184-43EC-A7F1-C924F7FEF786}.Debug|Any CPU.ActiveCfg = Debug|x64
{2D5F23F7-3184-43EC-A7F1-C924F7FEF786}.Debug|Any CPU.Build.0 = Debug|x64
{2D5F23F7-3184-43EC-A7F1-C924F7FEF786}.Debug|x64.ActiveCfg = Debug|x64
{2D5F23F7-3184-43EC-A7F1-C924F7FEF786}.Debug|x64.Build.0 = Debug|x64
{2D5F23F7-3184-43EC-A7F1-C924F7FEF786}.Release|Any CPU.ActiveCfg = Release|x64
{2D5F23F7-3184-43EC-A7F1-C924F7FEF786}.Release|Any CPU.Build.0 = Release|x64
{2D5F23F7-3184-43EC-A7F1-C924F7FEF786}.Release|x64.ActiveCfg = Release|x64
{2D5F23F7-3184-43EC-A7F1-C924F7FEF786}.Release|x64.Build.0 = Release|x64
{F947BC6A-2943-4AC7-ACA7-F17351E25FE7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F947BC6A-2943-4AC7-ACA7-F17351E25FE7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F947BC6A-2943-4AC7-ACA7-F17351E25FE7}.Debug|x64.ActiveCfg = Debug|x64
Expand All @@ -123,31 +79,53 @@ Global
{F947BC6A-2943-4AC7-ACA7-F17351E25FE7}.Release|Any CPU.Build.0 = Release|Any CPU
{F947BC6A-2943-4AC7-ACA7-F17351E25FE7}.Release|x64.ActiveCfg = Release|x64
{F947BC6A-2943-4AC7-ACA7-F17351E25FE7}.Release|x64.Build.0 = Release|x64
{C9391533-1F31-47F6-BE08-9642C95401A8}.Debug|Any CPU.ActiveCfg = Debug|x64
{C9391533-1F31-47F6-BE08-9642C95401A8}.Debug|Any CPU.Build.0 = Debug|x64
{C9391533-1F31-47F6-BE08-9642C95401A8}.Debug|x64.ActiveCfg = Debug|x64
{C9391533-1F31-47F6-BE08-9642C95401A8}.Debug|x64.Build.0 = Debug|x64
{C9391533-1F31-47F6-BE08-9642C95401A8}.Release|Any CPU.ActiveCfg = Release|x64
{C9391533-1F31-47F6-BE08-9642C95401A8}.Release|Any CPU.Build.0 = Release|x64
{C9391533-1F31-47F6-BE08-9642C95401A8}.Release|x64.ActiveCfg = Release|x64
{C9391533-1F31-47F6-BE08-9642C95401A8}.Release|x64.Build.0 = Release|x64
{494703CF-C1C9-4800-B994-EF3974EB051D}.Debug|Any CPU.ActiveCfg = Debug|x64
{494703CF-C1C9-4800-B994-EF3974EB051D}.Debug|Any CPU.Build.0 = Debug|x64
{494703CF-C1C9-4800-B994-EF3974EB051D}.Debug|x64.ActiveCfg = Debug|x64
{494703CF-C1C9-4800-B994-EF3974EB051D}.Debug|x64.Build.0 = Debug|x64
{494703CF-C1C9-4800-B994-EF3974EB051D}.Release|Any CPU.ActiveCfg = Release|x64
{494703CF-C1C9-4800-B994-EF3974EB051D}.Release|Any CPU.Build.0 = Release|x64
{494703CF-C1C9-4800-B994-EF3974EB051D}.Release|x64.ActiveCfg = Release|x64
{494703CF-C1C9-4800-B994-EF3974EB051D}.Release|x64.Build.0 = Release|x64
{D938612F-4B99-409E-953E-28A3A027B0E3}.Debug|Any CPU.ActiveCfg = Debug|x64
{D938612F-4B99-409E-953E-28A3A027B0E3}.Debug|Any CPU.Build.0 = Debug|x64
{D938612F-4B99-409E-953E-28A3A027B0E3}.Debug|x64.ActiveCfg = Debug|x64
{D938612F-4B99-409E-953E-28A3A027B0E3}.Debug|x64.Build.0 = Debug|x64
{D938612F-4B99-409E-953E-28A3A027B0E3}.Release|Any CPU.ActiveCfg = Release|x64
{D938612F-4B99-409E-953E-28A3A027B0E3}.Release|Any CPU.Build.0 = Release|x64
{D938612F-4B99-409E-953E-28A3A027B0E3}.Release|x64.ActiveCfg = Release|x64
{D938612F-4B99-409E-953E-28A3A027B0E3}.Release|x64.Build.0 = Release|x64
{18B6FB88-202F-4DAD-A582-17E1CEB873EC}.Debug|Any CPU.ActiveCfg = Debug|x64
{18B6FB88-202F-4DAD-A582-17E1CEB873EC}.Debug|Any CPU.Build.0 = Debug|x64
{18B6FB88-202F-4DAD-A582-17E1CEB873EC}.Debug|x64.ActiveCfg = Debug|x64
{18B6FB88-202F-4DAD-A582-17E1CEB873EC}.Debug|x64.Build.0 = Debug|x64
{18B6FB88-202F-4DAD-A582-17E1CEB873EC}.Release|Any CPU.ActiveCfg = Release|x64
{18B6FB88-202F-4DAD-A582-17E1CEB873EC}.Release|Any CPU.Build.0 = Release|x64
{18B6FB88-202F-4DAD-A582-17E1CEB873EC}.Release|x64.ActiveCfg = Release|x64
{18B6FB88-202F-4DAD-A582-17E1CEB873EC}.Release|x64.Build.0 = Release|x64
{8B9F682D-145C-4085-AD8A-845255597F5D}.Debug|Any CPU.ActiveCfg = Debug|x64
{8B9F682D-145C-4085-AD8A-845255597F5D}.Debug|Any CPU.Build.0 = Debug|x64
{8B9F682D-145C-4085-AD8A-845255597F5D}.Debug|x64.ActiveCfg = Debug|x64
{8B9F682D-145C-4085-AD8A-845255597F5D}.Debug|x64.Build.0 = Debug|x64
{8B9F682D-145C-4085-AD8A-845255597F5D}.Release|Any CPU.ActiveCfg = Release|x64
{8B9F682D-145C-4085-AD8A-845255597F5D}.Release|Any CPU.Build.0 = Release|x64
{8B9F682D-145C-4085-AD8A-845255597F5D}.Release|x64.ActiveCfg = Release|x64
{8B9F682D-145C-4085-AD8A-845255597F5D}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{33A732D1-2B58-4FEE-9696-B9483496229F} = {CA6AB459-A31A-4C15-B1A6-A82C349B54B4}
{0DC7F5A2-E963-4E7F-BD37-6F7864B726F2} = {81B3B5D1-70F6-4979-AC76-003F9A6B316B}
{17BDD0A5-98E5-464A-8A00-050D9FF4C562} = {E6026D6A-01C5-4582-B2C1-64751490DABE}
{7DB87633-9CAB-4AE4-9ED0-AA6E77448486} = {E6026D6A-01C5-4582-B2C1-64751490DABE}
{3E571C7C-59B5-485C-AC78-3F34D3511CD2} = {E6026D6A-01C5-4582-B2C1-64751490DABE}
{05D61B37-9714-4234-9961-384A63F7175E} = {E6026D6A-01C5-4582-B2C1-64751490DABE}
{E1AC9797-ABE3-4881-A51B-37D8687AAE35} = {E6026D6A-01C5-4582-B2C1-64751490DABE}
{10FD4868-BB16-442B-B0AC-18AE278D9C60} = {E6026D6A-01C5-4582-B2C1-64751490DABE}
{2D5F23F7-3184-43EC-A7F1-C924F7FEF786} = {E6026D6A-01C5-4582-B2C1-64751490DABE}
{9531E3D2-217B-4446-98E8-E48F0FDD1452} = {28800357-C8CE-4CD0-A2AD-D4A910ABB496}
{F947BC6A-2943-4AC7-ACA7-F17351E25FE7} = {9531E3D2-217B-4446-98E8-E48F0FDD1452}
{C9391533-1F31-47F6-BE08-9642C95401A8} = {E6026D6A-01C5-4582-B2C1-64751490DABE}
{494703CF-C1C9-4800-B994-EF3974EB051D} = {E6026D6A-01C5-4582-B2C1-64751490DABE}
{D938612F-4B99-409E-953E-28A3A027B0E3} = {E6026D6A-01C5-4582-B2C1-64751490DABE}
{18B6FB88-202F-4DAD-A582-17E1CEB873EC} = {E6026D6A-01C5-4582-B2C1-64751490DABE}
{8B9F682D-145C-4085-AD8A-845255597F5D} = {E6026D6A-01C5-4582-B2C1-64751490DABE}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {A0750637-2CCB-4139-B25E-F2CE740DCFAC}
Expand Down
22 changes: 7 additions & 15 deletions cs/benchmark/ConcurrentDictionaryBenchmark.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
#pragma warning disable 0162

//#define DASHBOARD
//#define USE_CODEGEN

using FASTER.core;
using System;
Expand Down Expand Up @@ -55,7 +54,6 @@ public enum Op : ulong
Key[] init_keys_;

Key[] txn_keys_;
Key* txn_keys_ptr;

long idx_ = 0;

Expand Down Expand Up @@ -135,9 +133,7 @@ private void RunYcsb(int thread_idx)
chunk_idx = Interlocked.Add(ref idx_, kChunkSize) - kChunkSize;
}

var local_txn_keys_ptr = txn_keys_ptr + chunk_idx;

for (long idx = chunk_idx; idx < chunk_idx + kChunkSize && !done; ++idx, ++local_txn_keys_ptr)
for (long idx = chunk_idx; idx < chunk_idx + kChunkSize && !done; ++idx)
{
Op op;
int r = (int)rng.Generate(100);
Expand All @@ -152,21 +148,21 @@ private void RunYcsb(int thread_idx)
{
case Op.Upsert:
{
store[*local_txn_keys_ptr] = value;
store[txn_keys_[idx]] = value;
++writes_done;
break;
}
case Op.Read:
{
if (store.TryGetValue(*local_txn_keys_ptr, out value))
if (store.TryGetValue(txn_keys_[idx], out value))
{
++reads_done;
}
break;
}
case Op.ReadModifyWrite:
{
store.AddOrUpdate(*local_txn_keys_ptr, *(Value*)(input_ptr + (idx & 0x7)), (k, v) => new Value { value = v.value + (input_ptr + (idx & 0x7))->value });
store.AddOrUpdate(txn_keys_[idx], *(Value*)(input_ptr + (idx & 0x7)), (k, v) => new Value { value = v.value + (input_ptr + (idx & 0x7))->value });
++writes_done;
break;
}
Expand Down Expand Up @@ -434,9 +430,9 @@ private void LoadDataFromFile(string filePath)
{
stream.Position = offset;
int size = stream.Read(chunk, 0, kFileChunkSize);
for (int idx = 0; idx < size; idx += Key.kSizeInBytes)
for (int idx = 0; idx < size; idx += 8)
{
init_keys_[count] = *((Key*)(chunk_ptr + idx));
init_keys_[count].value = *(long*)(chunk_ptr + idx);
++count;
}
if (size == kFileChunkSize)
Expand Down Expand Up @@ -466,8 +462,6 @@ private void LoadDataFromFile(string filePath)
Console.WriteLine("loading txns from " + txn_filename + " into memory...");

txn_keys_ = new Key[kTxnCount];
GCHandle handle2 = GCHandle.Alloc(txn_keys_, GCHandleType.Pinned);
txn_keys_ptr = (Key*)handle2.AddrOfPinnedObject();

count = 0;
long offset = 0;
Expand All @@ -476,7 +470,7 @@ private void LoadDataFromFile(string filePath)
{
stream.Position = offset;
int size = stream.Read(chunk, 0, kFileChunkSize);
for (int idx = 0; idx < size; idx += Key.kSizeInBytes)
for (int idx = 0; idx < size; idx += 8)
{
txn_keys_[count] = *((Key*)(chunk_ptr + idx));
++count;
Expand Down Expand Up @@ -545,8 +539,6 @@ private void LoadSyntheticData()
RandomGenerator generator = new RandomGenerator();

txn_keys_ = new Key[kTxnCount];
GCHandle handle2 = GCHandle.Alloc(txn_keys_, GCHandleType.Pinned);
txn_keys_ptr = (Key*)handle2.AddrOfPinnedObject();

for (int idx = 0; idx < kTxnCount; idx++)
{
Expand Down
Loading